# Casual Introduction to Numerical Methods – spring-mass-damper system model – part#4

This tutorial explains the principles to generating animation for the spring-mass-damper system analyzed in the previous presentations.  ## A casual approach to numerical modeling – part #4 – a Spring-Mass-Damper-System – creating the animation

by George Lungu

– We are trying to generate animation for
the system sketched above knowing the
deviation from the equilibrium function of
time. This deviation is calculated dynamically
by using a macro. The formulas and the VBA
macros were presented in the previous
tutorial.

<excelunusual.com>

### This is a sketch of the system:

-System shown in equilibrium (spring unstressed).

– The only value calculated by our system of
equations is the coordinate “x_mass”. This
coordinate will change (will be animated)
during the run of the simulation.
When x_mass is zero the spring is unstressed.

– This input parameters (K, m, DC) will also scale
certain elements of the drawn system.

### The master dimension table:

X_mass = 0

– This table contains all the dimensional information regarding the system

– The top range G25:H25) is the proof mass position (y=0 and x is taken from the
table of coordinates, which is updated during the simulation run by the macro)

– The series L1, L3, L4, L5, L6, L7 and L10 are constants chosen by trial and error

– L0 = 1 + X_mass (the free spring length is 1 meter, X_mass is the stretch)

– L2 = 0.2 * Mass (the width of the mass is chosen proportional to the value of the
mass – the proportionality factor (0.2) is arbitrary)

– L8 = 0.15 / K (the width of spring is chosen inversely proportional to the spring
constant K – again, the proportionality factor (0.15) is arbitrary)

– L9, the width of the damper is drawn proportional to the square root of the
damping coefficient (see the formula in the worksheet) hence the cross sectional
area of the damper is proportional to the damping coefficient

<excelunusual.com> 2

#### —— Drawing the spring —— — Drawing the proof mass — — The damper body —-

– All this animation is created from pieces of various colors using the path and D X_mass-L5-L6 -3*L10+L9/2
coordinates shown in each table in order: A=>B=>C=>D=>E=> …… E X_mass-L5-L6 -3*L10-L9/2

F X_mass-L5 -3*L10-L9/2

– Creating the base plate is left as an exercise to the reader (if you encounter major problems you could cheat and look in the worksheet)

G X_mass-L5 -3*L10

by George Lungu <excelunusual.com>