Approximate derivative within ODE function.
显示 更早的评论
Hi, I am solving a pretty big system of differential equations using 'ode15s'. Within the ODE function, I would like to calculate the second derivative of a variable for which I don't have an analytical expression (even though I know its first derivative). I wonder if there's any possible way to calculate an approximate second derivative for that variable, considering that this last appears in other model's equations.
Thanks in advance, Davide
1 个评论
Star Strider
2017-11-13
Davide Masiello’s follow-up Comment to my (now deleted) Answer:
I need to calculate the second derivative in the ODE function script because it appears as a member of other equations constituting the model, as in the following example:

where the second derivative of x is not given to know analytically. In the past, I used to stop the integration at a fixed and arbitrarily small time step to calculate the approximate derivative and then keep integrating with the last calculated value as new initial one, but I'd like to avoid this as the code runs correctly only with a varying step size. That's why I am wondering whether there's a more elegant solution to this problem.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!