Skip to content

Commit 35d485e

Browse files
authored
add test
1 parent 5d3b295 commit 35d485e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/Blocks/test_analysis_points.jl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,3 +374,27 @@ L = CS.ss(matrices...) |> sminreal
374374
matrices, _ = linearize(sys_outer, [:inner_plant_input], [:inner_plant_output])
375375
G = CS.ss(matrices...) |> sminreal
376376
@test tf(G) tf(CS.feedback(Ps, Cs))
377+
378+
## unit test
379+
@mtkmodel SingleIntegrator begin
380+
@parameters begin
381+
to_mps = 1, [unit = u"m/s"]
382+
end
383+
@variables begin
384+
(x(t) = 0), [unit = u"m", description = "Position"]
385+
control(t), [unit = u"m/s", description = "Control Velocity"]
386+
end
387+
@components begin
388+
uIn = RealInput()
389+
c1 = Blocks.Constant(k = 1)
390+
end
391+
@equations begin
392+
control ~ (uIn.u) * to_mps
393+
D(x) ~ control
394+
connect(c1.output, :test_point, uIn)
395+
end
396+
end
397+
@mtkbuild single_integrator = SingleIntegrator()
398+
prob = ODEProblem(single_integrator, [], (0, 10))
399+
sol = solve(prob, Tsit5())
400+
@test sol(10)[] 10

0 commit comments

Comments
 (0)