where x is displacement from equlibrium position (meter), t is time (second), m is the mass and equal 20 kg, c is the damping coefficient (N.sec/meter) . The dampping coefficient, c, takes on two values of 5 (under damped), 40 (critically damped. The spring constant k = 20 N/meter. The initial velocity is zero, and the intial displacement x = 1 meter.

(a) Transform the problem into a system of two first order initial value ODEs. The report must clearly provide the detailed derivation of the technique.

(b) Solve for motion of a spring-mass system using the 2 nd order RK Huen method over the ?t ?1.0 . You can calcualte the results

manually or by matlab or by excel.

(c) Plot the displacment verus time for two values of the damping coefficient on the same figure, and discuss the results.

## Answer:

The motion of a damped spring mass system is described by the following ordinary differential equation

Second order RK Heun method over a period of time

The Heun’s method evaluates the slope at the beginning and at the end of the step. The generalized idea embodied in the Heun’s method is the Runge-Kutta method which uses a weighted average of the slope evaluated at multiple in the step.

%% order 647236

tspan=[0:0.1:50];

y0=[0.02;0];

[t,y]=ode45('unforced2',tspan,y0);

plot(t,y(:,1));

grid on

xlabel('time')

ylabel('Displacement')

title('Critically-damped Modelling of MSD system (C=40)')

%% order 647236

tspan=[0:0.1:50];

y0=[0.02;0];

[t,y]=ode45('unforced1',tspan,y0);

plot(t,y(:,1));

grid on

xlabel('time')

ylabel('Displacement')

title('Under-damped Modelling of MSD system (C=5)')

hold on;

%% order 647236

function yp=unforced2(t,y)

c=40;

m=20;

k=20;

yp= [y(2); (-((c/m)*y(2))-((k/m)*y(1)))];

%% order 647236

function yp=unforced1(t,y)

c=5;

m=20;

k=20;

yp= [y(2); (-((c/m)*y(2))-((k/m)*y(1)))];

- Plot the displacement versus time for the two values of the damping coefficient on the same figure.

- Explicit finite difference method and implicit crank-Nicholson method.

The explicit finite difference method. The relationship between continuous and discrete problems. Uniformly spaced in the interval from 0-L such that The spacing between the values is computed by,The discrete, t, are uniformly spaced in M- is the number of time steps and the is the size of a time step.

## Follow Us