Skip to content

Commit 33735c8

Browse files
committed
update doc for multibody
1 parent 4a26e30 commit 33735c8

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

docs/src/examples/kinematic_loops.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ world = Multibody.world
3737
3838
l = 1.5
3939
systems = @named begin
40+
world = World()
4041
j1 = Revolute(axisflange=true) # We use an axis flange to attach a damper
4142
j2 = Revolute(axisflange=true)
4243
j3 = Revolute()
@@ -73,8 +74,7 @@ connections = [
7374
connect(j2.support, damper2.flange_b)
7475
7576
]
76-
@named fourbar = System(connections, t, systems = [world; systems])
77-
fourbar = complete(fourbar)
77+
@named fourbar = System(connections, t; systems)
7878
ssys = multibody(fourbar)
7979
prob = ODEProblem(ssys, [fourbar.j1.phi => 0.1], (0.0, 10.0))
8080
sol = solve(prob, FBDF(autodiff=true))

docs/src/examples/pendulum.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ nothing # hide
4242
With all components and connections defined, we can create an `System` like so:
4343
```@example pendulum
4444
@named model = System(connections, t, systems=[world, joint, body])
45-
model = complete(model)
4645
nothing # hide
4746
```
4847
The `System` is the fundamental model type in ModelingToolkit used for multibody-type models.
@@ -53,6 +52,9 @@ ssys = multibody(model)
5352
```
5453
This results in a simplified model with the minimum required variables and equations to be able to simulate the system efficiently. This step rewrites all `connect` statements into the appropriate equations, and removes any redundant variables and equations. To simulate the pendulum, we require two state variables, one for angle and one for angular velocity, we can see above that these state variables have indeed been chosen.
5554

55+
!!! note
56+
The function `multibody` internally calls `mtkcompile`, and the user should this not call `mtkcompile` manually for multibody systems.
57+
5658
```@docs
5759
multibody
5860
```

src/Multibody.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export multibody
159159
"""
160160
multibody(model)
161161
162-
Perform validity checks on the model, such as the precense of exactly one world component in the top level of the model, and transform the model into an `IRSystem` object for passing into `structural_simplify`.
162+
Perform validity checks on the model, such as the precense of exactly one world component in the top level of the model, and call `mtkcompile` with simplification options suitable for multibody systems.
163163
"""
164164
function multibody(model, level=0; reassemble_alg = StructuralTransformations.DefaultReassembleAlgorithm(; inline_linear_sccs = true, analytical_linear_scc_limit = 1), kwargs...)
165165
found_world = false

0 commit comments

Comments
 (0)