how to solve this differential equation
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
sri satya ravi
el 10 de Jun. de 2016
Comentada: Star Strider
el 10 de Jun. de 2016
I want to solve the equation iteratively for rcfv. I have the value of gama = 1.399 and beta = 0.675. How can I solve this equation to get the value of rcfv.
0 comentarios
Respuesta aceptada
Star Strider
el 10 de Jun. de 2016
This will get you two real values for ‘r_CFV’:
gama = 1.399;
beta = 0.675;
f = @(rcfv) rcfv.^(1-gama)/gama + ((gama-1)/2)*beta.^4 * rcfv.^(2/gama) - (gama+1)/2;
r_cfv(1) = fzero(f, 1)
r_cfv(2) = fzero(f, 10)
x = linspace(-20, 20);
figure(1)
plot(x, f(x))
grid
Use the Optimization Toolbox fsolve function with real and complex initial estimates to get complex values. Another option is the Symbolic Math Toolbox solve function.
2 comentarios
Star Strider
el 10 de Jun. de 2016
I created an anonymous function (see the section on Anonymous Functions in Function Basics) from your equation. The ‘@(rcfv)’ creates a function handle.
Since I expressed your equation as an implicit function, I used the fzero function to find both real roots (there appear to be only two when I plotted your function) at:
r_cfv =
277.0523e-003 8.5921e+000
As I mentioned in my original Answer, there may be complex roots as well that you would have to use the Optimization Toolbox fsolve function or the Symbolic Math Toolbox solve function to find. (When I tried it with the Symbolic Math Toolbox, it only returned the one real solution at 8.5921.)
Más respuestas (1)
Ver también
Categorías
Más información sobre Calculus en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!