Skip to content

Commit 77dad69

Browse files
committed
test op change
1 parent 2eedd0a commit 77dad69

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

test/downstream/inversemodel.jl

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,28 +132,28 @@ sol = solve(prob, Rodas5P())
132132

133133
# we need to provide `op` so the initialization system knows what to hold constant
134134
# the values don't matter
135-
Sf, simplified_sys = Blocks.get_sensitivity_function(model, :y; op); # This should work without providing an operating opint containing a dummy derivative
135+
Sf, simplified_sys = get_sensitivity_function(model, :y; op); # This should work without providing an operating opint containing a dummy derivative
136136
x = state_values(Sf)
137137
p = parameter_values(Sf)
138138
# If this somehow passes, mention it on
139139
# https://github.com/SciML/ModelingToolkit.jl/issues/2786
140140
matrices1 = Sf(x, p, 0)
141-
matrices2, _ = Blocks.get_sensitivity(model, :y; op); # Test that we get the same result when calling the higher-level API
141+
matrices2, _ = get_sensitivity(model, :y; op); # Test that we get the same result when calling the higher-level API
142142
@test matrices1.f_x matrices2.A[1:6, 1:6]
143143
nsys = get_named_sensitivity(model, :y; op) # Test that we get the same result when calling an even higher-level API
144144
@test matrices2.A nsys.A
145145

146146
# Test the same thing for comp sensitivities
147147

148148
# This should work without providing an operating opint containing a dummy derivative
149-
Sf, simplified_sys = Blocks.get_comp_sensitivity_function(model, :y; op);
149+
Sf, simplified_sys = get_comp_sensitivity_function(model, :y; op);
150150
x = state_values(Sf)
151151
p = parameter_values(Sf)
152152
# If this somehow passes, mention it on
153153
# https://github.com/SciML/ModelingToolkit.jl/issues/2786
154154
matrices1 = Sf(x, p, 0)
155155
# Test that we get the same result when calling the higher-level API
156-
matrices2, _ = Blocks.get_comp_sensitivity(model, :y; op)
156+
matrices2, _ = get_comp_sensitivity(model, :y; op)
157157
@test matrices1.f_x matrices2.A[1:6, 1:6]
158158
# Test that we get the same result when calling an even higher-level API
159159
nsys = get_named_comp_sensitivity(model, :y; op)
@@ -173,15 +173,16 @@ nsys = get_named_comp_sensitivity(model, :y; op)
173173
output = :y
174174
# we need to provide `op` so the initialization system knows which
175175
# values to hold constant
176-
lin_fun, ssys = Blocks.get_sensitivity_function(model, output; op = op1)
177-
matrices1 = linearize(ssys, lin_fun, op = op1)
178-
matrices2 = linearize(ssys, lin_fun, op = op2)
176+
lin_fun, ssys = get_sensitivity_function(model, output; op = op1)
177+
matrices1, extras1 = linearize(ssys, lin_fun, op = op1)
178+
matrices2, extras2 = linearize(ssys, lin_fun, op = op2)
179+
@test extras1.x != extras2.x
179180
S1f = ss(matrices1...)
180181
S2f = ss(matrices2...)
181182
@test S1f != S2f
182183

183-
matrices1, ssys = Blocks.get_sensitivity(model, output; op = op1)
184-
matrices2, ssys = Blocks.get_sensitivity(model, output; op = op2)
184+
matrices1, ssys = get_sensitivity(model, output; op = op1)
185+
matrices2, ssys = get_sensitivity(model, output; op = op2)
185186
S1 = ss(matrices1...)
186187
S2 = ss(matrices2...)
187188
@test S1 != S2

0 commit comments

Comments
 (0)