Question: How do i create an Explore plot?

I am trying to model the change in bloodglucose when performing a OGTT (Oral glucose tolerance test). In connection to this I've created a compartmentmodel consisting of two compartments; one for the stomach and one for the blood. Based on this compartmentmodel I've formulated two differentialequations describing how the glucose concentration in respectively the stomach and the blood changes. I've then solved this system of differential equations and I'm now trying to adjust the variables to make the graphs look like the one from a glucose tolerance test but I'm having trouble creating an Explore-plot.

restart

 

 

 

Absorption from stomach

diff(Cm(t), t) = -Ka*Cm(t)                                  (1)

 

Solution to (1)

Cm = c*exp(-Ka*t)                                              (2)

 

Glucose concentration in blood

diff(Cb(t), t) = Ka*Cm(t)-Ku*Cb(t)                (3)

 

(2) Is put into (3)

diff(Cb(t), t) = Ka*c*exp(-Ka*t)-Ku*Cb(t)          (4)

 

(Ku*Cb(t)) gets added

diff(Cb(t), t)+Ku*Cb(t) = Ka*c*exp(-Ka*t)        (5)

 

Solution to (5)

"Cb(t):=(e)^(-∫Ku ⅆt)*∫Ka*( c0*(e)^(-Ka*t))*(e)^(∫Ku ⅆt) ⅆt+c*(e)^(-∫Ku ⅆt)" = proc (t) options operator, arrow, function_assign; exp(-(int(Ku, t)))*(int(Ka*c0*exp(-Ka*t)*exp(int(Ku, t)), t))+c*exp(-(int(Ku, t))) end procNULL

 

Solution to (1)

  "Cm(t):=  c0*(e)^(-Ka*t)" = proc (t) options operator, arrow, function_assign; c0*exp(-Ka*t) end procNULL

  NULL

Explore(plot([Cb(t), Cm(t)], t = 0 .. 100, y = 0 .. 50), parameters = [Ka = 0 .. 10, Ku = 0 .. 10, c0 = 0 .. 20, c = 0 .. 20], initialvalues = [Ka = 1, Ku = 1, c0 = 1, c = 1])Warning, expecting only range variable t in expression -exp(-Ku*t)*Ka*c0/(Ka-Ku)*exp(-Ka*t+Ku*t)+c*exp(-Ku*t) to be plotted but found names [Ka, Ku, c, c0]

 

Download Explore_plot.mw

Please Wait...