diff --git a/test/Blocks/continuous.jl b/test/Blocks/continuous.jl index 2ebb304f..b6121e08 100644 --- a/test/Blocks/continuous.jl +++ b/test/Blocks/continuous.jl @@ -90,7 +90,7 @@ end @named pt2 = SecondOrder(; k = k, w = w, d = d) @named iosys = System(connect(c.output, pt2.input), t, systems = [pt2, c]) sys = mtkcompile(iosys) - prob = ODEProblem(sys, [unknowns(sys) .=> 0.0...; pt2.xd => 0.0], (0.0, 100.0)) + prob = ODEProblem(sys, unknowns(sys) .=> 0.0, (0.0, 100.0)) sol = solve(prob, Rodas4()) @test sol.retcode == Success @test sol[pt2.output.u] ≈ pt2_func.(sol.t, k, w, d) atol = 1.0e-3 @@ -176,7 +176,6 @@ end systems = [pi_controller, plant, ref, fb] ) sys = mtkcompile(model) - initial_conditions(sys)[sys.pi_controller.gainPI.k] = 1.0 prob = ODEProblem(sys, Pair[], (0.0, 100.0)) sol = solve(prob, Rodas4()) @test sol.retcode == Success @@ -277,7 +276,6 @@ end systems = [pi_controller, plant, ref, fb, sat] ) sys = mtkcompile(model) - initial_conditions(sys)[sys.pi_controller.gainPI.k] = 1.0 prob = ODEProblem(sys, Pair[], (0.0, 20.0)) sol = solve(prob, Rodas4()) end diff --git a/test/Blocks/test_analysis_points.jl b/test/Blocks/test_analysis_points.jl index 83dd7b53..025f8c77 100644 --- a/test/Blocks/test_analysis_points.jl +++ b/test/Blocks/test_analysis_points.jl @@ -3,7 +3,7 @@ using SciCompDSL using ModelingToolkit using ModelingToolkitStandardLibrary.Blocks using OrdinaryDiffEq -using ModelingToolkit: get_eqs, vars, @set!, t_nounits as t +using ModelingToolkit: t_nounits as t using ControlSystemsBase @named P = FirstOrder(k = 1, T = 1) @@ -80,7 +80,7 @@ L = P*C open_sys, (u, y) = ModelingToolkit.open_loop(sys, :plant_input) # Linearizing the open-loop system should yield the same system as get_looptransfer -matrices, _ = linearize(open_sys, [u], [y]) +matrices, _ = linearize(open_sys, u, y) @test matrices.A[] == -1 @test matrices.B[] * matrices.C[] == -1 # either one negative @test matrices.D[] == 0 diff --git a/test/Electrical/analog.jl b/test/Electrical/analog.jl index 4e9a4cf3..e3cf741a 100644 --- a/test/Electrical/analog.jl +++ b/test/Electrical/analog.jl @@ -633,7 +633,7 @@ end end end - @mtkbuild sys = SimpleNMOSCircuit(V_cc = 5.0, V_b = 3.5) + @mtkcompile sys = SimpleNMOSCircuit(V_cc = 5.0, V_b = 3.5) prob = ODEProblem(sys, Pair[], (0.0, 10.0)) sol = solve(prob) @@ -673,7 +673,7 @@ end end end - @mtkbuild flipped_sys = FlippedNMOSCircuit(V_cc = 5.0, V_b = 3.5) + @mtkcompile flipped_sys = FlippedNMOSCircuit(V_cc = 5.0, V_b = 3.5) flipped_prob = ODEProblem(flipped_sys, Pair[], (0.0, 10.0)) flipped_sol = solve(flipped_prob) @@ -717,7 +717,7 @@ end end end - @mtkbuild sys = SimplePMOSCircuit(V_s = 5.0, V_b = 2.5, V_d = 3) + @mtkcompile sys = SimplePMOSCircuit(V_s = 5.0, V_b = 2.5, V_d = 3) prob = ODEProblem(sys, Pair[], (0.0, 10.0)) sol = solve(prob) @@ -760,7 +760,7 @@ end end end - @mtkbuild flipped_sys = FlippedPMOSCircuit(V_s = 5.0, V_b = 2.5, V_d = 3) + @mtkcompile flipped_sys = FlippedPMOSCircuit(V_s = 5.0, V_b = 2.5, V_d = 3) flipped_prob = ODEProblem(flipped_sys, Pair[], (0.0, 10.0)) flipped_sol = solve(flipped_prob) diff --git a/test/Hydraulic/isothermal_compressible.jl b/test/Hydraulic/isothermal_compressible.jl index 57a23eda..c19da7c9 100644 --- a/test/Hydraulic/isothermal_compressible.jl +++ b/test/Hydraulic/isothermal_compressible.jl @@ -320,7 +320,7 @@ end defs[sys.input.buffer] = Parameter(0.5 * x, dt) # NOTE: bypassing initialization system: https://github.com/SciML/ModelingToolkit.jl/issues/3312 - prob = ODEProblem(sys, [unknowns(initsys)[1] => initsol[1]], (0, 0.1); build_initializeprob = false) + prob = ODEProblem(sys, unknowns(initsys) .=> initsol.u[end], (0, 0.1); build_initializeprob = false) #TODO: Implement proper initialization system after issue is resolved #TODO: How to bring the body back and not have an overdetermined system?