-
Notifications
You must be signed in to change notification settings - Fork 1
/
IVRCCAssignmentProcess.cpp
98 lines (78 loc) · 2.21 KB
/
IVRCCAssignmentProcess.cpp
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include "libecs.hpp"
#include "Process.hpp"
USE_LIBECS;
LIBECS_DM_CLASS( IVRCCAssignmentProcess, Process )
{
public:
LIBECS_DM_OBJECT( IVRCCAssignmentProcess, Process )
{
INHERIT_PROPERTIES( Process );
PROPERTYSLOT_SET_GET( Real, maxFactor );
PROPERTYSLOT_SET_GET( Real, compliance );
PROPERTYSLOT_SET_GET( Real, halfMaxVt );
PROPERTYSLOT_SET_GET( Real, slope );
PROPERTYSLOT_SET_GET( Real, halfMaxVm );
PROPERTYSLOT_SET_GET( Real, permeabilityNa );
PROPERTYSLOT_SET_GET( Real, permeabilityK );
PROPERTYSLOT_SET_GET( Real, permeabilityCa );
PROPERTYSLOT_SET_GET( Real, permeabilityCl );
}
IVRCCAssignmentProcess()
:
maxFactor( 200.0 ),
compliance( 0.001 ),
halfMaxVt( 21700.0 ),
slope( 50.0 ),
halfMaxVm( -100.0 ),
permeabilityNa( 0.0 ),
permeabilityK( 0.0 ),
permeabilityCa( 0.0 ),
permeabilityCl( -2.0E-5 )
{
// do nothing
}
SIMPLE_SET_GET_METHOD( Real, maxFactor );
SIMPLE_SET_GET_METHOD( Real, compliance );
SIMPLE_SET_GET_METHOD( Real, halfMaxVt );
SIMPLE_SET_GET_METHOD( Real, slope );
SIMPLE_SET_GET_METHOD( Real, halfMaxVm );
SIMPLE_SET_GET_METHOD( Real, permeabilityNa );
SIMPLE_SET_GET_METHOD( Real, permeabilityK );
SIMPLE_SET_GET_METHOD( Real, permeabilityCa );
SIMPLE_SET_GET_METHOD( Real, permeabilityCl );
virtual void initialize()
{
Process::initialize();
I = getVariableReference( "I" ).getVariable();
CFCl = getVariableReference( "CFCl" ).getVariable();
Cm = getVariableReference( "Cm" ).getVariable();
Vt = getVariableReference( "Vt" ).getVariable();
Vm = getVariableReference( "Vm" ).getVariable();
}
virtual void fire()
{
I->setValue( permeabilityCl * CFCl->getValue() * ( 1.0 + maxFactor / ( 1.0 + exp( -compliance * ( Vt->getValue() * 1.0e+15 - halfMaxVt )))) * ( 1.0 / ( 1.0 + exp(( halfMaxVm - Vm->getValue() ) / slope ))) * Cm->getValue() );
}
protected:
Variable* I;
Variable* CFCl;
Variable* Cm;
Variable* Vt;
Variable* Vm;
Real maxFactor;
Real compliance;
Real halfMaxVt;
Real slope;
Real halfMaxVm;
Real permeabilityNa;
Real permeabilityK;
Real permeabilityCa;
Real permeabilityCl;
private:
Real _pOpen;
Real _i;
Real _cNa;
Real _cK;
Real _cCa;
};
LIBECS_DM_INIT( IVRCCAssignmentProcess, Process );