@@ -138,24 +138,26 @@ We observe three action potentials due to the steady applied current.
138
138
As an illustration of how one can construct models from individual components,
139
139
we now separately construct and compose the model components.
140
140
141
- We start by defining systems to model each ionic current:
141
+ We start by defining systems to model each ionic current. Note we now use
142
+ ` @network_component ` instead of ` @reaction_network ` as we want the models to be
143
+ composable and not marked as finalized.
142
144
``` @example hh1
143
- IKmodel = @reaction_network IKmodel begin
145
+ IKmodel = @network_component IKmodel begin
144
146
@parameters ḡK = 36.0 EK = -82.0
145
147
@variables V(t) Iₖ(t)
146
148
(αₙ(V), βₙ(V)), n′ <--> n
147
149
@equations Iₖ ~ ḡK*n^4*(V-EK)
148
150
end
149
151
150
- INamodel = @reaction_network INamodel begin
152
+ INamodel = @network_component INamodel begin
151
153
@parameters ḡNa = 120.0 ENa = 45.0
152
154
@variables V(t) Iₙₐ(t)
153
155
(αₘ(V), βₘ(V)), m′ <--> m
154
156
(αₕ(V), βₕ(V)), h′ <--> h
155
157
@equations Iₙₐ ~ ḡNa*m^3*h*(V-ENa)
156
158
end
157
159
158
- ILmodel = @reaction_network ILmodel begin
160
+ ILmodel = @network_component ILmodel begin
159
161
@parameters ḡL = .3 EL = -59.0
160
162
@variables V(t) Iₗ(t)
161
163
@equations Iₗ ~ ḡL*(V-EL)
@@ -165,7 +167,7 @@ nothing # hide
165
167
166
168
We next define the voltage dynamics with unspecified values for the currents
167
169
``` @example hh1
168
- hhmodel2 = @reaction_network hhmodel2 begin
170
+ hhmodel2 = @network_component hhmodel2 begin
169
171
@parameters C = 1.0 I₀ = 0.0
170
172
@variables V(t) Iₖ(t) Iₙₐ(t) Iₗ(t)
171
173
@equations D(V) ~ -1/C * (Iₖ + Iₙₐ + Iₗ) + Iapp(t,I₀)
0 commit comments