Azzera filtri
Azzera filtri

How to solve differential equation with MATLAB

2 visualizzazioni (ultimi 30 giorni)
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 Commento
Torsten
Torsten il 11 Nov 2015
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.

Accedi per commentare.

Risposta accettata

nancy
nancy il 12 Nov 2015
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 Commento
Torsten
Torsten il 12 Nov 2015
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.

Accedi per commentare.

Più risposte (5)

nancy
nancy il 11 Nov 2015
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 il 11 Nov 2015
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 il 12 Nov 2015
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 Commento
Torsten
Torsten il 12 Nov 2015
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.

Accedi per commentare.


nancy
nancy il 12 Nov 2015
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 il 13 Nov 2015
Thank you very much for your helps.. It is ok.
Best wishes,

Community Treasure Hunt

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

Start Hunting!

Translated by