# Code of Exponential Discontinuous Function

2 views (last 30 days)
Rendy Dalimunthe on 12 Jun 2015
Answered: Nobel Mondal on 12 Jun 2015
Hi All
I have two exponential discontinuous equations as attached.
I have coded them to plot the result that I want. It seems worked for me if I only coded each of them separately. But I am unable to coupled them together in one code in order to plot them in one graph (t from 0 until 32400). I attached my code also.
I would like to ask input from you all.
Thanks.

Nobel Mondal on 12 Jun 2015
Does this give the desired plot?
Dd = 50;
Td = 3600;
A1 = 74.6;
alpha1 = 2.43*(10^(-3));
A2 = 2.49;
alpha2 = 2.83*(10^(-4));
A3 = 0.552;
alpha3 = 1.18*(10^(-5));
t = 0:32400;
term1 = (A1/alpha1)*(1-(exp(-alpha1*t)));
term2 = (A2/alpha2)*(1-(exp(-alpha2*t)));
term3 = (A3/alpha3)*(1-(exp(-alpha3*t)));
term4 = (A1/alpha1).*((exp(alpha1*Td))-1).*(exp(-alpha1*t));
term5 = (A2/alpha2).*((exp(alpha2*Td))-1).*(exp(-alpha2*t));
term6 = (A3/alpha3).*((exp(alpha3*Td))-1).*(exp(-alpha3*t));
Cv = (t<Td).*((Dd/Td)*(term1+term2+term3))+(t>=Td).*((Dd/Td)*(term4+term5+term6));
s = 0.25;
hold on
%calculate free doxorubicin concentration in plasma (Cfp)
Cfp = s.*Cv;
%calculate bound doxorubicin concentration in plasma (Cfp)
Cbp = (1-s).*Cv;
plot(t/Td,Cfp, t/Td, Cbp);
ylabel ('Concentration Doxorubicin in Plasma for Continuous Injection ');
xlabel ('Time (hours)');
legend('Cfp=free doxorubicin','Cbp=bound doxorubicin');
legend('Cfp=free doxorubicin','Cbp=bound doxorubicin');
hold off