Linear or linearized models are useful for predicting the behavior of dynamic systems because powerful analytical techniques are available for such models, especially when the inputs are relatively simple functions such as the impulse, step, ramp, and sine. Often in the design of an engineering system, however,

we must eventually deal with nonlinearities in the system and with more complicated inputs such as trapezoidal functions, and this must often be done with simulation. In this section we introduce four additional Simulink elements that enable us to model a wide range of nonlinearities and input functions, namely,

• the Derivative block,

• the Signal Builder block,

• the Look-Up Table block, and

• the MATLAB Fcn block.

As our example, we will use the single-mass suspension model shown in Figure 9.9-1, where the spring and damper forces is and id have the nonlinear models shown in Figures 9.9-2 and 9.9-3. The damper model is un symmetric and represents a damper whose force during rebound is higher than during jounce (in order to minimize the force transmitted to the passenger compartment when the vehicle strikes a bump). The bump is represented by the trapezoidal function y(t) shown in Figure 9.9-“4. This function corresponds approximately to a vehicle traveling at 30 milhr over a road surface elevation 0.2 m high and 48 m long.

The system model from Newton’s law is

**mx = is(Y – x) + h(y – x)**

Figure 9.9-2, and h(y – x) is the nonlinear damper function shown in Figure 9.9-3. The corresponding simulation diagram is shown in Figure 9.9-5.

**The Derivative and Signal Builder Blocks**

The simulation diagram shows that we need to compute y. Because Simulink ses numerical and not analytical methods, it computes derivatives only approximately, using the Derivative block. We must keep this in mind when using rapidly changing or discontinuous inputs. The Derivative block has no settings, so merely place itin the Simulink diagram as shown in Figure 9.9-6. Next, place the Signal-Builder block, then double-click on it. A plot window appears that enables you to place points to define the input function. Follow the irections in the window to create the function shown in Figure 9.9-4. l

**The Look-Up Table Block**

The spring function is is created with the Look-Up Table block. After placing it shown, double-click on it and enter [- 0. 5, – 0 . 1, 0, O. 1, O. 5] for Vector of input values and [- 4 500 , – 5 0 0, 0, 500 , 4500] for the Vector of output values. Use the default settings for the remaining parameters. Place the two integrators as shown, and make sure the initial values are set to . Then place the Gain block and set its gain to 1/400. The To Workspace block and the Clock will enable us to plot x(t) and y(l) – xCt) versus I in the MATLAB Command window.** **

**The MATLAB Fen Block**

In Section 9.7 we used the Fen block to implement the signed-square-root function. e cannot use this block for the damper function shown in Figure 9.9-3 because

we must write a user-defined function to describe it. This function is as follows. function f = damper(v)

if v <= 0

f = – 800* (abs (v) ) .” (0 .6) i

else

f = 200*v.”(O.6) i

end

Create and save this function file. After placing the MATLAB Fcn block, double-click on it and enter its name damper. Make sure Output dimensions is set to -1and the Output signal type is set to auto. The Fen, MATLAB Fen, Math Function, and S-Function blocks can be used to implement functions, but each has its advantages and limitations. TheFcn block can contain an expression, but its output must be a scalar, and it cannot call a function file. The MATLAB Fen block is slower than the Fcn block, but its output can be an array, and it can call a function file. The Math Function block can.produce an array output, but it is limited to a single MATLAB function and cannot use an expression or call a file. The S-Function block provides more advanced features, such as the ability to use C language code. The Simulink model when completed should look like Figure 9.9-6. You can plot the response x(t) in the Command window as follows:

»x = sirnout(:,l)i

»t = sirnout(:,3)i

»plot(t,x),grid;xlabel(‘t (s)’),ylabel(‘x (rn)’)’

The result is shown in Figure 9.9-7. The maximum overshoot is seen to be (0.26 ‘- 0.2) =0.06 m, but the maximum undershoot is seen to be much greater, -0.168 m.