4) Simulink_S_Function_Miniguide_Rev06

4) Simulink_S_Function_Miniguide_Rev06 - SIMULINK MINIGUIDE...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: SIMULINK MINIGUIDE Simulation of Nonlinear Dynamic Systems Using S-Function Blocks by Prof. Oscar D. Crisalle Chemical Engineering University of Florida crisalle@che.ufl.edu Revision 06 - March 4, 2010 Contents 1 Nonlinear Dynamic System Used as Illustration . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 MATLAB S-Function Describing the Nonlinear Model . . . . . . . . . . . . . . . . . . . . . . 2 3 SIMULINK S-Function Block that Calls a MATLAB S-Function . . . . . . . . . . . . . . . . 4 4 Running a Nonlinear Simulation Using the SIMULINK Interface . . . . . . . . . . . . . . . . 5 5 Running a Nonlinear Simulation Using the MATLAB Interface . . . . . . . . . . . . . . . . . 6 6 Results Produced by the Simulation Software . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 7 Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 7.1 Defining Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 7.2 Driver File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 7.3 Printing to the Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 7.4 Plotting Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1 Nonlinear Dynamic System Used as Illustration The following nonlinear dynamic system, consisting of state and output equations, along with a set of initial conditions, is used to illustrate how to carry out a simulation using S-functions with SIMULINK. The model is simply denoted Nonlinear System and referred to by the acronym NLS. State Equations x 1 = cosx 2 ( t ) + u ( t ) x 2 = sinx 1 ( t ) u ( t ) 2 Output Equations y 1 ( t ) = q x 2 1 ( t ) + x 2 2 ( t ) y 2 ( t ) = 10 + e- . 2 t x 1 ( t ) 1 2 MATLAB S-FUNCTION DESCRIBING THE NONLINEAR MODEL Initial Conditions x 1 (0) = 1 x 2 (0) =- 25 where the model parameters are constrained to lie in the ranges [1 , 100] [1 , 10] and the input signal is the step function u ( t ) = ( t < t s M t s of height M , where . 1 M 25 A dynamic simulation study consists of solving the differential equations that define the state equations and finding the value of the output variables as a function of time t . In turn the time variable ranges from an initial value t = 0 to a final instant t = t f , where t f = 20 . 2 MATLAB S-Function Describing the Nonlinear Model An S-Function is a MATLAB M-function that has a special structure with sections that are executed de- pending on the value of a variable called flag . The function named NLS_Dynamics.m shown below is an S-Function appropriately configured to represent the nonlinear system under consideration....
View Full Document

Page1 / 15

4) Simulink_S_Function_Miniguide_Rev06 - SIMULINK MINIGUIDE...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online