Spring-mass System done in Python
In this project, you shall model the oscillation of a spring-mass system on a frictionless surface. The spring force is F = -kx, where k is the spring constant.
If the spring constant k is 150 (N)/(m), the oscillating mass m is 0.8 kg initially at rest at the position x₀ = 5 m, use the Euler integration method to model the motion of the mass for time t varying from 0 s to 2 s.
Repeat the same calculation using the Euler-Cromer method, for time t also varying from 0 s to 2 s.
Plot the graphs x(t) vs t, v(t) vs t, and a(t) vs t. Each one of the three graphs shall have the curves obtained from each numerical integration method. Compare your calculations using different values for the time interval dt, say, dt = 0.1 s, dt = 0.01 s, dt = 0.001 s, etc, and comment on the convergence of both methods.
Spring-mass System
In this project, you shall model the oscillation of a spring-mass system on a frictionless surface. The spring force is F = -kx, where k is the spring constant.
If the spring constant k is 150 N/m, the oscillating mass m is 0.8 kg initially at rest at the position x₀ = 5 m, use the Euler integration method to model the motion of the mass for time t varying from 0 s to 2 s.
Repeat the same calculation using the Euler-Cromer method, for time t also varying from 0 s to 2 s.
Plot the graphs x(t) vs t, v(t) vs t, and a(t) vs t. Each one of the three graphs shall have the curves obtained from each numerical integration method. Compare your calculations using different values for the time interval dt, say, dt = 0.1 s, dt = 0.01 s, dt = 0.001 s, etc, and comment on the convergence of both methods.