Skip to content

Commit 3fb2c77

Browse files
Updating ParameterEstimation Benchmarks
1 parent b866c17 commit 3fb2c77

File tree

2 files changed

+36
-8
lines changed

2 files changed

+36
-8
lines changed

benchmarks/ParameterEstimation/FitzHughNagumoParameterEstimation.jmd

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,24 @@ glo_init = [2.5,2.5,2.5,2.5]
1919
```
2020

2121
```julia
22-
fitz = @ode_def FitzhughNagumo begin
23-
dv = v - v^3/3 -w + l
24-
dw = τinv*(v + a - b*w)
25-
end a b τinv l
22+
@mtkmodel FitzHughNagumo begin
23+
@parameters begin
24+
a = 0.7 # Parameter for excitability
25+
b = 0.8 # Recovery rate parameter
26+
τinv = 0.08 # Inverse of the time constant
27+
l = 0.5 # External stimulus
28+
end
29+
@variables begin
30+
v(t) = 1.0 # Membrane potential with initial condition
31+
w(t) = 1.0 # Recovery variable with initial condition
32+
end
33+
@equations begin
34+
D(v) ~ v - v^3 / 3 - w + l
35+
D(w) ~ τinv * (v + a - b * w)
36+
end
37+
end
38+
39+
@mtkbuild fitz = FitzHughNagumo()
2640
```
2741

2842
```julia

benchmarks/ParameterEstimation/LotkaVolterraParameterEstimation.jmd

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,24 @@ glo_init = [5,5,5,5]
1919
```
2020

2121
```julia
22-
f = @ode_def LotkaVolterraTest begin
23-
dx = a*x - b*x*y
24-
dy = -c*y + d*x*y
25-
end a b c d
22+
@mtkmodel LotkaVolterraTest begin
23+
@parameters begin
24+
a = 1.5 # Growth rate of prey
25+
b = 1.0 # Predation rate
26+
c = 3.0 # Death rate of predators
27+
d = 1.0 # Reproduction rate of predators
28+
end
29+
@variables begin
30+
x(t) = 1.0 # Population of prey with initial condition
31+
y(t) = 1.0 # Population of predators with initial condition
32+
end
33+
@equations begin
34+
D(x) ~ a * x - b * x * y
35+
D(y) ~ -c * y + d * x * y
36+
end
37+
end
38+
39+
@mtkbuild f = LotkaVolterraTest()
2640
```
2741

2842
```julia

0 commit comments

Comments
 (0)