Spring mass damper system

Hi Everyone,

I am using “odeint” command to solve a second order differential equation of a Spring-mass-damper model. Nevertheless, besides plot the displacements and velocity of the mass, I need to plot the accelerations. Does anyone know how to directly plot x" (acceleration) whithout derive x’ (velocity)?!

If you’re calling odeint(), then presumably you can already compute the first two derivatives. Just use the same function you pass as the first argument to compute the second derivative, or acceleration. You’ll need the position and velocity, per the equation of motion. Those come from solving the ODE and initial conditions.

[governance doesn’t seem to be an appropriate tag for this topic]