# insulinhalf - % k21 = kinetic rate constant from kidneys to...

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

function dx = insulinhalf(t,x) % 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 % t = time % x = conditions at which ODE45 is used % kin = kinetic rate constant from abdomen to blood % k12 = kinetic rate constant from blood to kidneys
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 = 1.75; k13 = 1.5; k31 = 1.25; k % Calculations dx(1) = kin*x(4) - k12*x(1) + k21*x(2) + k31*x(3) - k13*x(1); dx(2) = k12*x(1) - k21*x(2); dx(3) = k13*x(1) - k31*x(3); dx(4) = -kin*x(4); d % Transpose dx dx = dx'; d end % insulin...
View Full Document

## This note was uploaded on 09/28/2009 for the course BEE 1510 taught by Professor Staff during the Fall '05 term at Cornell University (Engineering School).

Ask a homework question - tutors are online