Modeling a vertical spring system with one mass is a pretty common problem. I looked around online and found some horizontal spring systems with two masses, but no examples of a vertical one.
I'm curious, how would you set up equations modeling a vertical spring system like this: $$ ----\\ \wedge \\ \vee \\ \wedge \\ \vee\\ (m_1)\\ \wedge\\ \vee\\ \wedge\\ \vee\\ (m_2) $$
Where the first spring has constant $k_1$, and the second $k_2$. I'll let $y_1(t)$ be the position of the top mass away from its equilibrium, and $y_2(t)$ the position of the bottom mass away from its equilibrium. I choose down to be the positive direction.
For the bottom mass, there is an upward force of $k_2y_2$, and a downward gravitational force of $m_2g$. So one equation should be $$ m_2y_2''=-k_2y_2+m_2g $$ For the top mass, the first spring pulls up with force $-k_1y_1$ and a downward gravitational force of $m_1g$. I'm not sure how to account for the forces of the second spring and second mass acting of the first mass. Is the equation something like $$ m_1y_1''=-k_1y_1+m_1g+\text{ something?} $$
I'm just curious how you would correctly set up the equations for this system. Thanks.