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

1 view (last 30 days)
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 Comments
Rakeeza Malik
Rakeeza Malik on 27 Mar 2020
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.

Sign in to comment.

Answers (1)

darova
darova on 28 Mar 2020
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 Comments
Rakeeza Malik
Rakeeza Malik on 28 Mar 2020
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 on 28 Mar 2020
  • 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?

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!