how to solve this differential equation
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
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
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개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!