Solve a nonlinear system
Mostrar comentarios más antiguos
I'm solving the following as:
f = @(R01) 1/(1+R01) - .95;
R01 = fzero(f,0);
f = @(R02) 0.08/(1+R01) + 1.08/(1+R02)^2 - .99;
R02 = fzero(f,0);
How can I solve the system in one shot, can't make it work with fsolve.
Thanks
Oleg
Respuesta aceptada
Más respuestas (2)
Matt Fig
el 4 de Mzo. de 2011
Do you mean get R01 and R02 in one shot, or do you mean find where the two functions meet (what I usually think of when someone says they want to solve a system of equations)?
If you mean, how to get to R02 in one shot,
f3 = @(R02) 0.08./(1+(1/.95-1)) + 1.08/(1+R02).^2 - .99;
R02 = fzero(f3,0)
Or,
f = @(R01) 1/(1+R01) - .95;
f = @(R02) 0.08/(1+fzero(f,0)) + 1.08/(1+R02)^2 - .99;
R02 = fzero(f,0)
1 comentario
Oleg Komarov
el 4 de Mzo. de 2011
Walter Roberson
el 4 de Mzo. de 2011
With the symbolic toolkit, it looks like
solve(0.8e-1/(1+solve(1/(1+RO1)-.95))+1.08/(1+R02)^2-.99)
and gives the values -2.087023117, 0.08702311660
1 comentario
Oleg Komarov
el 4 de Mzo. de 2011
Categorías
Más información sobre Systems of Nonlinear Equations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!