|
1 | 1 | using Conductor, Unitful, ModelingToolkit |
2 | | -import Unitful: mV, mS, cm, µm, ms, mM, µM, µA |
3 | | -import Conductor: Na, K, Ca, Cation, Leak |
| 2 | +import Unitful: mV, mS, cm, µm, ms, mM, µM, µA, nM, K |
| 3 | +import Conductor: mR, ℱ |
4 | 4 |
|
5 | 5 | Vₘ = ParentScope(MembranePotential(-50mV)) |
| 6 | + |
6 | 7 | Caᵢ = Concentration(Calcium, 0.05µM, dynamic = true) |
| 8 | +Caₒ = Concentration(Calcium, 3.0mM, location = Conductor.Outside) |
| 9 | +minCa = Concentration(Calcium, 1.0nM, name=:minCa) |
7 | 10 | ICa = IonCurrent(Calcium, aggregate = true) |
8 | 11 |
|
| 12 | +T = Temperature(283.15K) |
| 13 | + |
9 | 14 | nav_kinetics = [Gate(SteadyStateTau, |
10 | 15 | 1.0 / (1.0 + exp((Vₘ + 25.5) / -5.29)), |
11 | 16 | 2.64 - (2.52 / (1 + exp((Vₘ + 120.0) / -25.0))), |
@@ -57,21 +62,14 @@ h_kinetics = [ |
57 | 62 | 1.0 / (1.0 + exp((Vₘ + 75.0) / 5.5)), |
58 | 63 | 2 / (exp((Vₘ + 169.7) / (-11.6)) + exp((Vₘ - 26.7) / (14.3))), name = :m)] |
59 | 64 |
|
60 | | -Ca_Nernst(Ca) = 1000 * ((-8.314 * 283.15) / (2 * 96485.365)) * log(max(Ca, 0.001) / 3000.0) |
61 | | -@register_symbolic Ca_Nernst(Ca) |
62 | | -ModelingToolkit.get_unit(op::typeof(Ca_Nernst), args) = mV |
63 | | - |
64 | 65 | gradients = Equilibria(Pair[Sodium => 50.0mV, |
65 | 66 | Potassium => -80.0mV, |
66 | 67 | Cation => (-20mV, :H), |
67 | 68 | Leak => -50mV, |
68 | | - # x1000 for mV; thresholding Cai in case negative conc |
69 | | - # TODO: write nernst function + use Unitful constants (RT/zℱ) |
70 | | - Calcium => Ca_Nernst(Caᵢ)]); |
| 69 | + Calcium => (-mR*T/2ℱ) * log(max(Caᵢ, minCa) / Caₒ)]); |
71 | 70 |
|
72 | 71 | # Reported area value in Prinz 2003; the area of a cylinder without the ends (2πrh). |
73 | 72 | # Dimensions r = 25µm, h = 400µm given by Liu et al 1998. |
74 | | - |
75 | 73 | #r = 25µm; h = 400µm; area = round(ustrip(Float64, cm^2, 2π*r*h), sigdigits=3) |
76 | 74 |
|
77 | 75 | geo = Cylinder(radius = 25µm, height = 400µm) |
|
0 commit comments