Questions tagged [nonlinear-equation]

79 questions
1
vote
2 answers

solve non linear system of equations in sympy

I get a not-expected solution of this 6 equations' non linear system. I have 6 equations, 6 variables and other 5 constants (symbolic). import sympy as…
1
vote
0 answers

BBsolve for non-linear equation solving does not print results

I have the issue with the function BBsolve and dfsane, that I have a successful convergence, but I don't get the results (par is not printed, only: successful convergence), when trying to solve the following nonlinear equation system. Any help would…
Wengritzky
  • 11
  • 1
1
vote
2 answers

R nleqslv difficulties - solving for pH in an acid-base buffer

Goal Build a theoretical titration curve for the phosphoric acid buffer (1M). I provide a fully reproducible and self-contained example (of my failures ^.^). Model equations Acid-base equilibrium equations for phosphoric acid are: Model…
1
vote
0 answers

How it is possible to linearize this equation and to implement it in FreeFEM++ code?

I am contacting you to try to get some answers about a problem related to a non linear problem. In fact, I tried to linearize the equation so for this I took c1 = c10 + dc1 where c1 is my variable, c10 is an initial constant and dc1 is the…
1
vote
1 answer

How should I use syms with solve command in MATLAB?

I am having trouble solving this set of simultaneous nonlinear equations to determine the unknown variables a,b,c,d,e. It seems like my code enters in an infinite loop and never stops. syms a b c d…
1
vote
1 answer

How to write a subroutine for initial condition in Nonlinear Schrodinger Equation that depends on x

I am solving Nonlinear Schrodinger equation by split-step Fourier method: i df/dz+1/2* d^2f/dX^2+|f|^2*f=0 using an initial condition: f=q*exp(-(X/X0)^24). But I have to use the condition that q=1 for |x|<1, otherwise, q=0. So I write the following…
Miracles
  • 21
  • 7
1
vote
0 answers

Can't seem to get NLsolve to converge in Julia. Can you suggest any tips?

I'm trying to solve a life cycle problem in economics using Julia but I'm having trouble with NLsolve. The model boils down to trying to solve two a two equation system to find optimal leisure hours and capital stock each working period. The…
mark
  • 133
  • 3
0
votes
1 answer

Solving a symbolic system of equations returns only 2 accurate values

I have to solve a system of equations that satisfice some conditions. When I do it with solve from Sympy, I only get 2 out 8 values correct. Here's my code. import numpy as np from sympy import symbols, exp, Eq, solve gamma0, gamma1, gamma2,…
0
votes
0 answers

How to define transfer variables when solving equations in 1stOpt?

I am trying to solve a non-linear integration equations in 1stOpt. The parameters to be solved are x1, y1, Uratio, and 5 transfer variables are used to build the equations: Left, Right, C, pl, pr. ============================ Problems 1 The code…
0
votes
2 answers

Solving an equation with one variable in Python

I am trying to solve the equation: log(1+x)/x - 1/(1+x) == 2/3 * q * x**2 for x with q = 4e-4 I tried import numpy as np import scipy.optimize as so q = 4e-4 eqn = lambda x: np.log(1+x) / x - 1 / (1+x) - 2/3 * q * x**2 sol =…
Matrix23
  • 103
  • 4
0
votes
0 answers

Solving non-linear equation with number of equations greater than number of unknown parameters in R

I am trying to solve the attached equation using R. I tried nleqslv but it failed do to unequal length of equations and number of parameters. myFun<- function(p) { y <- numeric(7) y[1] = sum(gamma[,1]*x2)/p[1]-sum(gamma[,1]*x1)/(1-p[1]) -…
Ali
  • 1
  • 3
0
votes
2 answers

Size-1 array error when trying to solve system of nonlinear equations

Here is my code: import numpy as np import matplotlib.pyplot as plt g = plt.figure(1, figsize=(5,5)) delta = 0.025 x1,x2 = np.meshgrid(np.arange(-4,4.1,delta),np.arange(-4,4.1,delta)) f1 = math.sin(x1 + 1.5) - x2 - 2.9 f2 = math.cos(x2 - 2) +…
0
votes
2 answers

Three variables exponential equations in Python - solver options

Asking here is my last resort, I do not know where else to look or what my next option would be, apart from changing languages. I have a set of 3 heavy exponential equations, with 3 variables. All have the unknown variable in the exponent as well as…
0
votes
1 answer

Implementing Newton-Raphson Method for Nonlinear Circuit Simulation with Diode Components

I am working on a circuit simulator based on Modified Nodal Analysis (MNA), aiming to support nonlinear components such as diodes. To solve the nonlinear equations, I have implemented the Newton-Raphson method. However, I am facing issues with my…
Abdo21
  • 498
  • 4
  • 14
0
votes
0 answers

Solving a symbolic system of equations using sympy returns a non-empty result when not including some variables to solve for

I have the following script where I am trying to solve a system of equations symbolically using sympy: import sympy as sp from sympy import Eq, Function, Symbol, symbols, solve, simplify, collect, pprint from sympy import Sum, latex ## TODO Create…