Friday, 15 February 2013

variable input changing in time, ode45 MATLAB -



variable input changing in time, ode45 MATLAB -

i want compute solution of first order differentiable equation using ode45 in matlab.

but want compute solution in precise times , knowing input variable in instants.

let t vector n time instants want compute solution, , u input vector n values, $u(k)$ value of $u$ @ instant $k$, , $k$ belong $t$.

i phone call ode45 function as:

[t,t_dot]=ode45(@f_mass,t,.01,odeset,u);

and f_mass is:

function t_dot=f_mass(t,t,u) t_dot=(1-u)*t; end

how can specify u u(t)?

thanks

matlab

No comments:

Post a Comment