Skip to content

Commit

Permalink
place animations on top
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen committed Oct 29, 2023
1 parent 51a1d1f commit 28f8f5b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
6 changes: 5 additions & 1 deletion docs/src/examples/spherical_pendulum.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Spherical pendulum

![animation](spherical.gif)

This example models a spherical pendulum. The pivot point is modeled using a [`Spherical`](@ref) joint, the pendulum rod is modeled using a [`FixedTranslation`](@ref) and the mass is modeled using a [`Body`](@ref). In this example, we choose the joint to be the root (joints are often better root objects than bodies).


```@example spring_mass_system
using Multibody
using ModelingToolkit
Expand Down Expand Up @@ -37,7 +41,7 @@ plot(sol, idxs = [body.r_0...])
```


## Render
## 3D animation
Multibody.jl supports automatic 3D rendering of mechanisms, we use this feature to illustrate the result of the simulation below:

```@example spring_mass_system
Expand Down
2 changes: 2 additions & 0 deletions docs/src/examples/spring_damper_system.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Spring-damper system

![animation](springdamper.gif)

Welcome to the spring-damper system example, where we will show you the process of modeling and simulating a basic yet essential mechanical system using the powerful Multibody.jl package in JuliaSim. By understanding the underlying principles of spring-damper systems, you will gain valuable insights into the behavior of various real-world systems, such as suspension systems in vehicles, vibration isolation mechanisms, and biomechanical structures.

This tutorial mirrors that of the following Modelica tutorial [Spring damper system](https://doc.modelica.org/om/Modelica.Mechanics.MultiBody.Examples.Elementary.SpringDamperSystem.html) and demonstrates that a body can be freely moving without any connection to a joint. In this case body coordinates are used as state by setting the option `isroot=true` to the body.
Expand Down
3 changes: 3 additions & 0 deletions docs/src/examples/spring_mass_system.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Spring-mass system

![animation](springmass.gif)

This example mirrors that of the [modelica spring-mass system](https://doc.modelica.org/om/Modelica.Mechanics.MultiBody.Examples.Elementary.SpringMassSystem.html) and demonstrates that we can model a spring-mass system in two different ways.

1. Using a prismatic joint and a 1-dimensional spring from the `Translational` submodule attached to the joint. The advantage of this approach is that the many elements from the Translational library can be easily used here and that this implementation is usually more efficient compared to when using 3-dimensional springs.
Expand Down
6 changes: 4 additions & 2 deletions docs/src/examples/three_springs.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Spring-mass system
# Three springs
![animation](three_springs.gif)

This example mirrors that of the [modelica three-springs](https://doc.modelica.org/om/Modelica.Mechanics.MultiBody.Examples.Elementary.ThreeSprings.html) and demonstrates that we can connect mass-less force elements together.

![three springs](https://doc.modelica.org/Modelica%203.2.3/Resources/Images/Mechanics/MultiBody/Examples/Elementary/ThreeSprings.png)

![animation](three_springs.gif)


The example connects three springs together in a single point. The springs are all massless and do normally not have any state variables, but we can insist on one of the springs being stateful, in this case, we must tell the lower spring component to act as root by setting `fixedRotationAtFrame_a = fixedRotationAtFrame_b = true`.

Expand Down

0 comments on commit 28f8f5b

Please sign in to comment.