|
90 | 90 | @named pt2 = SecondOrder(; k = k, w = w, d = d) |
91 | 91 | @named iosys = System(connect(c.output, pt2.input), t, systems = [pt2, c]) |
92 | 92 | sys = mtkcompile(iosys) |
93 | | - prob = ODEProblem(sys, [unknowns(sys) .=> 0.0...; pt2.xd => 0.0], (0.0, 100.0)) |
| 93 | + prob = ODEProblem(sys, unknowns(sys) .=> 0.0, (0.0, 100.0)) |
94 | 94 | sol = solve(prob, Rodas4()) |
95 | 95 | @test sol.retcode == Success |
96 | 96 | @test sol[pt2.output.u] ≈ pt2_func.(sol.t, k, w, d) atol = 1.0e-3 |
|
176 | 176 | systems = [pi_controller, plant, ref, fb] |
177 | 177 | ) |
178 | 178 | sys = mtkcompile(model) |
179 | | - initial_conditions(sys)[sys.pi_controller.gainPI.k] = 1.0 |
180 | 179 | prob = ODEProblem(sys, Pair[], (0.0, 100.0)) |
181 | 180 | sol = solve(prob, Rodas4()) |
182 | 181 | @test sol.retcode == Success |
|
277 | 276 | systems = [pi_controller, plant, ref, fb, sat] |
278 | 277 | ) |
279 | 278 | sys = mtkcompile(model) |
280 | | - initial_conditions(sys)[sys.pi_controller.gainPI.k] = 1.0 |
281 | 279 | prob = ODEProblem(sys, Pair[], (0.0, 20.0)) |
282 | 280 | sol = solve(prob, Rodas4()) |
283 | 281 | end |
|
0 commit comments