Skip to content

Commit b17d5bf

Browse files
committed
Make formatter happy
1 parent 2b39763 commit b17d5bf

File tree

6 files changed

+40
-132
lines changed

6 files changed

+40
-132
lines changed

benchmarking/IdentifiableFunctions/benchmark_result_04-07-23.md

+19-19
Large diffs are not rendered by default.

benchmarking/IdentifiableFunctions/param.jl

-90
Original file line numberDiff line numberDiff line change
@@ -214,93 +214,3 @@ new_vector_field, new_outputs, new_vars =
214214
=#
215215

216216
# 2.
217-
#! format: off
218-
ode = StructuralIdentifiability.@ODEmodel(
219-
x1'(t) = a * x1,
220-
x2'(t) = b * x2,
221-
y(t) = x1*x2
222-
)
223-
224-
id_funcs = StructuralIdentifiability.find_identifiable_functions(
225-
ode,
226-
with_states = true,
227-
strategy = (:hybrid,),
228-
)
229-
@info "" id_funcs
230-
#=
231-
┌ Info:
232-
│ id_funcs =
233-
│ 2-element Vector{AbstractAlgebra.Generic.Frac{QQMPolyRingElem}}:
234-
│ x2*x1
235-
└ a + b
236-
=#
237-
238-
new_states = [x1 * x2]
239-
new_params = [a + b]
240-
241-
new_vector_field, new_outputs, new_vars = reparametrize_with_respect_to(ode, new_states, new_params)
242-
@info "" new_vector_field new_outputs new_vars
243-
#=
244-
┌ Info:
245-
│ new_vector_field =
246-
│ Dict{Any, Any} with 1 entry:
247-
│ T1 => T1*T2
248-
│ new_outputs =
249-
│ Dict{QQMPolyRingElem, AbstractAlgebra.Generic.Frac{QQMPolyRingElem}} with 1 entry:
250-
│ y => T1
251-
│ new_vars =
252-
│ Dict{QQMPolyRingElem, AbstractAlgebra.Generic.Frac{QQMPolyRingElem}} with 2 entries:
253-
│ T2 => a + b
254-
└ T1 => x2*x1
255-
=#
256-
257-
# 3.
258-
#! format: off
259-
ode = StructuralIdentifiability.@ODEmodel(
260-
x1'(t) = a * x1,
261-
x2'(t) = b * x2,
262-
y(t) = x1 + x2
263-
)
264-
265-
id_funcs = StructuralIdentifiability.find_identifiable_functions(
266-
ode,
267-
with_states = true,
268-
strategy = (:hybrid,),
269-
)
270-
@info "" id_funcs
271-
#=
272-
┌ Info:
273-
│ id_funcs =
274-
│ 5-element Vector{AbstractAlgebra.Generic.Frac{QQMPolyRingElem}}:
275-
│ x2*x1
276-
│ a*b
277-
│ x2 + x1
278-
│ a + b
279-
└ a*x2 - a*x1 - b*x2 + b*x1
280-
=#
281-
282-
new_states = [x1 * x2, x1 + x2, a*x2 - a*x1 - b*x2 + b*x1]
283-
new_params = [a + b, a*b]
284-
285-
new_vector_field, new_iutputs, new_vars = reparametrize_with_respect_to(ode, new_states, new_params)
286-
@info "" new_vector_field new_outputs new_vars
287-
#=
288-
┌ Info:
289-
│ new_vector_field =
290-
│ Dict{Any, Any} with 3 entries:
291-
│ T1 => 1//2*T1*T4 - 1//2*T3
292-
│ T2 => T2*T4
293-
│ T3 => -1//2*T1*T4^2 + 2*T1*T5 + 1//2*T3*T4
294-
│ new_outputs =
295-
│ Dict{QQMPolyRingElem, AbstractAlgebra.Generic.Frac{QQMPolyRingElem}} with 1 entry:
296-
│ y => T1
297-
│ new_vars =
298-
│ Dict{QQMPolyRingElem, AbstractAlgebra.Generic.Frac{QQMPolyRingElem}} with 5 entries:
299-
│ T1 => x2 + x1
300-
│ T2 => x2*x1
301-
│ T3 => a*x2 - a*x1 - b*x2 + b*x1
302-
│ T4 => a + b
303-
└ T5 => a*b
304-
=#
305-
#! format: on
306-
#####################

ext/ModelingToolkitSIExt.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ function __mtk_to_si(
231231
filter(
232232
s ->
233233
!iscall(s) &&
234-
!(string(s) in string.(state_vars)) &&
235-
!(string(s) * "(t)" in string.(state_vars)) &&
236-
(string(s) != string(t)),
234+
!(string(s) in string.(state_vars)) &&
235+
!(string(s) * "(t)" in string.(state_vars)) &&
236+
(string(s) != string(t)),
237237
get_variables(y[2]),
238238
) for y in measured_quantities
239239
]...,

src/local_identifiability.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ function differentiate_solution(
6565
return (
6666
ps_sol,
6767
Dict(
68-
(vars[i], vars[j]) => sol_var_system[i, j] for i in 1:length(ode.x_vars),
69-
j in 1:length(vars)
68+
(vars[i], vars[j]) => sol_var_system[i, j] for
69+
i in 1:length(ode.x_vars), j in 1:length(vars)
7070
),
7171
)
7272
end

src/pb_representation.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct PBRepresentation
3030
new_varnames = filter(
3131
v ->
3232
(v in param_names) ||
33-
decompose_derivative(v, vcat(y_names, u_names)) != nothing,
33+
decompose_derivative(v, vcat(y_names, u_names)) != nothing,
3434
map(var_to_str, gens(old_ring)),
3535
)
3636
newring, _ = Nemo.polynomial_ring(base_ring(old_ring), new_varnames)

test/constructive_membership.jl

+15-17
Original file line numberDiff line numberDiff line change
@@ -87,23 +87,21 @@ if GROUP == "All" || GROUP == "Core"
8787
R, (a, b, y, x2, c, x1) = polynomial_ring(Nemo.QQ, ["a", "b", "y", "x2", "c", "x1"])
8888
append!(
8989
cases,
90-
[
91-
(
92-
generators = [
93-
x1 // one(R),
94-
a // one(R),
95-
(a * c + c^2) // one(R),
96-
c // x2,
97-
x2 // (a + b),
98-
],
99-
to_be_reduced = [
100-
(a * c + c^2 + x1) // (a * c + c^2),
101-
(a * c + c^2 + x1) // (a^2 + a * b + a * c + b * c),
102-
(a * x2 + a * x1 + b * x1) // x2,
103-
],
104-
memberships = Bool[1, 1, 1],
105-
),
106-
],
90+
[(
91+
generators = [
92+
x1 // one(R),
93+
a // one(R),
94+
(a * c + c^2) // one(R),
95+
c // x2,
96+
x2 // (a + b),
97+
],
98+
to_be_reduced = [
99+
(a * c + c^2 + x1) // (a * c + c^2),
100+
(a * c + c^2 + x1) // (a^2 + a * b + a * c + b * c),
101+
(a * x2 + a * x1 + b * x1) // x2,
102+
],
103+
memberships = Bool[1, 1, 1],
104+
),],
107105
)
108106

109107
for case in cases

0 commit comments

Comments
 (0)