# Question:dsolve doesn't take into account ifelse definition of variable

## Question:dsolve doesn't take into account ifelse definition of variable

Maple

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

﻿