L2 4 L2t Kpb L1 Kbp L2 5 Lp L1tL2t 6 end Use a nonlinear least squares fit for

L2 4 l2t kpb l1 kbp l2 5 lp l1tl2t 6 end use a

This preview shows page 19 - 24 out of 68 pages.

* L(2); 4 L2t = Kpb * L(1)-Kbp * L(2); 5 Lp = [L1t;L2t]; 6 end Use a nonlinear least squares fit for finding best parameters Joseph M. Mahaffy, h [email protected] i Lecture Notes – Systems of Two First Order Eq — (19/68)
Image of page 19

Subscribe to view the full document.

Introduction Linear Applications of Systems of 1 st Order DEs Nonlinear Applications of Systems of DEs Basic Mixing Problem - Water and Inert Salts Mixing Problem Example Pharmokinetic Problem LSD Example LSD Example 4 MatLab Code for finding best parameters (Nonlinear least squares) 1 function J = leastLSD(p,tdata,xdata) 2 % Create the least squares error function 3 n1 = length (tdata); 4 [t,L] = ... ode45 (@LSD,tdata,[p(1),0],[],p(2),p(3),p(4)); 5 errL1 = L(:,1)-xdata(1:n1); 6 J = errL1' * errL1; 7 end Make an initial guess p 0 = [12 , 5 , 4 , 0 . 4], then use the MatLab command [p,J,flag] = fminsearch(@leastLSD,p0,[],td,L1); where td and L 1 are the data This produces the best parameter values for our model Joseph M. Mahaffy, h [email protected] i Lecture Notes – Systems of Two First Order Eq — (20/68)
Image of page 20
Introduction Linear Applications of Systems of 1 st Order DEs Nonlinear Applications of Systems of DEs Basic Mixing Problem - Water and Inert Salts Mixing Problem Example Pharmokinetic Problem LSD Example LSD Example 5 MatLab Code finds the best parameters with previous programs Make an initial guess p 0 = [12 , 5 , 4 , 0 . 4], then use the MatLab command [p,J,flag] = fminsearch(@leastLSD,p0,[],td,L1); where td and L 1 are the data This produces the best initial condition and parameter values for our model d 1 (0) = 9 . 5330 K pb = 2 . 0580 K bp = 5 . 6030 K e = 0 . 32904 The sum of square errors is J = 0 . 079948 The following MatLab commands produce the graph of the plasma compartment [t,L] = ode23(@LSD,[0,15],[9.5330;0],[],2.0580,5.6030,0.32904); plot(t,L(:,1),’r-’,td,L1,’ro’);grid; Joseph M. Mahaffy, h [email protected] i Lecture Notes – Systems of Two First Order Eq — (21/68)
Image of page 21

Subscribe to view the full document.

Introduction Linear Applications of Systems of 1 st Order DEs Nonlinear Applications of Systems of DEs Basic Mixing Problem - Water and Inert Salts Mixing Problem Example Pharmokinetic Problem LSD Example LSD Example 6 Model Graphs 0 1 2 3 4 5 6 7 8 9 10 0 2 4 6 8 10 12 t (hr) LSD (ng/ml) LSD in Plasma 0 2 4 6 8 10 12 0 10 20 30 40 50 60 70 80 t (hr) 26 . 76 d 2 ( t )+12 . 41 Missed Points d 1 ( t ) with Data Scaled and shifted d 2 ( t ) The graph on the right shows the strong correlation between missed points on the test and the amount of LSD in the Tissue compartment Scores are vertically shifted to account for points missed without LSD Joseph M. Mahaffy, h [email protected] i Lecture Notes – Systems of Two First Order Eq — (22/68)
Image of page 22
Introduction Linear Applications of Systems of 1 st Order DEs Nonlinear Applications of Systems of DEs Model of Glucose and Insulin Control Glucose Tolerance Test Competition Model Modeling Diabetes Diabetes (diabetes mellitus) is a disease characterized by excessive glucose in the blood There are 3 forms Type 1 or juvenile diabetes is an autoimmune disorder, where the β -cells in the pancreas are destroyed, so insulin cannot be produced Type 2 or adult onset diabetes is where cells become insulin resistant, often caused by excessive weight and poor exercise Gestational diabetes happens in some pregnant women
Image of page 23

Subscribe to view the full document.

Image of page 24
  • Fall '08
  • staff

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes