RHSSpring:

Path: Common/DemoFuns

% Computes the right hand side for a linear spring.
--------------------------------------------------------------------------
   Form:
   xDot = RHSSpring( x, ~, d )
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   x   (2,1) State [x;v]
   t   (1,1) Time (s) (unused)
   d   (.)   Data structure
           	.zeta	(1,1) Damping ratio
           	.w  	(1,1) Undamped natural frequency  (rad/s)
             .m    (1,1) Mass (kg)

   -------
   Outputs
   -------
   xDot       (2,1) d[x;v]/dt

--------------------------------------------------------------------------

Back to the Common Module page