SwissMapleBeginner

MaplePrimes Activity


These are questions asked by SwissMapleBeginner

Hello. I'm trying to model the pharmacodynamics of salicylic acid with two body comportants, SA1 and SA2. At t=1, I wish to inject a single pulse of salicylic acid in the system, so that the variable Inj is equal to Dose for t=1 and equal to zero for any other time t.

But dsolve doesn't seem to take into account this "ifelse" nature of Inj, and as a result, it yields the wrong solution where SA1 and SA2 remain at the initial condition zero throughout. How can I fix this? Here's my code:

restart;

k12:=0.0452821;
k21:=0.0641682;
k1x:=0.00426118;
Dose:=484;
Inj:=ifelse(t=1,Dose,0);

ode_sys:=diff(SA2(t),t)=SA1(t)*k12-SA2(t)*k21,diff(SA1(t),t)=Inj-k1x*SA1(t);

ics:=SA2(0)=0,SA1(0)=0;

Solution1:=dsolve({ode_sys,ics},{SA1(t),SA2(t)},type=numeric);

plots:-odeplot(Solution1,[[t,SA1(t),color="red",thickness=1],[t,SA2(t),color="blue",thickness=1]],t=0..500,labels=["Time t","Salicylic acid"],labeldirections=[horizontal,vertical]);

It finds a solution where SA1 and SA2 remain zero throughout, whereas due to the single pulse of salicylic acid, they should be non-zero.

I also tried: Solution1:=dsolve({ode_sys,ics},{SA1(t),SA2(t)},type=numeric,parameters=[Inj=ifelse(t=1,Dose,0)]); but here I get an error message

Can you help? Many thanks. I'm still learning Maple with the book "Mathematische Probleme lösen mit Maple", and now also with the site gould.prof/learning-maple

 

My apologies for such a basic question. But when I do: my_function:=int((t/τ)*exp(-t/τ),t=0..infinity), I get: lim_{t-->∞} (exp(-t/τ))*τ-(t*exp(-t/τ)) + τ, which with simplify I can get to: lim_{t-->∞} (-t + τ)*(exp(-t/τ))+τ

But why doesn't Maple automatically solve this limit to τ? What do I need to do more?

Thank you for your patient help! Mischa

Hello. Can anybody point out to me what I am doing wrong below? I'm trying to solve the online model 4.1 of the book "An introduction to infectious disease modelling" by E. Vynnycky & R.G. White (2010). But all the information is below. 

Where I get errors from the code below is right at the bottom, in dsolve:

# My Maple 2023 code:

restart;

# Initial values:

Sus_0 := total_popn - Infectious_0 - Immune_0:
Preinfectious_0 := 0:
Infectious_0 := 1:
Immune_0 := total_popn*prop_immune_0:

# Transmission- and infection-related parameters:

preinfectious_period := 8:
infectious_period := 7:
R_zero := 13:
f := 1/preinfectious_period:
r := 1/infectious_period:
beta := R_zero/(total_popn*infectious_period):
prop_immune_0 := 0:

# Demography-related parameters:

total_popn := 100000:

# Useful statistics:

new_infns := beta*Susc*Infe:
new_infectious := Prei*f:
prop_sus = Susc/total_popn:
R_n := R_zero*prop_sus:
propn_imm := 1 - prop_sus:
sum_pop := Susc + Prei + Infe + Immu:
ln_infectious := ln(Infe):
ln_cum_infe := ln(Cum_Infe):
ln_new_infectious := ifelse(0 < t, ln(new_infectious), 0):

# Defining the system of ODEs:

sys_ode:={
diff(Susc(t),t)=-beta*Susc(t)*Infe(t), 
diff(Prei(t),t)=beta*Susc(t)*Infe(t)- Prei(t)*f, 
diff(Immu(t),t)=Infe(t)*r, 
diff(Cum_Infe(t),t)= Prei(t)*f, 
diff(Infe(t),t)=Prei(t)*f-Infe(t)*r,
}:

ics:={
Susc(0)=Sus_0,
Infe(0)=Infectious_0,
Immu(0)=Immune_0,
Prei(0)=Preinfectious_0,
Cum_Infe(0)=Infectious_0
}:

Solution1:=dsolve({sys_ode,ics},type=numeric);
# HERE I GET THIS ERROR MESSAGE: "Error, (in dsolve/numeric/process_input) system must be entered as a set/list of

# expressions/equations"

 

Solution2:=dsolve({sys_ode,ics});
# HERE I GET THIS ERROR MESSAGE: "Error, (in dsolve) invalid arguments; expected an equation, or a set or list of them,

# received: {{diff(Immu(t),t) = 1/7*Infe(t), diff(Infe(t),t) = # 1/8*Prei(t)-1/7*Infe(t), diff(Prei(t),t) =

# 13/700000*Susc(t)*Infe(t)-1/8*Prei(t), diff(Susc(t),t) = -13/700000*Susc(t)*Infe(t), diff(Cum_Infe(t),t) = # 1/8*Prei(t)}}"

 

MY QUESTION: Can anybody tell me what I'm doing wrong in Solution1 and Solution2?

Best wishes and many thanks!

 

 

Page 1 of 1