Skip to content

Commit 78f0552

Browse files
test: add test for vector parameters in function args
Co-authored-by: Aayush Sabharwal <[email protected]>
1 parent 57c79e9 commit 78f0552

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/scc_nonlinear_problem.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,3 +253,12 @@ import ModelingToolkitStandardLibrary.Hydraulic.IsothermalCompressible as IC
253253
sol = solve(prob)
254254
@test SciMLBase.successful_retcode(sol)
255255
end
256+
257+
@testset "Vector parameters in function arguments" begin
258+
@variables x y
259+
@parameters p[1:2] (f::Function)(..)
260+
261+
@mtkbuild sys = NonlinearSystem([x^2 - p[1] ^ 2 ~ 0, y^2 ~ f(p)])
262+
prob = NonlinearProblem(sys, [x => 1.0, y => 1.0], [p => ones(2), f=>sum])
263+
@test_nowarn solve(prob, NewtonRaphson())
264+
end

0 commit comments

Comments
 (0)