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

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

function dy = insulinhalf(u,y) % 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 % u = time % y = 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 = 1; k12 = 0.5; k21 = 1.75/2; k13 = 0.75; k31 = 1.25/2; k % Calculations dy(1) = kin*y(4) - k12*y(1) + k21*y(2) + k31*y(3) - k13*y(1); dy(2) = k12*y(1) - k21*y(2); dy(3) = k13*y(1) - k31*y(3); dy(4) = -kin*y(4); d % Transpose dx dy = dy'; d end % insulinhalf...
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