How can I write a sysmbolic function inside ODE45 function?

Hi everyone, I need some help with Matlab ODE 45, please help!! Thank you for your time! I need to solve a ODE system using ODE45, however some repetitive equations are very long and easy to mess up, is there a way for me to refer it as a variable and explicitly write out this variable outside the ODE45 expression, kind of like how I refered to k* in the picture. Thank you thank you thank you!!!

回答 (1 件)

Torsten
Torsten 2017 年 10 月 9 日

0 投票

If you define your ODE equations in a function, you can use multiple commands to do so.
Take a look at the third or fourth example under
https://de.mathworks.com/help/matlab/ref/ode45.html
Best wishes
Torsten.

カテゴリ

タグ

質問済み:

2017 年 10 月 9 日

回答済み:

2017 年 10 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by