How do I get ode45 to output the dependent variable value at each time step? I have other material properties in my differential equation that change with temperature, so I must update them with each change in temperature.
3 views (last 30 days)
Show older comments
the equation looks like this:
dT/dt = T/cB(T,B) * d/dT( M(T)) * d/dt( B(t))
cB(T) = the specific heat M(T) = the magnetization of the material
0 Comments
Accepted Answer
Jonathan Epperl
on 10 Jan 2013
The answer to your topic is that the odefun, i.e. the function you pass to ode45 as in ode45(odefun,tspan,x0) needs include the line
y
as in
function dydt = odefun(t,y)
%[...] code
y
but I don't think that's what you really want to do/know. Could you detail your question? Also, what is B(t), is that another state you're not telling us about, or is that a known function/input?
Is there a closed form of M(T), cB(T,B) that you are using, or is it a look-up table?
More 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!