@@ -149,10 +149,10 @@ sol = solve(prob, Tsit5())
149149# # Generate function for an augmented Unscented Kalman Filter =====================
150150# temp = open_loop(model_with_disturbance, :d)
151151outputs = [P. inertia1. phi, P. inertia2. phi, P. inertia1. w, P. inertia2. w]
152- (f_oop1, f_ip) , x_sym, p_sym, io_sys = ModelingToolkit. generate_control_function (
152+ f , x_sym, p_sym, io_sys = ModelingToolkit. generate_control_function (
153153 model_with_disturbance, [:u ], [:d1 , :d2 , :dy ], split = false )
154154
155- (f_oop2, f_ip2) , x_sym, p_sym, io_sys = ModelingToolkit. generate_control_function (
155+ f , x_sym, p_sym, io_sys = ModelingToolkit. generate_control_function (
156156 model_with_disturbance, [:u ], [:d1 , :d2 , :dy ],
157157 disturbance_argument = true , split = false )
158158
@@ -168,22 +168,22 @@ x0, p = ModelingToolkit.get_u0_p(io_sys, op, op)
168168x = zeros (5 )
169169u = zeros (1 )
170170d = zeros (3 )
171- @test f_oop2 (x, u, p, t, d) == zeros (5 )
171+ @test f (x, u, p, t, d) == zeros (5 )
172172@test measurement (x, u, p, 0.0 ) == [0 , 0 , 0 , 0 ]
173173@test measurement2 (x, u, p, 0.0 , d) == [0 ]
174174
175175# Add to the integrating disturbance input
176176d = [1 , 0 , 0 ]
177- @test sort (f_oop2 (x, u, p, 0.0 , d)) == [0 , 0 , 0 , 1 , 1 ] # Affects disturbance state and one velocity
177+ @test sort (f (x, u, p, 0.0 , d)) == [0 , 0 , 0 , 1 , 1 ] # Affects disturbance state and one velocity
178178@test measurement2 (x, u, p, 0.0 , d) == [0 ]
179179
180180d = [0 , 1 , 0 ]
181- @test sort (f_oop2 (x, u, p, 0.0 , d)) == [0 , 0 , 0 , 0 , 1 ] # Affects one velocity
181+ @test sort (f (x, u, p, 0.0 , d)) == [0 , 0 , 0 , 0 , 1 ] # Affects one velocity
182182@test measurement (x, u, p, 0.0 ) == [0 , 0 , 0 , 0 ]
183183@test measurement2 (x, u, p, 0.0 , d) == [0 ]
184184
185185d = [0 , 0 , 1 ]
186- @test sort (f_oop2 (x, u, p, 0.0 , d)) == [0 , 0 , 0 , 0 , 0 ] # Affects nothing
186+ @test sort (f (x, u, p, 0.0 , d)) == [0 , 0 , 0 , 0 , 0 ] # Affects nothing
187187@test measurement (x, u, p, 0.0 ) == [0 , 0 , 0 , 0 ]
188188@test measurement2 (x, u, p, 0.0 , d) == [1 ] # We have now disturbed the output
189189
0 commit comments