MATLAB: Ode15s

function handleMATLABodeode15spde

Solving a partial differential equation with ode15s,we know that this ode solver integrates the ode over time direvatives.I need to find the values of these time direvatives,do you have any special command? for example: for i=1:n dudt=uxx(i) end
how can I find these dudt at each time and x(i)? thanks alot

Best Answer

If you are solving something like
[t,x] = solver(odefun,tspan,y0)
and you want the time derivative at each point t(i), then that is simply
dxdt = 0*x; % initialize the array
for ii=1:length(t)
dxdt(ii,:) = odefun(t(ii),x(ii,:));
end
(edited to allow for the possibility that x has more than one component at each time t).
Related Question