Skip to content

Solves for the response of a Damped mass and spring system under a sinusoidal input

Notifications You must be signed in to change notification settings

DevPS-513/Mass-Spring-Damper-Python-Demo

Repository files navigation

Mass-Spring-Damper-Python-Demo

This code solves for the response of a dDamped mass and spring system under a sinusoidal input. The example it solves can be found at https://www.crcpress.com/downloads/K11527/MATLAB%20Resources.pdf

System mode: Mass connected to a rigid ground via a spring and damper, the force input is fo*sin(wt)

Turning this into state space gives q_dot= Aq+Bu y=Cq+Du

k = 100newtons/meters m = 1kg damping_ratio = 0.1 omega_n = np.sqrt(k/m) c = zeta2np.sqrt(m*k)

A = [[0, 1], [-k/m, -c/m]]

B = [[0], [1]]

C = [[1, 0]] This will choose displacement as our output

D = 0

About

Solves for the response of a Damped mass and spring system under a sinusoidal input

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages