@@ -33,7 +33,7 @@ systems = @named begin
33
33
b3 = BodyShape(m=1, r = [-l, 0, 0], radius=0.03)
34
34
b4 = BodyShape(m=1, r = [0.0, -l, 0], radius=0.03)
35
35
damper1 = Rotational.Damper(d=0.1)
36
- damper2 = Rotational.Damper(d=0.11 )
36
+ damper2 = Rotational.Damper(d=0.1 )
37
37
end
38
38
39
39
connections = [
@@ -60,11 +60,15 @@ connections = [
60
60
61
61
]
62
62
@named fourbar = ODESystem(connections, t, systems = [world; systems])
63
- m = structural_simplify(IRSystem(fourbar))
64
- prob = ODEProblem(m, [world.g => 9.81], (0.0, 30.0))
65
- sol = solve(prob, FBDF(autodiff=false))
66
-
67
- plot(sol, idxs = [j1.phi, j2.phi, j3.phi])
63
+ fourbar = complete(fourbar)
64
+ ssys = structural_simplify(IRSystem(fourbar))
65
+ prob = ODEProblem(ssys, [fourbar.j1.phi => 0.1], (0.0, 10.0))
66
+ sol = solve(prob, FBDF(autodiff=true))
67
+
68
+ plot(
69
+ plot(sol, idxs = [j1.phi, j2.phi, j3.phi]),
70
+ plot(sol, idxs = [j1.w, j2.w, j3.w]),
71
+ )
68
72
```
69
73
70
74
``` @example kinloop
@@ -124,9 +128,9 @@ connections = [connect(j2.frame_b, b2.frame_a)
124
128
]
125
129
@named fourbar2 = ODESystem(connections, t, systems = [world; systems])
126
130
fourbar2 = complete(fourbar2)
127
- m = structural_simplify(IRSystem(fourbar2))
131
+ ssys = structural_simplify(IRSystem(fourbar2))
128
132
129
- prob = ODEProblem(m , [], (0.0, 1.4399)) # The end time is chosen to make the animation below appear to loop forever
133
+ prob = ODEProblem(ssys , [], (0.0, 1.4399)) # The end time is chosen to make the animation below appear to loop forever
130
134
131
135
sol = solve(prob, FBDF(autodiff=true));
132
136
@test SciMLBase.successful_retcode(sol)
0 commit comments