Now the parts of the code may be put together in one Matlab function doing the symbolic derivation (Listing 1), the generation of functions (Listing 2), the definition of animation parameters (Listing 3), the calculation of the static equilibrium (Listing
4), the linear analysis (Listing 6) and the numerical integration (Listing 7). For this example the numerical integration in Matlab on a modern PC works without using significant CPU time.