Questions tagged [equation]

A statement that the values of two expressions are equal indicated by the sign = .

0
votes
0answers
15 views

What is the formal regression equation used by lm.cluster in R?

When using lm.cluster, I have three fixed effects variables (which have different levels), and 1-3 'explanatory' variables (in one case I have 1, and in another case I have 3). What is the formal ...
-1
votes
3answers
44 views

Display the item nearest to current time

I have a list of dates/times items in PHP array that are formatted like this: 2019-03-19 00:00:00 2019-03-19 02:30:00 2019-03-19 05:00:00 2019-03-19 14:30:00 2019-03-19 23:59:59 etc. I'm sure this ...
2
votes
2answers
49 views

Finding the odd point in a dataset without using loops

I am given a set of points (p1,q1) (p2,q2) ... (p20,q20) which satisfy the function q = 1/(ap + b)^2 except that one of these does not satisfy the given relation. The values of a and b are not given ...
0
votes
1answer
49 views

Calculate variables from 6 non-linear equations with 6 unknowns in R

Looking to calculate a,b,c,d,e,f (6 variables) from 6 non-linear equations: The following is my code library('BB') library('nleqslv') y <- rep(NA,6) params <- function (x) { a <- x[1] b &...
2
votes
0answers
43 views

Is there a way to change a string equation into a sympy equation?

When the user enters a value from a dropdown menu in Tkinter (e.g. frequency), all the equations containing the parameter will be displayed. I have managed to find all the equations when a value is ...
-1
votes
0answers
19 views

More advanced mathematic typesetting using groff and eqn?

I've been learning Groff and eqn for document typesetting - I'm a physics and mathematics student, so a lot of my documents require semi-complex mathematical formatting. Generally, I'm using eqn for ...
-2
votes
0answers
29 views

How to add regression equation and r^2 to plot [duplicate]

I have tried countless other attempts at getting the regression equation and r^2 onto my graph. Here is the code and graph it produces... temp_var <- predict(model1, interval="prediction") new_df &...
-2
votes
0answers
40 views

Equations with boundary condition in python

I want solve an equation with boundary coundition Here is first equation : d/dx (k * dT/dx) = 0 k=1000 After 2 integral we have this equation : T = (C1 / k) x + C2 And the boundary conditions are ...
0
votes
0answers
15 views

How to solve overdetermined quadratic system in Circle Packing

I'm working on a program where I have to satisfy an overdetermined system of non-linear equations. Basically, the program will add points dinamically, and every new point must be added where it ...
0
votes
2answers
95 views

How to solve a linear system of a square matrix in C++ when the matrix has no LU-Decomposition?

I have been trying to develop a program to solve a system Ax=b for a square matrix A using LU-Decomposition. However, I realized that this decomposition does not always exist (one way to tell is if a ...
0
votes
0answers
10 views

Equation to calculate position in grid

I have this pattern and am not sure exactly how to turn it into an optimized equation for mapping to a block (0000, 1111, or 2222). 1111 0000 1111 0000 2222 2222 2222 2222 0000 1111 0000 1111 2222 ...
-1
votes
0answers
28 views

Calculating Loss Ratio when Premium is Negative

I've been looking around the Interwebz and have been unable to satisfactorily answer this question. I've looked at documentation from actuaries, insurance companies, and a number of other sources, ...
0
votes
0answers
8 views

asciimath: Equation numbers

How can I get equation numbers added to asciimath:[] expression? That is, how can I get the '(5)' in the formula such as E = m c^2 (5) Is there a method to refer to equation ...
0
votes
0answers
31 views

NameError: name 'x' is not defined for an equation program

I am trying to program an iterative equation that will iterate the equation based on the number of times a user specifies. I have the following code: import matplotlib.pyplot as plt import numpy as ...
-1
votes
4answers
37 views

Python3 - solve math equations that are in string format [duplicate]

Is there a way to solve math equations that are in string format? For example, I have x = 2 y = 3 equations_str = ('x+y', 'x-y') and I want a function that will give results = (5, -1) I want to ...
0
votes
0answers
24 views

Equation of line bending into a 3D knot

I want to animate a line bending into a knot for a presentation. I cannot figure out what equations I need to model. I know the equation of knot, but is it possible to know what equation the particles ...
0
votes
2answers
37 views

Python: read a variable from list of a file in order to calculate equation

I have to calculate different equation (we assume 3 reactions). Each one uses a different variable and I have to read this variable from a file list.txt. So my idea is: f = open('list.txt') lines = f....
0
votes
0answers
13 views

an error while multiplying two symbolic functions in system differential equation

Iam running this code in matlab to solve a system of two diff equations. Every thing works until I add in "eq2" a multiplication by t, and then I got an error Warning: Explicit solution could not be ...
-3
votes
3answers
48 views

Iteration for x value in equation

I've been set a task to iteratively calculate the value of x of the given formula : x3 - 3x + 4 = 0** using trial and error. The code will first plug in -1.5 as its first guess and then work up or ...
0
votes
0answers
11 views

Describing long numbers in a short way

Imagine we have a number with N digits. N can be 100, 200, 1000,000, etc. Let's suppose we have a 100,000-digit number. Such a number can start with 0000000..................00001 (with 100,000 ...
0
votes
0answers
29 views

Solve constrained equation with 12 variables

I am struggling with something that should be a simple task. I want to solve this equation to find all the possible solutions (for Xi, i=1...12). Y = a*X1 + b*X2 + .... + z*X12 (I have 98 fixed ...
0
votes
0answers
19 views

How to use the Levenberg-Marquardt algorithm to fitting data and get the first derivative in Matlab?

I'm implementing the Levenberg-Marquardt algorithm in matlab to minimize a set of data resulting from a black-box equation. My question is how to calculate the jacobian matrix?
2
votes
2answers
80 views

Parse equation to list of tuples in Python

I want to parse equations and get a list of tuples. For example, when I enter 2x = 4+3y, I want to get [('', '2', 'x', '='), ('','4','',''), ('+','3','y','')] This is my regex so far: ([+-]*)(...
2
votes
0answers
28 views

Solve equation saved within a column

I have a data frame in R with a series of equations as a column and the variables to be used in the equation in additional columns: data.frame (equation = c('2+d','2+4+d*h','(5*d^h)/100'), ...
0
votes
0answers
32 views

Algorithm to solve diophantine equation

I'm trying to develop an algorithm for finding positive integer solutions with an upper bound of a diophantine equations like this: a^3 + b^3 + c^3 = d^3 For example: 3^3 + 4^3 + 5^3 = 6^3 I want ...
-3
votes
1answer
21 views

Plot solutions of bivariate polynomial equation [closed]

How can I plot the solutions of this equation in R? (x²+y²-1)³=x²y³
1
vote
1answer
51 views

Correlation coefficient for three variables in r

For three n-dimensional non-zero-variance variables a, b, and c, n > 2, if r(ab), r(bc), and r(ac) are Pearson’s correlation coefficients between a and b, between b and c, and between a and c, ...
-1
votes
1answer
34 views

How to return all whole positive values for a+b = c+d while a,b,c, and d are not equal to each other?

Is there a way I can find all the values between certain parameter such as (1,10) that satisfy a+b = c+d while a,b,c, and d are not equal to each other. var a; var b; var c; var d; function ...
1
vote
0answers
43 views

Writing a correlation equation into R

I am trying to turn this equation into r-code to apply to a dataset. I made an example data set: a <- c(4, 6, 2, 5) b <- c(8, 1, 3, 7) c <- c(6, 3, 1, 3) d <- c(7, 5, 7, 5) data <- ...
-2
votes
2answers
51 views

C++ results with formula not matching specifying value

Why do the following not equal each other? 0.37024025 and (sqrt(2)*M_PI/3)*(1/4) I see significant divergence in my solution, but all I did was place a number with the formula behind it.
2
votes
1answer
37 views

OpenCV solve returning constant value for arbitrary system?

I initialize a 4x4 matrix to the identity matrix. Then I initialize a 4x1 vector B with random values. And I want OpenCV to solve the system Ax = B. Since A is the identity, my expectation is that x =...
0
votes
1answer
21 views

variable extraction from equation in MATLAB

I'm trying to solve for T4 in the following equation in MATLAB, I have all other variables defined and I need to extract T4 from equation 1. Is there a quick way to do this rather than manually ...
0
votes
0answers
22 views

What is the error with equating a value in an ArrayList to a String? **The ArrayList is type String** [duplicate]

I am trying to create a quiz type thing for Math 30-1. I just started and have already run into an issue that I have never had before, (or can't remember how to fix it). Below is a piece of the code ...
-2
votes
1answer
26 views

Python - optimizing math equation for a simple guessing game score calc

I'm trying to create a equation similar to a messy block of code I've made, to calculate the score based on the amount of guesses a player took in a guessing game. The player has 10 tries. For every ...
0
votes
2answers
51 views

Nesting if statements no strings

I am doing a Palindrome number sequence. I've got the math set up, but I'm having trouble nesting my if statements only showing one answer. I've attempted to remove the 'if' from the 'else if' but ...
1
vote
2answers
112 views

Plotting a circle equations in Julia

I have a problem to plot a circle equation in Julia. I'm trying to plot these two equations: 2y^2 + x^2 = 2 (x-1)^2 + (y-1/2)^2 = 1/4 At this time, the only solution i found is using ...
3
votes
1answer
67 views

Using scipy solve_ivp for equation with initial conditions

I am having a hard time getting used to scipy's solve_ivp. So let's say we have an ordinary linear differential equation of second order, spring for example (y'' = -k**2*y). Conditions are when the ...
1
vote
3answers
48 views

Code Double Equation Error for User Input Problem

My first assignment is to develop a code that allows the user to input data for the distance in miles they wish to travel, the fuel efficiency, and the cost of gas. Then create a code in order to ...
0
votes
0answers
12 views

using an array in an equation in python

So I am trying to loop through an array in an equation and I can't seem to find my error. lamda[wav] is where I need to pull the number in the lamda array. The code is as follows. import math c = ...
0
votes
0answers
32 views

Creating equation using matlab

I'm trying to perform blind source separation (BSS) on bioacoustic signals using DUET algorithm. I have 4 individual sources. Can anyone help me to write Matlab codes if I want to artificially mix the ...
1
vote
2answers
92 views

Find (x,y) solutions to equation

The program receives a positive number k from the user and should check how many solutions there are to the equation 3*x+5*y=k In case of many solutions the function takes the greater absolute value ...
0
votes
0answers
18 views

Stringing together a sentence from data that includes dates

I have a question regarding this topic; I'm also looking to put together a string of data into a sentence using excel, and the issue I'm running into involves dates. ="ISP Annual was completed on "&...
0
votes
1answer
54 views

how to find satistics of the fitted parameter of an equation [closed]

For instance: a, b, c and n are the three constants, which are required to be calculated by using data fitting method in a particular equation. How can I calculate the statistics (mean, standard ...
1
vote
1answer
31 views

How to make a function in python that takes a product and re substitutes in equation to get a solution

I'm trying to make a function in Python 3 that takes an initial value, plugs it into an equation, takes that solution, and iterates the process as many times as specified as a parameter of a function. ...
0
votes
1answer
60 views

Python - Finding the linear equation of a line in a image

I am using Python v2.7 for this work. As an input i have a relatively white image with a clear black line on it. The line is always linear, no polynomial of second or above order. The line can be ...
-2
votes
1answer
66 views

looping a mathematic equation [closed]

so i'm trying to make a cashier like program that keep add up depend on how much the user buy the product, but my program wont add the value but it keep replacing it Class: public class Class { ...
-3
votes
1answer
68 views

Solving Ax = b , CUDA vs Matlab

I've done the following test on Matlab: n = 10000; A = rand(n,n); b = rand(n, 1); tic y = A\b; toc On my Intel i7 gen 5 machine (12 cores) the result is ~ 5 seconds. Then, I've trying to do the ...
11
votes
1answer
693 views

Convert an equation to Python

I have several equations and need to convert it into Python. The problem is that I tried to plot a graph according to the equation. However, the graph that I get is not the same as the original one. ...
0
votes
1answer
75 views

how can I use sympy to solve system of equations with constraint conditions

the example like this: x1 + x2 + x3 + x4 = 1 x3 + x4 = 1 x4 + x5 = 1 x4 + x5 + x6 = 2 x1,x2,x3,x4,x5,x6 belong to this set {0, 1} so you see, it's a linear system of equations. ...
-2
votes
1answer
57 views

How to covert this specific equation to matlab code [closed]

How to represent this equation to matlab code

http://mssss.yulina-kosm.ru