### Creation of a Pendulum (5/8)

Description

Now we will create internal forces to add interactions between the particles of our mechanical object.

The concept of Forces are handled in SOFA by components called ForceFields. We implemented numerous algorithms to simulate Mass Spring systems, Finite Elements, Rigid Bodies, etc. Again, there are examples available for these different types. In this tutorial, we will add a Spring between the two particles.

Key points

We will use a SpringForceField to model our spring.

Type "Spring" in the Filter textbox. You will see SpringForceField in two categories. Both are the same. Drag and drop the SpringForceField from either category over the FirstObject node. Double click the SpringForceField in the Modeler scene graph.

Click on the Property 2/2 tab. In the spring section, increase the 0 to "1", and press Display the values. Then, press the Update button found in the bottom left corner of the window.

The titles of the columns now describe all the parameters needed to create a spring: two indices (Index1, Index2) corresponding to the particles attached by the spring, a stiffness coefficient (Ks), a damping coefficient (Kd), and the rest length of the spring (L).

Type the values "0", "1", "100", "5" and "1" into the columns Index1, Index2, Ks, Kd and L respectively. Press OK to return to the Modeler. Run the scene in SOFA, and animate.
Results

The two particles are now linked together by a spring. The second particle continues to fall because of gravity, but a spring, displayed by a green line, keeps them close. (Note: If you can't see the green line, make sure "Force Fields" is selected in the View tab in SOFA)

We have modeled a very basic pendulum with only 5 components. Take some time to customize this scene. Try modifying the parameters of the spring, the position and parameters of the particles of the mechanical object, or adding particles or springs.

### Previous ____________ Next