how to solve this differential equation

1 view (last 30 days)
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.

Accepted Answer

Star Strider
Star Strider on 10 Jun 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 Comments
sri satya ravi
sri satya ravi on 10 Jun 2016
@(rcfv) rcfv.^(1-gama)/gama + ((gama-1)/2)*beta.^4 * rcfv.^(2/gama) - (gama+1)/2; .. Can I know what @(rcfv) at the starting of the equation do. and also can you please explain r_cfv(1) = fzero(f, 1) this equation.
Star Strider
Star Strider on 10 Jun 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.)

Sign in to comment.

More Answers (1)

adi kul
adi kul on 10 Jun 2016
Why iteratively when you have only 1 unknown variable?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!