First-principle model of a 3 mass, 4 spring mechanical system: ode45 vs lsim simulation

Antonio Sala, UPV

Difficulty: ** ,       Relevance: PIC,      Duration: 12:54

*Enlace a Spanish version

Materials:    [ Cód.: simul3M4Sstandalone.m ] [ PDF ]

Summary:

This video continues the case study of a 3-mass, 4-spring system whose first-principle modeling was covered in the videos [moll3modEN] and [moll3mod2EN] with force balances and Newton’s equations.

Here, the equations = Ax + Bu derived in the referred materials are entered in matrix form, simply by entering the constant matrices A and B by copying them from the theoretical modeling slides. The output equation y = Cx + Du is implemented so that only the three positions are part of the vector y.

Once the model has been typed onto a Matlab script, a simulation is performed under certain initial conditions and a sinusoidal input profile (arbitrarily chosen). To compare the results and the computation time, the numerical integration is performed both with ode45 (a generic simulator, which can also simulate nonlinear systems) and with lsim (a simulator specialized in linear systems). The second case is, at least in this example, several times faster to execute; both simulations are basically coincident, apart from numerical tolerances to the fifth or sixth decimal place.

Animation in order to better apprehend how this system moves and vibrates will be discussed in the forthcoming video [moll3aniEN]. The free response (zero input) properties are discussed in detail in the video [moll3freeEN].

*Link to my [ whole collection] of videos in English. Link to larger [ Colección completa] in Spanish.

© 2024, A. Sala. All rights reserved for materials from authors affiliated to Universitat Politecnica de Valencia.
Please consult original source/authors for info regarding rights of materials from third parties.