How can I extract extra variable from ode solver ?

1 次查看(过去 30 天)
Hi everyone, I am trying to extract some extra variable from ode-solver (ode15s here) by using the 'OutputFcn' option with odeset.
Unfortunately I can't make it work and I don't know why, I think it's because the variable I want to extract are computed through time-dependent terms and I am not sure if the function for the 'OutputFcn' option accept this kind of terms...
I tried other technics like using 'save' but it saves vector with bigger size than the tspan vector, and with strange value (I saved dX via the solver and via the 'save' function and I find different values..)
I leave you my Output function, knowing that normally the terms s,c,sp are computed in the main file for the ode15 and interpolated with the t term to solve the ODE system (for the OutputFcn I tried to compute these terms inside, outside etc..)
PS: you can directly run the mainODE file
Thanks a lot for your help

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by