how to solve this differential equation

조회 수: 1 (최근 30일)
sri satya ravi
sri satya ravi 2016년 6월 10일
댓글: Star Strider 2016년 6월 10일
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.

채택된 답변

Star Strider
Star Strider 2016년 6월 10일
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
sri satya ravi
sri satya ravi 2016년 6월 10일
@(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 2016년 6월 10일
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.)

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

adi kul
adi kul 2016년 6월 10일
Why iteratively when you have only 1 unknown variable?

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by