@@ -57,22 +57,20 @@ D = Differential(t)
5757 ])
5858 sys = structural_simplify (model)
5959
60- @test_broken prob = ODAEProblem (sys, Pair[], (0 , 6.0 ))
61- @test_skip begin
62- sol = solve (prob, Rodas4 ())
63- @test sol. retcode == Success
64- # EMF equations
65- @test - 0.5 .* sol[emf. i] == sol[emf. flange. tau]
66- @test sol[emf. v] == 0.5 .* sol[emf. w]
67- # test steady-state values
68- dc_gain = [f/ (k^ 2 + f * R) k/ (k^ 2 + f * R); k/ (k^ 2 + f * R) - R/ (k^ 2 + f * R)]
69- idx_t = findfirst (sol. t .> 2.5 )
70- @test sol[inertia. w][idx_t]≈ (dc_gain * [V_step; 0 ])[2 ] rtol= 1e-3
71- @test sol[emf. i][idx_t]≈ (dc_gain * [V_step; 0 ])[1 ] rtol= 1e-3
72- idx_t = findfirst (sol. t .> 5.5 )
73- @test sol[inertia. w][idx_t]≈ (dc_gain * [V_step; - tau_L_step])[2 ] rtol= 1e-3
74- @test sol[emf. i][idx_t]≈ (dc_gain * [V_step; - tau_L_step])[1 ] rtol= 1e-3
75- end
60+ prob = ODEProblem (sys, [], (0 , 6.0 ))
61+ sol = solve (prob, Rodas4 ())
62+ @test sol. retcode == Success
63+ # EMF equations
64+ @test - 0.5 .* sol[emf. i] == sol[emf. flange. tau]
65+ @test sol[emf. v] == 0.5 .* sol[emf. w]
66+ # test steady-state values
67+ dc_gain = [f/ (k^ 2 + f * R) k/ (k^ 2 + f * R); k/ (k^ 2 + f * R) - R/ (k^ 2 + f * R)]
68+ idx_t = findfirst (sol. t .> 2.5 )
69+ @test sol[inertia. w][idx_t]≈ (dc_gain * [V_step; 0 ])[2 ] rtol= 1e-3
70+ @test sol[emf. i][idx_t]≈ (dc_gain * [V_step; 0 ])[1 ] rtol= 1e-3
71+ idx_t = findfirst (sol. t .> 5.5 )
72+ @test sol[inertia. w][idx_t]≈ (dc_gain * [V_step; - tau_L_step])[2 ] rtol= 1e-3
73+ @test sol[emf. i][idx_t]≈ (dc_gain * [V_step; - tau_L_step])[1 ] rtol= 1e-3
7674
7775 prob = DAEProblem (sys, D .(states (sys)) .=> 0.0 , Pair[], (0 , 6.0 ))
7876 sol = solve (prob, DFBDF ())
@@ -144,27 +142,24 @@ end
144142 ])
145143 sys = structural_simplify (model)
146144
147- @test_broken prob = ODAEProblem (sys, Pair[], (0 , 6.0 )) # KeyError: key 17 not found
148- @test_skip begin
149- sol = solve (prob, Rodas4 ())
150-
151- @test sol. retcode == Success
152- # EMF equations
153- @test - 0.5 .* sol[emf. i] == sol[emf. flange. tau]
154- @test sol[emf. v] == 0.5 .* sol[emf. w]
155-
156- # test steady-state values
157- dc_gain = [f/ (k^ 2 + f * R) k/ (k^ 2 + f * R); k/ (k^ 2 + f * R) - R/ (k^ 2 + f * R)]
158- idx_t = findfirst (sol. t .> 2.5 )
159- @test sol[inertia. w][idx_t]≈ (dc_gain * [V_step; 0 ])[2 ] rtol= 1e-3
160- @test sol[emf. i][idx_t]≈ (dc_gain * [V_step; 0 ])[1 ] rtol= 1e-3
161- idx_t = findfirst (sol. t .> 5.5 )
162- @test sol[inertia. w][idx_t]≈ (dc_gain * [V_step; - tau_L_step])[2 ] rtol= 1e-3
163- @test sol[emf. i][idx_t]≈ (dc_gain * [V_step; - tau_L_step])[1 ] rtol= 1e-3
164-
165- #
166- @test all (sol[inertia. w] .== sol[speed_sensor. w. u])
167- end
145+ prob = ODEProblem (sys, Pair[], (0 , 6.0 ))
146+ sol = solve (prob, Rodas4 ())
147+
148+ @test sol. retcode == Success
149+ # EMF equations
150+ @test - 0.5 .* sol[emf. i] == sol[emf. flange. tau]
151+ @test sol[emf. v] == 0.5 .* sol[emf. w]
152+
153+ # test steady-state values
154+ dc_gain = [f/ (k^ 2 + f * R) k/ (k^ 2 + f * R); k/ (k^ 2 + f * R) - R/ (k^ 2 + f * R)]
155+ idx_t = findfirst (sol. t .> 2.5 )
156+ @test sol[inertia. w][idx_t]≈ (dc_gain * [V_step; 0 ])[2 ] rtol= 1e-3
157+ @test sol[emf. i][idx_t]≈ (dc_gain * [V_step; 0 ])[1 ] rtol= 1e-3
158+ idx_t = findfirst (sol. t .> 5.5 )
159+ @test sol[inertia. w][idx_t]≈ (dc_gain * [V_step; - tau_L_step])[2 ] rtol= 1e-3
160+ @test sol[emf. i][idx_t]≈ (dc_gain * [V_step; - tau_L_step])[1 ] rtol= 1e-3
161+
162+ @test all (sol[inertia. w] .== sol[speed_sensor. w. u])
168163
169164 prob = DAEProblem (sys, D .(states (sys)) .=> 0.0 , Pair[], (0 , 6.0 ))
170165 sol = solve (prob, DFBDF ())
0 commit comments