hello,
I am solving with ODE45 diff equations system. How can i change a paramter in time for ODE45?
I am solving for z, 1,2,3,4—–and i got a paramter in this equations alfa……after a while i need a different alfa which changes with: alfa=-11782*log(t) + 106989; t is time……so i want to solve ode if my z(2) is a certain calue after that i need alfa t change…..how can i solve this HELP me pls?
% if (z(2)>0.32)
% alfa=23950;
% else
% % alfa=-11782*log(t) + 106989;
% end
tspan=[0 500];[t,z]=ode45(@dYfdYdXdTgdTp,tspan,[y0 X0 Tg0 Tp0]);
alfa is in this @dYfdYdXdTgdTp function..
so i need something that after z(2) value reaching a certain value…..change my alfa in each step…whith an equation…
Best Answer