|
Example 4.
In this example, we'll consider the same system as described in Example 3. But instead of using step input, we'll excite the second-order system with impulse load. In addition, we will simulate the response using a state-space model.
NOTES ON IMPULSE FUNCTION
Impulse function is useful in the simulatoin of impact or sudden loads such as the striking of a the tip of the pole against a ball in a pool game. Unit impulse function at a desired instant a is defined by
 |
(4) |
Equation 4 is also known as Dirac delta function.
To simulate unit impulse in Simulink, we'll use a two-block step function set as shown below.

SOME NOTES ON STATE-SPACE APPROACH
The concept of the state of the system is utilized extensively in the time-domain analysis and design of control systems. The state variables (along with the input functions) used in equations describing the dynamics of a system provide the future state of the system. Mathematically, the state of the system is described by a set of first-order differential equation in terms of state variables.
For our example, we will express the natural state variables,e.g., position and velocity, of the system in terms of the following variables:
 |
(5) |
where x1 represents the position and x2 represents the velocity of the system. With the new state variables defined in Eq. 5, Eq. 3 becomes
 |
(6) |
In a matrix form:
 |
(7) |
Equation 7 may be expressed in a more compact form:
 |
(8) |
where A is known as the system matrix and B as the input matrix.
The output equation is expressed by
 |
(9) |
where
 |
(10) |
and
 |
(11) |
C is called the output matrix and D is called the direct transmittance matrix.
MATLAB AND SIMULINK APPLICATION
In this problem we will first ask Matlab to convert the transfer function as shown in Figure E3-1 using the following command:
>> [A,B,C,D]=tf2ss(1,[2,0.7,1])
NOTE: You are encouraged to read the help file on tf2ss function (>> help tf2ss).
Matlab's answers:

Now, let's get back to SIMULINK window and construct the necessary blocks as shown below. Note that the additional blocks (Transfer Fcn and its "scope") shown in light blue are provided for comparison with the the output from state-space block.

As demonstrated in previous examples, you may change the parameters in the state-space block or any other block by double clicking on it to bring up a parameter editing window.
For state space model, enter the following parameters:
A: [-0.35 -0.5;1 0]
B: [1;0]
C: [0 0.5]
D: 0
Once the entries are completed, click OK button to close the panel and continue on making necessary entries for other blocks.
For the impulse simulation:
In this example, let's consider an unit impulse at 0.2 second with pulse duration of 0.01 second and a magnitude of 40. To simulate this impulse, we'll enter in the first block (Step start) the following parameters (double click on the block to bring up the parameter windows):
Step time: 0.2
Initial value: 0
Final value: 40
For the second block (Step end):
Step time: 0.21
Initial value: 0
Final value: 40
This will produce the following impulse:

NOTES: The choice of pulse duration should be made carefully. A duration that is too short may lead to computational error. An excessively long duration could misrepresent the dynamics of the modeled system.
To run the simulation use keystrokes: CTRL+T or click on the button.
To change the simulation parameters and make adjustment to simulation duration, press CTRL+E or choose Simulation parameters... from Simulation menu.
Enter 30 for Stop time.

The screenshot below shows the impulse response of the system described by Eq. 2 with m = 2; k = 1; c=0.7

For the fun of it, you may want to make adjustments to damping ratio and/or spring stiffness paramaters and run the simulation again to see how these changes would affect the response to the impulse input. |