I have got this model for glucose and insulin, and system of differential equations:
Where:
G(t)
- the plasma glucose concentration at time t
I(t)
- the plasma insulin concentration at time t
X(t)
- the interstitial insulin at time t
Gb
- the basal plasma glucose concentration
Ib
- the basal plasma insulin concentration
which describe the model. I must do an algorithm to estimate parameters with use ode45 in matlab.
Test data is as follows:
I am not sure how write function for ode45, my idea is as follows:
function [] = cwiczenie3_1a(dane)
a=size(dane);
u=[];
y=[];
for i=1:a(1,1)
g(i,1)=dane(i,2);
j(i,1)=dane(i,3);
end
[x t]=ode45(@funkcjajeden,[0 100],[0,0])
end
function [dg] = funkcjajeden(t,g)
gb=350;
d=0.1;
ib=120;
k1=1;
k2=2;
k3=1;
dg=zeros(size(g));
dg(1)=(k1*(gb-g(1)))-d*g(1);
dg(2)=(k2*(g(2)-ib))-k3*d;
end