Case A: Spring Mass Problem:
The mass m is attached to a spring of length b and stiffness k. The coefficient of friction between the mass and the horizontal surface is μ. The acceleration of the mass can be shown to be x'' = -f(x), where
f(x) = μ g + (k/m)(μ b + x)left(1 - dfrac{b}{sqrt{b^2 + x^2}}
ight)
The motion equation is given by energy relation and kinematics as appropriate.
Compute v0 by numerical Simpson's rule and trapezoidal integration and compare between them with different step sizes. Use the values: μ = 0.09, k = 0.06, m = 0.03, b = 1, g = 9.81 m/s^2.
Develop MATLAB code to solve the equation for both methods. Plot the acceleration of the mass over time. Also find the maximum acceleration (area under curve where required) using MATLAB built-in functions. Can we find an exact solution? Try it.
Figure 1: [Insert Figure 1 here]