How can I plot a system of nonlinear ODEs with an added term used to model chemotherapy?

1 次查看(过去 30 天)
So this is the system of ODES (originally just dx/dt and dy/dt), the dz/dt is the chemotherapy term and the added exponential function on x and y relates to this. It has a right hand solution of z(t^+) = z(t) + u2. This subsytem of dz/dt and z(t^+) gives a periodic solution. I want to show how it makes an effect on the y term (tumour cells).
Solution to subsystem:
We have that TR_{CI} is: (where 1.400mg is u2)
I want to recreate these graphs, please help.
  4 个评论
Rakeeza Malik
Rakeeza Malik 2020-3-27
I have used ODE45 however my problem is that I don't know how to incorporate the condition of z(t^+) = z(t) + u2 to help simulate the system of ODES. Also how to incorporate it on different time intervals, as the value of z changes.

请先登录,再进行评论。

回答(1 个)

darova
darova 2020-3-28
Here is an idea:
function main
t1 = 0.01; % start period
t2 = tau-0.01; % end period
hold on
for i = 1:numOfPeriods
[t,u] = ode45(@f,[t1 t2],u0);
t1 = i*tau+0.01;
t2 = (i+1)*tau-0.01;
u0 = u(end,:); % initial condition for next period
plot(t,u(:,1)) % plot x(t)
end
hold off
end
function du = f(t,u)
x = u(1); y = u(2); z = u(3);
du(1,1) = ... % eq for dx
end
Do you have exact number of tau for your simulation?
Let me know if it's clear
  3 个评论
Rakeeza Malik
Rakeeza Malik 2020-3-28
Thanks for this suggestion! I have tried it but can't seem to make it work, u0 is coming up undefined. Also the inital value of tau for the first graph is 21, however for the other graphs tau changes, as you can see where I provided the values for u, the values of tau are next to them.
Also under du(1,1) would i then have the equations for all dx, dy, dz?
darova
darova 2020-3-28
  • Also under du(1,1) would i then have the equations for all dx, dy, dz?
Yes, but you should write it
du(1,1) = ... % eq for dx
du(2,1) = ... % eq for dy
du(3,1) = ... % eq for dz
  • I have tried it but can't seem to make it work
Can i see it?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by