-
Notifications
You must be signed in to change notification settings - Fork 1
/
ILCCaAssignmentProcess.cpp
81 lines (62 loc) · 1.66 KB
/
ILCCaAssignmentProcess.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
#include "libecs.hpp"
#include "Process.hpp"
USE_LIBECS;
LIBECS_DM_CLASS( ILCCaAssignmentProcess, Process )
{
public:
LIBECS_DM_OBJECT( ILCCaAssignmentProcess, Process )
{
INHERIT_PROPERTIES( Process );
PROPERTYSLOT_SET_GET( Real, permeabilityNa );
PROPERTYSLOT_SET_GET( Real, permeabilityK );
}
ILCCaAssignmentProcess()
:
permeabilityNa( 0.0075 ),
permeabilityK( 0.0075 )
{
// do nothing
}
SIMPLE_SET_GET_METHOD( Real, permeabilityNa );
SIMPLE_SET_GET_METHOD( Real, permeabilityK );
virtual void initialize()
{
Process::initialize();
Cai = getVariableReference( "Cai" ).getVariable();
i = getVariableReference( "i" ).getVariable();
Cm = getVariableReference( "Cm" ).getVariable();
cNa = getVariableReference( "cNa" ).getVariable();
CFNa = getVariableReference( "CFNa" ).getVariable();
cK = getVariableReference( "cK" ).getVariable();
CFK = getVariableReference( "CFK" ).getVariable();
I = getVariableReference( "I" ).getVariable();
GX = getVariableReference( "GX" ).getVariable();
}
virtual void fire()
{
_i = GX->getValue() * Cm->getValue() / ( 1.0 + pow(( 0.0012 / ( Cai->getMolarConc() * 1000.0 )), 3.0 ));
i->setValue( _i );
_cNa = permeabilityNa * CFNa->getValue() * _i;
_cK = permeabilityK * CFK->getValue() * _i;
cNa->setValue( _cNa );
cK->setValue( _cK );
I->setValue( _cNa + _cK );
}
protected:
Variable* Cai;
Variable* i;
Variable* Cm;
Variable* cNa;
Variable* CFNa;
Variable* cK;
Variable* CFK;
Variable* I;
Variable* GX;
Real permeabilityNa;
Real permeabilityK;
private:
Real _i;
Real _cNa;
Real _cK;
};
LIBECS_DM_INIT( ILCCaAssignmentProcess, Process );