An ideal one-dimensional oscillating system consists of two unit masses,
and
, confined between two walls. Each mass is attached to the nearest wall by a spring of unit elastic constant. Another such spring connects the two masses. Sensors sample
and
, the accelerations of the masses, at
Hz.

Specify a total measurement time of 16 s. Define the sampling interval
.

The system can be described by the state-space model

where
is the state vector and
and
are respectively the location and the velocity of the
-th mass. The input vector
and the output vector
. The state-space matrices are

the continuous-time state-space matrices are

and
denotes an identity matrix of the appropriate size.

The first mass,
, receives a unit impulse in the positive direction.

Use the model to compute the time evolution of the system starting from an all-zero initial state.

Plot the accelerations of the two masses as functions of time.

Convert the system to its transfer function representation. Find the response of the system to a positive unit impulse excitation on the first mass.

Plot the result. The transfer function gives the same response as the state-space model.

The system is reset to its initial configuration. Now the other mass,
, receives a unit impulse in the positive direction. Compute the time evolution of the system.

Plot the accelerations. The responses of the individual masses are switched.

Find the response of the system to a positive unit impulse excitation on the second mass.

Plot the result. The transfer function gives the same response as the state-space model.