Questions tagged [equation-solving]

763 questions
1
vote
1 answer

How to solve a Linear System of Equations in Python When the Coefficients are Unknown (but still real numbers)

Im not a programer so go easy on me please ! I have a system of 4 linear equations and 4 unknowns, which I think I could use python to solve relatively easily. However my equations not of the form " 5x+2y+z-w=0 " instead I have algebraic constants…
jay
  • 13
  • 5
1
vote
1 answer

Solve Mod multiple equations

from sympy import * x = sym.symbols('x') result = solve([Eq(Mod(x, 23), 0), Eq(Mod(x, 41), 28), Eq(Mod(x, 829), 806), Eq(Mod(x, 13), 3), Eq(Mod(x, 17), 14), Eq(Mod(x, 29), 6), Eq(Mod(x, 677), 623), Eq(Mod(x, 37), 14), Eq(Mod(x, 19), 3)], x) raises…
1
vote
1 answer

multivariate equations solution with python

I have trouble with equations like: I have equations: a+b=10 a+b+c+d=20 I need the answer(all results must be positive): a=0 b=10 c=0 d=10 a=0 b=10 c=1 d=9 ... I need all possible solutions, can I use python to solve it?
Jialong Xu
  • 61
  • 9
1
vote
1 answer

Solving 6 non-linear equations for 6 variables not working

I am trying to solve a system of 6 non-linear equations for 6 variables but the notebook is continuously running for 2 days. What am I doing wrong? (Notebook attached) exp1 = ExpandAll[(xd1 - x1)^2 + (yd1 - y1)^2 + z1^2 == h1^2]; exp2 =…
MNK
  • 634
  • 4
  • 18
1
vote
3 answers

Nested array computations in Python using numpy

I am trying to use numpy in Python in solving my project. I have a random binary array rndm = [1, 0, 1, 1] and a resource_arr = [[2, 3], 4, 2, [1, 2]]. What I am trying to do is to multiply the array element wise, then get their sum. As an expected…
Acee
  • 109
  • 10
1
vote
2 answers

Rebuilding original signal from frequencies, amplitude, and phase obtained after doing an fft

Rebuilding original signal from frequencies, amplitude, and phase obtained after doing an fft. Greetings I'm trying to rebuild a signal from the frequency, amplitude, and phase obtained after I do an fft of a signal, but when I try and combine the…
Rick T
  • 3,349
  • 10
  • 54
  • 119
1
vote
1 answer

R reverse function to solve for parameter when output is a fixed constant

If I have a function estimator <- function(A,B) { A*(B+23) } How can I reverse this function to find the value of A for B as a sequence between 0 and 120 (B=1,2,3,4,...,120) that would give a fixed result, say C = 20? I would use it to map the…
1
vote
1 answer

Can't solve equation with sympy, works fine in mathcad prime

I'm trying to calculate the wet bulb temperature from dry bulb temp (dbt), relative humidity (rh) and pressure (p), so that I can monitor an air condition unit with a raspberry pi. I got the equation from a Research paper and it works fine and is…
Runenaldo
  • 13
  • 3
1
vote
1 answer

How to solve large nonlinear equations?

I have 3 large nonlinear equations with three unknowns, when I scipy.optimize.fsolve I obtain an answer around 10^85 which is too large. A Runtime warning is thrown as well. import scipy.optimize as opt def func(variables): (A, B, C) =…
1
vote
3 answers

How to solve this nonlinear equation in Python, Octave, or Matlab?

How do I solve this equation using Python, Octave, or Matlab? Need to be able to find the solution of x for different values of c.
sharib ahmed
  • 114
  • 10
1
vote
2 answers

Python: Find roots of 2d polynomial

I have a 2D numpy array C which contains the coefficients of a 2d polynomial, such that the polynomial is given by the sum over all coefficients: c[i,j]*x^i*y^j How can I find the roots of this 2d polynomial? It seems that numpy.roots only works…
torpedo
  • 23
  • 3
1
vote
0 answers

Using TensorFlow in R for solving equation

I am working on learning to solve equations in R and I am interested in doing it through TensorFlow (I already know how to do it using GA and Simulated Annealing). I am beginning with a simple equation: Y = X + Z, where X and Y are known and Z is to…
AshwiniJ
  • 51
  • 1
  • 5
1
vote
1 answer

Get a sample of n solutions of an under-determined system

I have a under-determined equation system (Ax = b) with infinite solutions. My goal is to get n random solutions (i.e n vectors x) for this system. Is it possible to do it with R (if possible with base R functions) ? With base::qr.solve() you can…
Paul
  • 2,850
  • 1
  • 12
  • 37
1
vote
0 answers

Substituting Periodic Fourier series expansion equation with standing wave equation

I can re-create a periodic signal using Fourier series expansion using sin and cos waves. But how can I adapt the equation so the equation will be outputted in the format of a standing wave equation. formatting may cut off some of the…
Rick T
  • 3,349
  • 10
  • 54
  • 119
1
vote
1 answer

Solving system of nonlinear complex equations in Python

I'm trying to solve a problem with 8 unknowns and 8 complex equations. I've tried to use fsolve but I get the error message: error: Result from function call is not a proper array of floats. From what I've now read fsolve doesn't support complex…