Page 398 - Control Theory in Biomedical Engineering
P. 398

364   Appendices for Chapter 2


          disp(strcat('4. mdiet=',num2str(parameter(4,i))))
          disp(strcat('5. min=',num2str(parameter(5,i))))
          disp(strcat('6. mout=',num2str(parameter(6,i))))
          disp(strcat('7. mtis=',num2str(parameter(7,i))))
                str4=input(prompt,'s');
                if str4=='Y'j str4=='y'
                  ada=1;
                end
             end
          end
          in = msgbox('Calculations, please wait','Info','warn');

          % reading parameter values
          k=parameter(1,1);
          k12=parameter(2,1);
          k21=parameter(3,1);
          mdiet=parameter(4,1);
          min=parameter(5,1);
          mout=parameter(6,1);
          mtis=parameter(7,1);

          % initial values of cholesterol mass in compartment I - m0(1) and in
          compartmet II - m0(2)
          % intitial m0(1) and m0(2) are calculated on stationary solutions - it
          means
          % that in the first interval of time mdiet=0 (otherwise it means a
          continuous meal)
          % mdiet>0 during the time of absorption process
          m0(1)=m1;
          m0(2)=m2;
          t0=0;
          [t,m]=ode45(@equations, [t0, tmax(1)], m0);
              plot(t,m(:,2)/v2, 'linewidth',2,'color','r')
              hold on
              m2max=m0(2);
              axis([0, sum(tmax),40,(max(m2max)/v2)+50])
              xlabel('time [minute]','fontSize',20)
              ylabel('concentration [mg/dL]','fontSize',20)
              if n>1
                 schift=0;
   393   394   395   396   397   398   399   400   401   402   403