diff --git a/test/Blocks/test_analysis_points.jl b/test/Blocks/test_analysis_points.jl index 0d3ac7122..5e245a0f1 100644 --- a/test/Blocks/test_analysis_points.jl +++ b/test/Blocks/test_analysis_points.jl @@ -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