cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Solving two simple ordinary differential equations with odesolve. Why the second one fails?

-MFra-
21-Topaz II

Solving two simple ordinary differential equations with odesolve. Why the second one fails?

Hi all!

Maybe I'm losing in a glass of water, but I can not solve the second differential equation with odesolve, in the problem hereunder exposed. What's wrong?

two simple odes.jpg

ACCEPTED SOLUTION

Accepted Solutions
ViktorKorobov
14-Alexandrite
(To:-MFra-)

Dear F.M.,

Choose the method for solving the ODE by right-clicking on Odesolve: Adaptive instead AdamsBDF.

two_eq.png

Viktor

Viktor

View solution in original post

9 REPLIES 9
vlehner
14-Alexandrite
(To:-MFra-)

Hi F.M.

I'm missing the equation Fy(x) in the solver.

(or is it F0y(x)?) if yes, i got this solution:

is this right?

Best Regards, Volker

Volker
-MFra-
21-Topaz II
(To:vlehner)

Thanks Volker,

This is a basic case and I need to check out the results.

In the general case, the analytical solution of the first equation is not known. It is used in the second where the problem arises.

Greetings

Frank

vlehner
14-Alexandrite
(To:-MFra-)

Hi Frank,

And the answer is sooooooo easy with the choice of Adaptive mode.

You can keep your sheet like it was in the origin and change only to adaptive and it works perfectly.

Viktor is absolutely right.

Man lernt nie aus....

Greetings, Volker

Volker
ViktorKorobov
14-Alexandrite
(To:-MFra-)

Dear F.M.,

Choose the method for solving the ODE by right-clicking on Odesolve: Adaptive instead AdamsBDF.

two_eq.png

Viktor

Viktor

Hi Viktor,

thank you very much.

Greetings

Frank

ViktorKorobov
14-Alexandrite
(To:-MFra-)

Frank, I was glad to help. But I do not know why Adams/BDF-method not work here.

Viktor

Viktor

This is not clear to me as well. Let's wait and see if there is someone who will tell us about it.

Frank

Werner_E
25-Diamond I
(To:-MFra-)

At least I can explain whats going on (but not exactly why its going on 😉

Both odesolve-block should solve for x from 10^-6 up to 4*10^-6.

But the second block calls the first and already  in the 15th try the adamsBDF feeds x=4.34*10^-6 inF.y(x) which makes the first solve block fail because that value is grater than the upper limit 4*10^-6.

Attached are the x-values used by AdamsBDF and Adaptive (the latter is truncated as i did not want to wait for all the writing to finish).

If you trap that error, you can also use AdamsBDF in your second solve block:

-MFra-
21-Topaz II
(To:Werner_E)

Thank you very much, Werner.

Franc

Announcements

Top Tags