Solving a system of differential equation
1 回表示 (過去 30 日間)
古いコメントを表示
Can someone tell me why the answers are coming as 'NaN'?
Also in the first for loop, by writing dEs in descritized form (line 22 and 23) my aim is to find (dEs/dt) and use the value of Es in line 23. Also,after this loop, the final values of El and Es needs to be carried over to next loop. I have coded this as best as i know. Can someone tell me how i can find d(Es)/dt directly instead of discretizing it?
7 件のコメント
Ameer Hamza
2020 年 10 月 20 日
But a scheme like this will not work as expected. ode45() does not do one calculation in each iteration. It is an adaptive step-size algorithm, and the point moves forward and backward several times in each iteration for ode45 to decide what should be a good step length. So You might be expecting that it is the value from the previous iteration, but is not exactly that.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!