Skip to content

Commit 891ae63

Browse files
committed
updates: measured quantities
1 parent 4c1b1ae commit 891ae63

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

docs/src/tutorials/parameter_identifiability.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ We first define the parameters, variables, differential equations and the output
3535
using StructuralIdentifiability, ModelingToolkit
3636

3737
# define parameters and variables
38-
@variables t x4(t) x5(t) x6(t) x7(t) y1(t) [output=true] y2(t) [output=true]
38+
@variables t x4(t) x5(t) x6(t) x7(t) y1(t) y2(t)
3939
@parameters k5 k6 k7 k8 k9 k10
4040
D = Differential(t)
4141

@@ -44,11 +44,12 @@ eqs = [
4444
D(x4) ~ - k5 * x4 / (k6 + x4),
4545
D(x5) ~ k5 * x4 / (k6 + x4) - k7 * x5/(k8 + x5 + x6),
4646
D(x6) ~ k7 * x5 / (k8 + x5 + x6) - k9 * x6 * (k10 - x6) / k10,
47-
D(x7) ~ k9 * x6 * (k10 - x6) / k10,
48-
y1 ~ x4,
49-
y2 ~ x5
47+
D(x7) ~ k9 * x6 * (k10 - x6) / k10
5048
]
5149

50+
# define the output functions (quantities that can be measured)
51+
measured_quantities = [y1 ~ x4, y2 ~ x5]
52+
5253
# define the system
5354
de = ODESystem(eqs, t, name=:Biohydrogenation)
5455

@@ -58,7 +59,7 @@ After that we are ready to check the system for local identifiability:
5859
```julia
5960
# query local identifiability
6061
# we pass the ode-system
61-
local_id_all = assess_local_identifiability(de, 0.99)
62+
local_id_all = assess_local_identifiability(de, measured_quantities=measured_quantities, p=0.99)
6263
# [ Info: Preproccessing `ModelingToolkit.ODESystem` object
6364
# 6-element Vector{Bool}:
6465
# 1
@@ -73,7 +74,7 @@ We can see that all states (except $x_7$) and all parameters are locally identif
7374
Let's try to check specific parameters and their combinations
7475
```julia
7576
to_check = [k5, k7, k10/k9, k5+k6]
76-
local_id_some = assess_local_identifiability(de, to_check, 0.99)
77+
local_id_some = assess_local_identifiability(de, funcs_to_check=to_check, p=0.99)
7778
# 4-element Vector{Bool}:
7879
# 1
7980
# 1
@@ -108,23 +109,24 @@ __Note__: as of writing this tutorial, UTF-symbols such as Greek characters are
108109
```julia
109110
using StructuralIdentifiability, ModelingToolkit
110111
@parameters b c a beta g delta sigma
111-
@variables t x1(t) x2(t) x3(t) x4(t) y(t) [output=true]
112+
@variables t x1(t) x2(t) x3(t) x4(t) y(t)
112113
D = Differential(t)
113114

114115
eqs = [
115116
D(x1) ~ -b * x1 + 1/(c + x4),
116117
D(x2) ~ a * x1 - beta * x2,
117118
D(x3) ~ g * x2 - delta * x3,
118-
D(x4) ~ sigma * x4 * (g * x2 - delta * x3)/x3,
119-
y~x1
119+
D(x4) ~ sigma * x4 * (g * x2 - delta * x3)/x3
120120
]
121121

122+
measured_quantities = [y~x1]
123+
122124

123125
ode = ODESystem(eqs, t, name=:GoodwinOsc)
124126

125-
@time global_id = assess_identifiability(ode)
127+
@time global_id = assess_identifiability(ode, measured_quantities=measured_quantities)
126128
# 28.961573 seconds (88.92 M allocations: 5.541 GiB, 4.01% gc time)
127-
# Dict{Nemo.fmpq_mpoly, Symbol} with 7 entries:
129+
# Dict{Num, Symbol} with 7 entries:
128130
# c => :globally
129131
# a => :nonidentifiable
130132
# g => :nonidentifiable
@@ -140,23 +142,23 @@ Let us consider the same system but with two inputs and we will try to find out
140142
```julia
141143
using StructuralIdentifiability, ModelingToolkit
142144
@parameters b c a beta g delta sigma
143-
@variables t x1(t) x2(t) x3(t) x4(t) y(t) [output=true] u1(t) [input=true] u2(t) [input=true]
145+
@variables t x1(t) x2(t) x3(t) x4(t) y(t) u1(t) [input=true] u2(t) [input=true]
144146
D = Differential(t)
145147

146148
eqs = [
147149
D(x1) ~ -b * x1 + 1/(c + x4),
148150
D(x2) ~ a * x1 - beta * x2 - u1,
149151
D(x3) ~ g * x2 - delta * x3 + u2,
150-
D(x4) ~ sigma * x4 * (g * x2 - delta * x3)/x3,
151-
y~x1
152+
D(x4) ~ sigma * x4 * (g * x2 - delta * x3)/x3
152153
]
154+
measured_quantities = [y~x1]
153155

154156
# check only 2 parameters
155157
to_check = [b, c]
156158

157159
ode = ODESystem(eqs, t, name=:GoodwinOsc)
158160

159-
global_id = assess_identifiability(ode, to_check, 0.9)
161+
global_id = assess_identifiability(ode, measured_quantities=measured_quantities, funcs_to_check=to_check, p=0.9)
160162
# Dict{Num, Symbol} with 2 entries:
161163
# b => :globally
162164
# c => :globally

0 commit comments

Comments
 (0)