필터 지우기
필터 지우기

How to solve differential equation with MATLAB

조회 수: 2 (최근 30일)
nancy
nancy 2015년 11월 11일
답변: nancy 2015년 11월 13일
Hi,
I have a problem related to solving differential equation. The equation is:
(3/2)lnX + 3886/x = 19
I can not solve this equation. I must find 'x' value..
How can I solve this with Matlab?
Thanks for your help.
  댓글 수: 1
Torsten
Torsten 2015년 11월 11일
X and x are the same ?
Why is your problem related to solving a differential equation ? The equation you wrote is an algebraic equation.
Best wishes
Torsten.

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

채택된 답변

nancy
nancy 2015년 11월 12일
Hi Torsten,
Actually I have understood the first equation and x is nearly 372000 derived. But it is a very high value and I can say it is not logical for my solution.
When I try an arbitrary value as nearly 375, the solution can be acceptable for me. 375 may be more logical for me.
That is to say; can there be a second answer of this equation?
Best regards,
  댓글 수: 1
Torsten
Torsten 2015년 11월 12일
MATHEMATICA finds two solutions:
Use MATLAB's "fzero" to get the smaller solution:
f=@(x)1.5*log(x)+3886/x-19;
x0=[300 400];
sol=fzero(f,x0)
Best wishes
Torsten.

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

추가 답변 (5개)

nancy
nancy 2015년 11월 11일
Sorry.. You are right.. It is an algebraic equation, I wrote false..
And x and X are the same. I mean it is:
(3/2)lnX + 3886/X = 19
You can take care above equation.
Could you please help me and give me a clue to solve that?
Thanks for your help..

Torsten
Torsten 2015년 11월 11일
Does this work ?
syms x
eqn = 1.5*log(x)+3886/x-19 == 0;
sol = solve(eqn,x);
The result should be some expression containing the Lambert-W-function.
Best wishes
Torsten.

nancy
nancy 2015년 11월 12일
Hi,
When I operate the above code, it gives an answer just like this:
sol =
exp(38/3)*exp(wrightOmega(pi*i + log(7772/3) - 38/3))
So, it doesn't give an exact solution..
What can I do at this step? I must find the X value as numerical.
  댓글 수: 1
Torsten
Torsten 2015년 11월 12일
Does this work ?
syms x
eqn = 1.5*log(x)+3886/x-19 == 0;
sol = solve(eqn,x);
solnum = eval(sol);
disp(solnum)
Best wishes
Torsten.

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


nancy
nancy 2015년 11월 12일
Hi Torsten,
Actually I have understood the first equation and x is nearly 372000 derived. But it is a very high value and I can say it is not logical for my solution.
When I try an arbitrary value as nearly 375, the solution can be acceptable for me. 375 may be more logical for me.
That is to say; can there be a second answer of this equation?
Best regards,

nancy
nancy 2015년 11월 13일
Thank you very much for your helps.. It is ok.
Best wishes,

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by