How to convey time variant variables to DAE solvers (ode15s, etc - symbolic approach)?
1 view (last 30 days)
Show older comments
Consider large set of DAE equations. Each equation depends on state variable such as x(t), y(t), etc. These variables are known within their domain, but they do change in time. In documentation there is a step 4: Convert DAE Systems to MATLAB Function Handles that explains how to supply numerical values to constant variables, however there is no mention about time dependant ones.
I know that one can call solver with function handle to custom function that has independent variable within its argument, i.e.
[T, solution] = ode15s(@odefun, [t0, tf], initial_y);
function Y = odefun(t,y)
% t is independent variable. Now we can count x(t), such as
x = getx(t);
(...)
end
ode15s(F, [t0, tf], y0, opt)
where F and M (hidden inside opt) are constant function handles (obtained in step 4), whereas should be time dependent like in code above.
Regards, Paul.
0 Comments
Answers (0)
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!