fsolve for generated equations
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Aniket Roy
el 1 de Jun. de 2021
Comentada: Star Strider
el 9 de Jun. de 2021
Dear Matlab Community,
While doing a solution with MATLAB, I got 2 nonlinear equations, say, eqn1 and eqn2 generated with two variables s and t in output. The size of equations are large (got as output). How can I use "fsolve" for solving them without copying them from the output and without setting x(1) and x(2) but defining
and
?
and
?0 comentarios
Respuesta aceptada
Star Strider
el 1 de Jun. de 2021
Having the equations themselves would hellp.
However assuming they are something like this:
y1 = s.^2 + 10*t;
y2 = 10*s + t.^1/3;
I would code them as:
y1 = @(s,t) s.^2 + 10*t;
y2 = @(s,t) 10*s + t.^1/3;
then:
X = fsolve(@(x) [y1(x(1),x(2)); y2(x(1),x(2))], [3 9])
.
4 comentarios
Star Strider
el 9 de Jun. de 2021
I need either to have the actual equations, or the information necessary to calculate ‘y1’ and ‘y2’.
I cannot go further without that information.
Also, what variables are they to be solved for?
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


