can you iterate a change in odefun for ode45?

1 visualización (últimos 30 días)
Martin
Martin el 11 de Jun. de 2013
Hi, so I am wanting to plot how a solution to a set of coupled odes change as the function changes by some iterated amount. I have something like this so far:
for ip = 1:length(phi)
for it = 1:n
phii = phi(ip);
tt = timerangei(it); %defining the integration time start.
%ttt = timeranger(it);
[t,x] = ode45('Et_Field_ODE45_w2w_phiscan',tt:0.001*1e-15:tf,[0,0],phii); %solving the coupled odes.
allx{ip,it,1} = x(:,1); %assigning the traj to cell
allv{ip,it,1} = x(:,2); %assigning the velo to cell
allt{ip,it,1} = t; %assigning the time to cell
end
end
So as you can see I am changing the time between tt and tf, but also wanting do that for an iterative change of the phase, phi. Is this something you can do or am I looking at a manual job? At the moment, I thought I'd be able to insert the value of phi, but the way ode45 works it reads phii as an option...
Thanks

Respuestas (0)

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by