insulindouble - % k21 = kinetic rate constant from kidneys...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function dz = insulindouble(v,z) % INSULIN is a function that uses a "compartment model" to view the % concentration of insulin in the blood, kidneys, pancreas, and abdomen % after it is injected into the abdomen. This function is utilized by a % ode45 in the Command Window, inputting the time steps(0,15)and the initial % conditions (0,0,0,25). % % BEE 1510: Introduction to Computer Programming % Laboratory Exercise 11: Modeling Insulin Loading with Differential % Equations % Timothy Lin % TA: Celina % % Original Code: November 20, 2008 % Last Revision: December 03, 2008 % % Variable Dictionary % v = time % z = conditions at which ODE45 is used % kin = kinetic rate constant from abdomen to blood % k12 = kinetic rate constant from blood to kidneys
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % k21 = kinetic rate constant from kidneys to blood % k13 = kinetic rate constant from blood to pancreas % k31 = kinetic rate constant from pancreas to blood % dx(1) = differential equation to approximate mass in blood % dx(2) = differential equation to approximate mass in kidneys % dx(3) = differential equation to approximate mass in pancreas % dx(4) = differential equation to approximate mass in abdomen % % Constants kin = 4; k12 = 2; k21 = 3.5; k13 = 3; k31 = 2.5; k % Calculations dz(1) = kin*z(4) - k12*z(1) + k21*z(2) + k31*z(3) - k13*z(1); dz(2) = k12*z(1) - k21*z(2); dz(3) = k13*z(1) - k31*z(3); dz(4) = -kin*z(4); d % Transpose dx dz = dz'; d end % insulindouble...
View Full Document

Ask a homework question - tutors are online