-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwang_model.m
More file actions
52 lines (42 loc) · 1.02 KB
/
wang_model.m
File metadata and controls
52 lines (42 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
function dY = wang_model(t,Y,clamp,~,varargin)
if nargin==5
C = varargin{1};
end
if (length(clamp)==1)
V = sine_wave(t,C);
else
V = getVoltage(t,clamp);
end
% States are:
C1 = Y(1);
C2= Y(2);
C3 = Y(3);
O = Y(4);
p1 = 3.40480255129870294e-04;
p2 = 1.09853080133853545e-01;
p3 = 2.78158636962794539e-03;
p4 = 1.06603162448445768e-01;
p5 = 2.34436215593156411e-03;
p6 = 1.04705086663227821e-07;
p7 = 3.15078572900222374e-04;
p8 = 3.99208131967221866e-02;
p9 = 1.23597674742260924e-01;
p10 = 1.55514220791980115e-02;
p11 = 5.74918399655915176e-03;
p12 = 2.89464023164944483e-02;
p13 = 1.30731037065575720e-02;
p14 = 6.74786425362727382e-03;
I = 1 - (O + C1 + C2 + C3);
a1 = p1 * exp( p2 * V);
b1 = p3 * exp(-p4 * V);
a3 = p5 * exp( p6 * V);
b3 = p7 * exp(-p8 * V);
a4 = p9 * exp( p10 * V);
b4 = p11 * exp(-p12 * V);
a2 = p13 ;
b2 = p14 ;
dY = zeros(4,1);
dY(1) = b3 * O + a2 * C2 -(a3 + b2) * C1;
dY(2) = b2 * C1 + a1 * C3 - (a2 +b1) * C2;
dY(3) = b1 * C2 - a1 * C3;
dY(4) = b4 * I + a3 * C1 - (a4 + b3) * O;