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!