Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen authored May 27, 2024
1 parent 5d3b295 commit 35d485e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/Blocks/test_analysis_points.jl
Original file line number Diff line number Diff line change
Expand Up @@ -374,3 +374,27 @@ L = CS.ss(matrices...) |> sminreal
matrices, _ = linearize(sys_outer, [:inner_plant_input], [:inner_plant_output])
G = CS.ss(matrices...) |> sminreal
@test tf(G) tf(CS.feedback(Ps, Cs))

## unit test
@mtkmodel SingleIntegrator begin
@parameters begin
to_mps = 1, [unit = u"m/s"]
end
@variables begin
(x(t) = 0), [unit = u"m", description = "Position"]
control(t), [unit = u"m/s", description = "Control Velocity"]
end
@components begin
uIn = RealInput()
c1 = Blocks.Constant(k = 1)
end
@equations begin
control ~ (uIn.u) * to_mps
D(x) ~ control
connect(c1.output, :test_point, uIn)
end
end
@mtkbuild single_integrator = SingleIntegrator()
prob = ODEProblem(single_integrator, [], (0, 10))
sol = solve(prob, Tsit5())
@test sol(10)[] 10

0 comments on commit 35d485e

Please sign in to comment.