problem with deval function
Afficher commentaires plus anciens
I have problem with deval function. i don't know how to implement it...please help me... this is my code:
function F=model_magda(t,y)
F=zeros(2,1);
global Vg Vi Gg gamma lambda alfa C1 a1 Rm Ki Kg UFR Gd Ginf Vglucose Vinsulin
Vglucose=Vg-UFR*t;
Vinsulin=Vi-UFR*t;
F(1)=(Gg-gamma*y(1)*y(2)-lambda*y(1)+Ginf-Kg*(y(1)-Gd)+y(1)*UFR)/Vglucose;
F(2)=(Rm/(1+exp((C1-y(1))/a1))-alfa*y(2)-Ki*y(2))/Vinsulin;
end
---------------------------------------
function [result]=magda_ewa
clc
clear all
close all
global Vg Vi Rinf Cinf Gg gamma lambda alfa C1 a1 Rm Ki Kg Tinf UFR m Gd time meang meani Ginf
% ----------------WU1115-----------------
Go=5.5;
Io=8.82;
Gg=209.4605547/180; %[mmol/min]
gamma=2694.327299/(1000^2); %{L^2/mU*min]
lambda=19.08979162/1000; %[L/min]
alfa=419.2263116/1000; %[L/min]
C1=4.082200129*1000/180; %[mmol/L]
a1=0.152036299*1000/180; %[mmol/L]
Rm=1049.504948; %[mU/min]
m=115; %[kg]
Vg=16349.32268/1000; %[L]
Vi=11212.80081/1000; %[L]
time=[0 10 20 30 40 60];
meang=[5.5 19.95 15.29 11.95 10.1 7.71];
meani=[8.82 227.1 146.99 93.01 61.61 35.48];
UFR=3/240; %0.004166667; %[L/min]
Gd=5.615292712;
Rinf=60/1000; %[L/min]
Vinf=0.5*m*100/(33*1000); %[L]
Cinf=33/180.16*1000*1000/100; %[mmol/L]
Tinf=Vinf/Rinf %[min]
Ki=63/1000; %[L/min]
Kg=223.2/1000; %[L/min]
Ginf=Rinf*Cinf; %[mmol/L]
[solvi]=ode45('model_magda',0:0.05:Tinf,[Go Io]);
ti=linspace(0,Ting,100)
[toii yoii]=deval(solvei,ti) %IT DOESN"T WORK!!!
Ii=[toi yoi];
Ginf=0;
[to yo]=ode45('model_magda',Tinf:1:60,[yoi(end,1) yoi(end,2)]);
Io=[to yo];
result=[Ii;Io];
Réponses (0)
Catégories
En savoir plus sur Common Operations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!