# Piecewise-Linear Models Matlab Help

Piecewise-Linear Models

Unlike linear models, closed-form solutions are not available for most nonlinear differential equations, and we must therefore solve such equations numerically. A nonlinear ordinary differential equation can be recognized by the fact that the dependent variable or its derivatives appears raised to a power or in a transcendental function. For example, the following equations are nonlinear.

I y y+5y+y=O y + siny = 0 y+JY=O

Piecewise-linear models are actually nonlinear, although they may appear to be linear. They are composed of linear models that take effect when certain conditions are satisfied. The effect of switching back and forth between these linear models makes the overall model nonlinear. An example of such a model is a mass attached to a spring and sliding on a horizontal surface with Coulomb friction. The model is

mi +kx = f(l) – umg if x ~ 0
mi +kx = f(l) + umg if x < 0

These two linear equations can be expressed as the single. nonlinear equation {+l mi +kx = f(l) – Jl.mg Slgn(x) where sJgn(x) = _\
if x ~ 0
if x < O·

The Realy Black

The Simulink Relay block is an example of something that is tedious to program in MATLAB but is easy to implement in Simulink. Figure 9.4-7a isa the graph of logic of a relay. The relay switches the output between two specified values, . named On and Off in the figure. Simulink callsthese values “Output when on” and “Output when off.” When the relay output is Or, it ‘remains On until the input drops below the value of the Switch-off point parameter, named SwOff in the figure. When the relay output is Off, it remains Offuntil the input exceeds the value of the Switch-on point parameter, named on and Off in the figure. The Switch-on point parameter value must be greater than or equal to the switch off point value. Note that the value of Off need not be zero. Note also that the value of Off need not be less than the value of On. The case where Off > On is shown in Figure 9.4-7b. As we will see in the following example. it is sometimes necessary to use this case.

Posted on July 25, 2015 in simulink