the Simulation of Dynamics Using Simulink

Similar documents
\XjP^J Taylor & Francis Group. Model-Based Control. Tensor Product Model Transformation in Polytopic. Yeung Yam. CRC Press.

Parallel Robots. Mechanics and Control H AMID D. TAG HI RAD. CRC Press. Taylor & Francis Group. Taylor & Francis Croup, Boca Raton London NewYoric

Experiment 6 SIMULINK

Experiment 8 SIMULINK

Modelling and Quantitative Methods in Fisheries

Privacy-Preserving. Introduction to. Data Publishing. Concepts and Techniques. Benjamin C. M. Fung, Ke Wang, Chapman & Hall/CRC. S.

Using MATLAB, SIMULINK and Control System Toolbox

MATLAB. Advanced Mathematics and Mechanics Applications Using. Third Edition. David Halpern University of Alabama CHAPMAN & HALL/CRC

Computer Arithmetic andveriloghdl Fundamentals

IMAGE ANALYSIS, CLASSIFICATION, and CHANGE DETECTION in REMOTE SENSING

Reproducible Research with R and RStudio

Support Vector. Machines. Algorithms, and Extensions. Optimization Based Theory, Naiyang Deng YingjieTian. Chunhua Zhang.

Mobile Robotics. Mathematics, Models, and Methods. HI Cambridge. Alonzo Kelly. Carnegie Mellon University UNIVERSITY PRESS

Session 3 Introduction to SIMULINK

CLASSIFICATION AND CHANGE DETECTION

Mobile Device Security

Data Clustering in C++

SOME ASSEMBLY REQUIRED

Computer Network. The Practical User Guide for. Simulation. Adarshpal S. Hnatyshin. Vasil Y. CRC Press. Taylor Si Francis Croup

Digital Design. Verilo. and. Fundamentals. fit HDL. Joseph Cavanagh. CRC Press Taylor & Francis Group Boca Raton London New York

Modelling and Simulation for Engineers

Managing Your Biological Data with Python

Computers as Components Principles of Embedded Computing System Design

Image Analysis, Classification and Change Detection in Remote Sensing

PTC Mathcad Prime 3.0

Programming Graphical

Introduction to Simulink. The Use of Mathematic Simulations in Electrical Engineering

Mastering Linux. Paul S. Wang. CRC Press. Taylor & Francis Group. Taylor & Francis Croup an informa business. A CHAPMAN St HALL BOOK

Introduction to Simulink

over The idea is to construct an algorithm to solve the IVP ODE (8.1)

@Taylor. Usability. Evaluation. for In-Vehicle Systems. Harvey. Catherine. Neville A.Stanton. CRC Press. Francis Group

Excel for Chemists. Second Edition

SIMULINK Tutorial. Select File-New-Model from the menu bar of this window. The following window should now appear.

Stochastic Simulation: Algorithms and Analysis

Experiment 3. Getting Start with Simulink

Rotary Motion Servo Plant: SRV02. Rotary Experiment #00: QuaRC Integration. Using SRV02 with QuaRC. Student Manual

PRACTICAL SPEECH USER INTERFACE DESIGN

Objectives. Simulink Basics

Graphics Shaders. Theory and Practice. Second Edition. Mike Bailey. Steve Cunningham. CRC Press. Taylor&FnincIs Croup tootutor London New York

Digital Signal Processing System Design: LabVIEW-Based Hybrid Programming Nasser Kehtarnavaz

Hands-On Introduction to. LabVIEW. for Scientists and Engineers. Second Edition. John Essick. Reed College OXFORD UNIVERSITY PRESS

Modeling Mechanical System using SIMULINK

CONSTITUTIVE MODELING OF GEOMATERIALS

ACOUSTIC MODELING UNDERWATER. and SIMULATION. Paul C. Etter. CRC Press. Taylor & Francis Croup. Taylor & Francis Croup, CRC Press is an imprint of the

Manifold Learning Theory and Applications

Essential MATLAB for Engineers and Scientists

COMPUTER NETWORK TIME SYNCHRONIZATION

Engineering Real- Time Applications with Wild Magic

LEARNING TO PROGRAM WITH MATLAB. Building GUI Tools. Wiley. University of Notre Dame. Craig S. Lent Department of Electrical Engineering

Mobile Robotics. Mathematics, Models, and Methods

Applied Combinatorics

Biosignal And Medical Image Processing Second Edition Signal Processing And Communications

Practical Linear Algebra

Contents Computing with Formulas

SIMULINK FOR BEGINNERS:

Mass-Spring Systems. Last Time?

Computer Animation. Algorithms and Techniques. z< MORGAN KAUFMANN PUBLISHERS. Rick Parent Ohio State University AN IMPRINT OF ELSEVIER SCIENCE

System Level Design. Technology. El Mostapha Aboulhamid Frederic Rousseau. Edited by. CRC Press. Taylor &. Francis Croup

Real-Time Windows Target

Data-Driven Modeling. Scientific Computation J. NATHAN KUTZ OXPORD. Methods for Complex Systems & Big Data

Lecture 10: Simulink. What is Simulink?

Contents. I Basics 1. Copyright by SIAM. Unauthorized reproduction of this article is prohibited.

over The idea is to construct an algorithm to solve the IVP ODE (9.1)

Simulation in Computer Graphics. Particles. Matthias Teschner. Computer Science Department University of Freiburg

Euler s Methods (a family of Runge- Ku9a methods)

Management. Port Security. Second Edition KENNETH CHRISTOPHER. CRC Press. Taylor & Francis Group. Taylor & Francis Group,

Summary of Contents LIST OF FIGURES LIST OF TABLES

TEACHING & EXAMINATION SCHEME For the Examination COMPUTER SCIENCE. B.Sc. Part-I

Let and be a differentiable function. Let Then be the level surface given by

Welcome to Microsoft Excel 2013 p. 1 Customizing the QAT p. 5 Customizing the Ribbon Control p. 6 The Worksheet p. 6 Excel 2013 Specifications and

Programming 8-bit PIC Microcontrollers in С

MECHATRONICS. William Bolton. Sixth Edition ELECTRONIC CONTROL SYSTEMS ENGINEERING IN MECHANICAL AND ELECTRICAL PEARSON

Analysis of Euler Angles in a Simple Two-Axis Gimbals Set

Math 225 Scientific Computing II Outline of Lectures

INTRODUCTION TO MATLAB, SIMULINK, AND THE COMMUNICATION TOOLBOX

Contents NUMBER. Resource Overview xv. Counting Forward and Backward; Counting. Principles; Count On and Count Back. How Many? 3 58.

Introduction to Simulink

Edge Detection Using Circular Sliding Window

PROBLEM SOLVING WITH FORTRAN 90

Modeling and Simulation in Scilab/Scicos with ScicosLab 4.4

Analysis of Incomplete Multivariate Data

2 SIMULATING A MODEL Simulink Tutorial

A Tutorial Introduction 1

Principles of Network Economics

APPLIED OPTIMIZATION WITH MATLAB PROGRAMMING

Introduction to Matlab Simulink. Control Systems

Strapdown inertial navigation technology

Kinematic Geometry. 1 Introduction

Optimum Array Processing

SIGNALS AND LINEAR SYSTEMS LABORATORY EELE

Adaptive System Identification and Signal Processing Algorithms

Strapdown Inertial Navigation Technology

Pythagorean - Hodograph Curves: Algebra and Geometry Inseparable

Example: Modeling a Cruise Control System in Simulink

Ordinary Differential Equations

Partial Differential Equations

Understanding the Concepts and Features of Macro Programming 1

Securing an IT. Governance, Risk. Management, and Audit

SIMULINK A Tutorial by Tom Nguyen

TABLE OF CONTENTS CHAPTER NO. TITLE PAGENO. LIST OF TABLES LIST OF FIGURES LIST OF ABRIVATION

Transcription:

INTRODUCTION TO the Simulation of Dynamics Using Simulink Michael A. Gray CRC Press Taylor & Francis Croup Boca Raton London New York CRC Press is an imprint of the Taylor & Francis Group an informa business A CHAPMAN & HALL BOOK

Table of Contents Preface, xv CHAPTER 1 Introduction and Motivation 1 1.1 SYSTEMS 2 1.1.1 Examples of Systems 3 1.1.2 Classifying Systems 4 1.2 DYNAMICAL MODELS OF PHYSICAL SYSTEMS 4 1.2.1 Discrete-Time Models 5 1.2.2 Continuous Models 5 1.3 CONSTRUCTING SIMULATIONS FROM DYNAMICAL MODELS 5 1.3.1 Block-Diagram Models 6 1.3.2 Block-Diagram Simulations 7 1.4 HOW SIMULATORS ARE USED 7 1.5 SUMMARY 8 REFERENCES AND ADDITIONAL READING 8 CHAPTER 2 The Basics of Simulation in Simulink 11 2.1 SIMPLEST MODEL TO SIMULATE 11 2.1.1 The Feedforward Block Diagram 13 2.2 MODELS IN SIMULINK 13 2.2.1 Documenting a Model 13 2.3 SIMULATION OF THE SIMPLEST MODEL 16 2.3.1 Output Blocks from the Sinks Library 16 vii

viii Table of Contents 2.3.1.1 The Scope Block 17 2.3.2 Input Blocks from the Sources Library 20 2.3.2.1 The Constant Block 22 2.3.3 Block Connections 23 2.3 A Running the Simulation 24 2.3.4.1 The Configuration Parameters 24 2.3.4.2 Observing the Simulation Output 24 2.3.4.3 Default Ranges and Autoscale 26 2.3.4.4 Making the Scope Output Printable 27 2.4 UNDERSTANDING HOW TIME IS HANDLED IN SIMULATION 27 2.5 A MODEL WITH TIME AS A VARIABLE 28 2.5.1 The Clock Block from the Sources Library 29 2.5.2 Processing Blocks from the Math Operations Library 31 2.5.2.1 The Product Block 31 2.5.2.2 The Add Block 32 2.6 HOW SIMULINK PROPAGATES VALUES IN BLOCK DIAGRAMS 35 2.7 A MODEL WITH UNIFORM CIRCULAR MOTION 38 2.7.1 The Sine Wave Block from the Sources Library 40 2.7.2 The Gain Block from the Math Operations Library 41 2.7.3 The XY Graph Block from the Sinks Library 44 2.8 A MODEL WITH SPIRALING CIRCULAR MOTION 44 2.8.1 The Math Function Block from the Math Operations Library 45 2.9 UNCERTAINTY IN NUMBERS AND SIGNIFICANT FIGURES 47 2.10 SUMMARY 52 REFERENCES AND ADDITIONAL READING 52

Table of Contents ix CHAPTER 3 Simulation of First-Order Difference Equation Models 55 3.1 WHAT IS A DIFFERENCE EQUATION? 56 3.1.1 Difference Equation Terminology 56 3.2 EXAMPLES OF SYSTEMS WITH DIFFERENCE EQUATION MODELS 57 3.3 FIRST-ORDER DIFFERENCE EQUATION SIMULATION 58 3.3.1 The Input and Output Ports of a Block 58 3.3.2 The Memory Block from the Discrete Library 61 3.3.3 The Feedback Block Diagram 62 3.3.4 The 1С Block from the Signal Attributes Library 63 3.3.5 Setting Initial Conditions with the Initial Conditions Field of the Memory Block 66 3.4 EXAMINING THE INTERNALS OF A SIMULATION 68 3.4.1 The Floating Scope Block from the Sinks Library 69 3.5 ORGANIZING THE INTERNAL STRUCTURE OF A SIMULATION 72 3.5.1 The Subsystem Block from the Ports and Subsystems Library 73 3.6 USING VECTOR AND MATRIX DATA 78 3.6.1 Vector and Matrix Constants 79 3.6.2 The Display Block from the Sinks Library 81 3.6.3 Colors for Displaying Scope Vector Input 83 3.7 SUMMARY 85 REFERENCES AND ADDITIONAL READING 86 CHAPTER 4 Simulation of First-Order Differential Equation Models 87 4.1 WHAT IS A DIFFERENTIAL EQUATION? 87 4.1.1 Differential Equation Terminology 88

x Table of Contents 4.2 EXAMPLES OF SYSTEMS WITH DIFFERENTIAL EQUATION MODELS 89 4.3 REWORKING FIRST-ORDER DIFFERENTIAL EQUATIONS INTO BLOCK FORM 92 4.4 FIRST-ORDER DIFFERENTIAL EQUATION SIMULATION 93 4.4.1 The Integrator Block from the Continuous Library 93 4.4.2 Specifying Initial Values for First-Order Differential Equation Simulations 94 4.5 SAVING SIMULATION DATA IN MATLAB 98 4.5.1 The To Workspace Block from the Sinks Library 99 4.5.2 Saving Simulation Data in a File 101 4.6 SUMMARY 103 REFERENCES AND ADDITIONAL READING 105 CHAPTER 5 Fixed-Step Solvers and Numerical Integration Methods 107 5.1 WHAT IS A SOLVER? 107 5.2 UNDERSTANDING THE BASICS OF NUMERICAL INTEGRATION ALGORITHMS 108 5.2.1 The Euler Method 109 5.2.2 Taylor's Theorem 110 5.2.3 A Graphical View of the Euler Method 113 5.3 UNDERSTANDING SOLVER ERRORS 115 5.4 IMPROVING THE BASIC ALGORITHMS 118 5.4.1 Runge-Kutta Methods 119 5.4.2 Corrector Methods 122 5.4.3 Multistep Methods 126 5.5 FIXED-STEP SOLVERS IN THE SIMULINK SOFTWARE 129 5.6 SUMMARY 131 REFERENCES AND ADDITIONAL READING 132

Table of Contents xi CHAPTER 6 Simulation of First-Order Equation Systems 133 6.1 WHAT IS A FIRST-ORDER DIFFERENCE EQUATION SYSTEM? 134 6.2 EXAMPLES OF FIRST-ORDER DIFFERENCE EQUATION SYSTEMS 134 6.3 SIMULATING A FIRST-ORDER DIFFERENCE EQUATION SYSTEM 135 6.3.1 The Two-Input Scope Block 135 6.3.2 Algebraic Loops 136 6.4 WHAT IS A FIRST-ORDER DIFFERENTIAL EQUATION SYSTEM? 143 6.5 EXAMPLES OF FIRST-ORDER DIFFERENTIAL EQUATION SYSTEMS 144 6.6 SIMULATING A FIRST-ORDER DIFFERENTIAL EQUATION SYSTEM 144 6.7 COMBINING CONNECTIONS ON A BUS 148 6.7.1 The Bus Creator Block from the Signals Routing Library 149 6.8 SUMMARY 152 REFERNCES AND ADDITIONAL READING 153 CHAPTER 7 Simulation of Second-Order Equation Models: Nonperiodic Dynamics 155 7.1 SIMULATION OF SECOND-ORDER DIFFERENCE EQUATION MODELS 155 7.1.1 Sequential Structure 156 7.1.2 Layered Structure 158 7.2 SIMULATION OF SECOND-ORDER DIFFERENTIAL EQUATION MODELS 160 7.2.1 Sequential Structure 162 7.2.2 Layered Structure 164 7.3 SECOND-ORDER DIFFERENTIAL EQUATION MODELS WITH FIRST-ORDER TERMS 168

xii Table of Contents 7.3.1 Viscosity Modeled by a Linear Function of Velocity 168 7.3.2 Viscosity Modeled by a Quadratic Function of Velocity 171 7.4 CONDITIONAL DYNAMICS 176 7.4.1 Object Moving at the Earth's Surface 176 7.4.1.1 The Switch Block from the Signal Routing Library 180 7.4.1.2 The Zero-Order Hold Block from the Discrete Library 182 7.4.1.3 The If Action Subsystem from the Ports & Subsystems Library 183 7.4.1.4 The If Block from the Ports & Signals Library 183 7.4.1.5 The Merge Block from the Signal Routing Library 183 7.5 SUMMARY 187 REFERENCES AND ADDITIONAL READING 187 CHAPTER 8 Simulation of Second-Order Equation Models: Periodic Dynamics 189 8.1 ORBITAL SYSTEMS 189 8.1.1 The Gravitational Attraction between Two Objects 189 8.1.2 The Earth-Sun System 190 8.1.3 Circular Orbits 192 8.1.4 The Earth-Satellite System 197 8.2 MASKED SUBSYSTEMS 200 8.2.1 A Simple Example 201 8.2.2 Parameterizing the Subsystem Components 202 8.2.3 Creating the Subsystem Mask 204 8.3 CREATING LIBRARIES 206 8.4 SUMMARY 212 REFERENCES 214

Table of Contents xiii CHAPTER 9 Higher-Order Models and Variable-Step Solvers 217 9.1 DIRECT SIMULATION BY MULTIPLE INTEGRATIONS 217 9.1.1 An Automobile Suspension Model 218 9.1.2 The Terminator Block from the Sinks Library 218 9.1.3 Transformation into a First-Order Equation System 221 9.2 PRODUCING FUNCTION FORMS FOR SIMULATION RESULTS 222 9.3 VARIABLE-STEP SOLVERS 225 9.3.1 Example Variable-Step-Size Algorithm 226 9.3.2 Example Variable-Step, Fourth-Order Runge- Kutta Solver 226 9.4 VARIABLE-STEP SOLVERS IN SIMUUNK 228 9.5 SUMMARY 228 REFERENCES AND ADDITIONAL READING 229 CHAPTER 10 Advanced Topics: Transforming Ordinary Differential Equations, Simulation of Chaotic Dynamics, and Simulation of Partial Differential Equations 231 10.1 TRANSFORMING ORDINARY DIFFERENTIAL EQUATIONS 231 10.1.1 The Laplace Transform 235 10.1.2 A Laplace Transform Example 237 10.1.3 Simulation by Nested Transforms 240 10.1.4 Simulation by Partitioned Transforms 243 10.1.5 The Transfer Fen Block from the Continuous Library 247 10.1.6 Examples of Transfer Function Simulation 247 10.1.6.1 Impulse-Driven Spring 247 10.1.6.2 Analog Signal Filter 250 10.1.6.3 Disk Drive Motion under Control 251

xiv Table of Contents 10.2 SIMULATION OF CHAOTIC DYNAMICS 253 10.2.1 Example of a Chaotic System the Lorenz Model 254 10.2.2 The Logistic Map 257 10.3 SIMULATION OF PARTIAL DIFFERENTIAL EQUATIONS 264 10.3.1 What Is a Partial Differential Equation? 264 10.3.2 Examples of Systems with Partial Differential Equation Models 265 10.3.3 Simulating Partial Differential Equation Models 267 10.3.4 The Embedded MATLAB Function Block from the User-Defined Functions Library 269 10.4 SUMMARY 276 REFERENCES AND ADDITIONAL READING 278 APPENDIX A: ALPHABETICAL LIST OF SIMULINK BLOCKS, 281 APPENDIX B: THE BASICS OF MATLAB FOR SIMULINK USERS, 283 B.1 THE MATLAB MAIN WINDOW B.2 THE DEFAULT FOLDER IN MATLAB B.3 LAUNCHING SIMULINK FROM MATLAB B.4 SIMULINK MODEL FILES IN MATLAB REFERENCES AND ADDITIONAL READING APPENDIX C: DEBUGGING A SIMULINK MODEL, 289 C.1 STARTING THE DEBUGGER C.2 RUNNING THE MODEL IN STEP MODE C.3 RUNNING THE MODEL IN TRACE MODE ADDITIONAL READING 283 284 285 285 288 289 291 299 300 INDEX, 301