Skip to content

Commit 267eee9

Browse files
test: fix initialization of inversemodel tests
1 parent a3b4bdd commit 267eee9

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/downstream/inversemodel.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,21 @@ nsys = get_named_sensitivity(model, :y; op) # Test that we get the same result w
157157

158158
# Test the same thing for comp sensitivities
159159

160-
Sf, simplified_sys = Blocks.get_comp_sensitivity_function(model, :y; op); # This should work without providing an operating opint containing a dummy derivative
160+
# This should work without providing an operating opint containing a dummy derivative
161+
Sf, simplified_sys = Blocks.get_comp_sensitivity_function(
162+
model, :y; op, initialization_solver_alg = NewtonRaphson());
161163
x = state_values(Sf)
162164
p = parameter_values(Sf)
163165
# If this somehow passes, mention it on
164166
# https://github.com/SciML/ModelingToolkit.jl/issues/2786
165167
matrices1 = Sf(x, p, 0)
166-
matrices2, _ = Blocks.get_comp_sensitivity(model, :y; op) # Test that we get the same result when calling the higher-level API
168+
# Test that we get the same result when calling the higher-level API
169+
matrices2, _ = Blocks.get_comp_sensitivity(
170+
model, :y; op, initialization_solver_alg = NewtonRaphson())
167171
@test matrices1.f_x matrices2.A[1:7, 1:7]
168-
nsys = get_named_comp_sensitivity(model, :y; op) # Test that we get the same result when calling an even higher-level API
172+
# Test that we get the same result when calling an even higher-level API
173+
nsys = get_named_comp_sensitivity(
174+
model, :y; op, initialization_solver_alg = NewtonRaphson())
169175
@test matrices2.A nsys.A
170176

171177
@testset "Issue #3319" begin

0 commit comments

Comments
 (0)