Sie sind auf Seite 1von 2

Shiraz University School of Mechanical Engineering

Numerical Analysis Project Deadline Date: 4th Bahman

Problem 1: The motion of a damped spring-mass system shown in the following figure is
described by the following ordinary differential equation:

d 2x dx
m 2 c  kx  k x 3  0
dt dt

where x = displacement from equilibrium position (m), t = time (s), m = 10 kg mass, and
c = the damping coefficient (N.s/m). The spring constant k and the damping coefficient c are
10 N/m and 5 N.s/m, respectively. The initial velocity is zero, and the initial displacement is
x = 0.8 m.

Fig. 1. Schematic of the damped spring-mass system

Write a computer program by MATLAB software to solve for x  t  and x  t  using, a)

Heun’s method with iterations for the corrector equation, b) forth-order RK method and c)
MATLAB “ode45” function. In all cases use step sizes of h=0.01 and h=0.2, and simulate
the system response over the time period 0 ≤ t ≤ 5 s. Consider a proper percent relative error
 s for solving part (a).
Plot the displacement and velocity versus time for all cases and compare your results
obtained from various methods. Also, plot the true percent relative error versus time for all
cases (a), (b) and (c) on the same curve and for two step sizes of h=0.01 and h=0.2.

Good Luck, Dr. R. Vatankhah

1
Shiraz University School of Mechanical Engineering
Numerical Analysis Project Deadline Date: 4th Bahman

Problem 2: Suppose that the position x of a falling object is governed by the following
differential equation with boundary conditions


x  m  x  x   g  0
c 3


x  0   5 and dx
x 1  1  35
 dt

where c = a first-order drag coefficient = 4 kg/s, m = mass = 5 kg, and g = gravitational


acceleration = 9.8 m/s2. Use the finite difference method to solve the above-mentioned
boundary value problem. Consider the Newton-Raphson method for solving the
corresponding nonlinear system of equations. Consider a proper step size for the finite
difference method and a proper percent relative error  s as the stopping criterion for the

Newton-Raphson method. Plot the displacement and velocity versus time.

Good Luck, Dr. R. Vatankhah

Das könnte Ihnen auch gefallen