Skip to main content
6-Contributor
January 27, 2024
Solved

Need some help to solve differential equation with AdamsBDF solver

  • January 27, 2024
  • 1 reply
  • 944 views

Hello,

 

Currently I have been facing some errors to solve differential equations using AdamsBDF solver.

Your kind help or advice will be very much appreciated.

Please see the belwo images and attached file for equations and the problem with "D"_Red Circle.

 

_10843142_1-1706359609828.png

 

_10843142_2-1706359662374.png

 

Thank you.

 

 

Best answer by Werner_E

When you defined D(t,X) you type a square bracket for the second entry and so you created inadvertently a 1x1 matrix .

Simply use 'normal' parentheses and its works:

Werner_E_0-1706559266952.png

BTW, there is no need to use a solve block when you use one of the stand alone ODE solvers. A solve block is needed only when you use 'odesolve'.

 

You may get a smoother result if you either increase N significantly or use a smaller interval [Ti; Tf], or both:

Werner_E_1-1706559695337.png

 

 

1 reply

Werner_E25-Diamond IAnswer
25-Diamond I
January 29, 2024

When you defined D(t,X) you type a square bracket for the second entry and so you created inadvertently a 1x1 matrix .

Simply use 'normal' parentheses and its works:

Werner_E_0-1706559266952.png

BTW, there is no need to use a solve block when you use one of the stand alone ODE solvers. A solve block is needed only when you use 'odesolve'.

 

You may get a smoother result if you either increase N significantly or use a smaller interval [Ti; Tf], or both:

Werner_E_1-1706559695337.png

 

 

25-Diamond I
January 29, 2024

In case you are interested, here is the system solved using a solve block with odesolve.

Werner_E_2-1706560240207.png

Prime 9 sheet attached