Note 10. Modeling and Simulation of Dynamic Systems

Similar documents
Transfer Functions. Convenient representation of a linear, dynamic model. A transfer function (TF) relates one input and one output: ( ) system

Numerical Heat and Mass Transfer

NUMERICAL DIFFERENTIATION

Module 3 LOSSY IMAGE COMPRESSION SYSTEMS. Version 2 ECE IIT, Kharagpur

Numerical Solution of Ordinary Differential Equations

EEE 241: Linear Systems

NON-CENTRAL 7-POINT FORMULA IN THE METHOD OF LINES FOR PARABOLIC AND BURGERS' EQUATIONS

CHAPTER 5 NUMERICAL EVALUATION OF DYNAMIC RESPONSE

Appendix B. The Finite Difference Scheme

A Hybrid Variational Iteration Method for Blasius Equation

Difference Equations

Lecture 12: Discrete Laplacian

Problem Set 9 Solutions

For now, let us focus on a specific model of neurons. These are simplified from reality but can achieve remarkable results.

Chapter 13: Multiple Regression

Chapter 5. Solution of System of Linear Equations. Module No. 6. Solution of Inconsistent and Ill Conditioned Systems

Irregular vibrations in multi-mass discrete-continuous systems torsionally deformed

6.3.4 Modified Euler s method of integration

Introduction. - The Second Lyapunov Method. - The First Lyapunov Method

Introduction to Vapor/Liquid Equilibrium, part 2. Raoult s Law:

( ) = ( ) + ( 0) ) ( )

Chapter 9: Statistical Inference and the Relationship between Two Variables

Lecture 21: Numerical methods for pricing American type derivatives

Finite Element Modelling of truss/cable structures

Chapter 3 Differentiation and Integration

Inductance Calculation for Conductors of Arbitrary Shape

Structure and Drive Paul A. Jensen Copyright July 20, 2003

Module 2. Random Processes. Version 2 ECE IIT, Kharagpur

Boise State University Department of Electrical and Computer Engineering ECE 212L Circuit Analysis and Design Lab

FTCS Solution to the Heat Equation

Global Sensitivity. Tuesday 20 th February, 2018

Comparison of Regression Lines

High resolution entropy stable scheme for shallow water equations

The Finite Element Method

Grover s Algorithm + Quantum Zeno Effect + Vaidman

Lectures - Week 4 Matrix norms, Conditioning, Vector Spaces, Linear Independence, Spanning sets and Basis, Null space and Range of a Matrix

Least squares cubic splines without B-splines S.K. Lucas

LOW BIAS INTEGRATED PATH ESTIMATORS. James M. Calvin

The Study of Teaching-learning-based Optimization Algorithm

12. The Hamilton-Jacobi Equation Michael Fowler

Linear Regression Analysis: Terminology and Notation

ME 501A Seminar in Engineering Analysis Page 1

Correlation and Regression. Correlation 9.1. Correlation. Chapter 9

Week3, Chapter 4. Position and Displacement. Motion in Two Dimensions. Instantaneous Velocity. Average Velocity

Suppose that there s a measured wndow of data fff k () ; :::; ff k g of a sze w, measured dscretely wth varable dscretzaton step. It s convenent to pl

A new Approach for Solving Linear Ordinary Differential Equations

Kernel Methods and SVMs Extension

829. An adaptive method for inertia force identification in cantilever under moving mass

Resource Allocation and Decision Analysis (ECON 8010) Spring 2014 Foundations of Regression Analysis

Digital Signal Processing

Integrals and Invariants of Euler-Lagrange Equations

Application of B-Spline to Numerical Solution of a System of Singularly Perturbed Problems

Parametric fractional imputation for missing data analysis. Jae Kwang Kim Survey Working Group Seminar March 29, 2010

Physics 5153 Classical Mechanics. D Alembert s Principle and The Lagrangian-1

Parameter Estimation for Dynamic System using Unscented Kalman filter

CSci 6974 and ECSE 6966 Math. Tech. for Vision, Graphics and Robotics Lecture 21, April 17, 2006 Estimating A Plane Homography

Design and Optimization of Fuzzy Controller for Inverse Pendulum System Using Genetic Algorithm

A Robust Method for Calculating the Correlation Coefficient

Consistency & Convergence

Chapter Newton s Method

CinChE Problem-Solving Strategy Chapter 4 Development of a Mathematical Model. formulation. procedure

Chapter 12. Ordinary Differential Equation Boundary Value (BV) Problems

One-sided finite-difference approximations suitable for use with Richardson extrapolation

Physics 5153 Classical Mechanics. Principle of Virtual Work-1

Linear Approximation with Regularization and Moving Least Squares

Normally, in one phase reservoir simulation we would deal with one of the following fluid systems:

Polynomial Regression Models

Lecture 6: Introduction to Linear Regression

Lecture 3 Stat102, Spring 2007

The equation of motion of a dynamical system is given by a set of differential equations. That is (1)

3.1 Expectation of Functions of Several Random Variables. )' be a k-dimensional discrete or continuous random vector, with joint PMF p (, E X E X1 E X

The Multiple Classical Linear Regression Model (CLRM): Specification and Assumptions. 1. Introduction

Lecture Notes on Linear Regression

Boise State University Department of Electrical and Computer Engineering ECE 212L Circuit Analysis and Design Lab

Foundations of Arithmetic

The Expectation-Maximization Algorithm

18.1 Introduction and Recap

Psychology 282 Lecture #24 Outline Regression Diagnostics: Outliers

Negative Binomial Regression

APPENDIX 2 FITTING A STRAIGHT LINE TO OBSERVATIONS

1 Derivation of Rate Equations from Single-Cell Conductance (Hodgkin-Huxley-like) Equations

n α j x j = 0 j=1 has a nontrivial solution. Here A is the n k matrix whose jth column is the vector for all t j=0

A PROCEDURE FOR SIMULATING THE NONLINEAR CONDUCTION HEAT TRANSFER IN A BODY WITH TEMPERATURE DEPENDENT THERMAL CONDUCTIVITY.

Energy Storage Elements: Capacitors and Inductors

), it produces a response (output function g (x)

Markov Chain Monte Carlo (MCMC), Gibbs Sampling, Metropolis Algorithms, and Simulated Annealing Bioinformatics Course Supplement

Joint Statistical Meetings - Biopharmaceutical Section

Simulated Power of the Discrete Cramér-von Mises Goodness-of-Fit Tests

STAT 3008 Applied Regression Analysis

DUE: WEDS FEB 21ST 2018

This column is a continuation of our previous column

Econ107 Applied Econometrics Topic 3: Classical Model (Studenmund, Chapter 4)

Tracking with Kalman Filter

4DVAR, according to the name, is a four-dimensional variational method.

9 Derivation of Rate Equations from Single-Cell Conductance (Hodgkin-Huxley-like) Equations

DETERMINATION OF TEMPERATURE DISTRIBUTION FOR ANNULAR FINS WITH TEMPERATURE DEPENDENT THERMAL CONDUCTIVITY BY HPM

6.3.7 Example with Runga Kutta 4 th order method

Gaussian Mixture Models

Modelli Clamfim Equazione del Calore Lezione ottobre 2014

DO NOT DO HOMEWORK UNTIL IT IS ASSIGNED. THE ASSIGNMENTS MAY CHANGE UNTIL ANNOUNCED.

Transcription:

Lecture Notes of ME 475: Introducton to Mechatroncs Note 0 Modelng and Smulaton of Dynamc Systems Department of Mechancal Engneerng, Unversty Of Saskatchewan, 57 Campus Drve, Saskatoon, SK S7N 5A9, Canada

Lecture Notes of ME 475: Introducton to Mechatroncs. Modelng of Dynamc System A model of a system can be physcal or mathematcal. The model accuracy needed (closeness to the actual system) depends on the purpose. Generally, a smplfed model s needed to study the man characterstcs of the system. A detaled model s needed for accurate smulaton and predcton studes. In ths class, modelng refers to the mathematcal model of a system. The mathematcal model of a dynamc system s generally n the form of dfferental equatons. Therefore, modelng of dynamc system refers to the use of the physcal laws to set up dfferental equatons for a gven dynamc system. Once we have the model of the system, we are nterested n studyng ts behavor. The behavor of a dynamc system n tme s descrbed by the soluton of ts dfferental equatons. There two dfferent purposes for modelng of a physcal system. Develop a mathematcal model n order to predct the dynamc behavor of the system as accurately as possble, usng numercal methods. Such a model serves as a tool for extensve evaluaton of system behavor wthout actually usng or buldng the actual system. Develop model to gan nsght nto the dynamc behavor qualtatvely nstead of exact response predcton,.e., knowledge of stablty margn, controllablty and observablty of states, and senstvty of response to parameter changes. Such models do not contan all the detal of an actual system, but only the most essental features so as to provde good nsght from an engneerng standpont. Therefore, we may develop smplfed lnear models for controller desgn and analyss purposes, and use more detaled, possbly nonlnear, models n testng and predctng the dynamc system response as accurately as possble. For nstance, consder the robotc manpulator schematcally shown n Fgure. The dynamc model s a set of dfferental equatons whch descrbe the relatonshp between the appled torques at the jonts and moton of the jont angles n tme. The set of nonlnear dfferental equatons can be used to predct the behavor of the robotc manpulator under varous ntal condtons and jont torque nputs. Fgure : Robotc manpulator model Qute often, the dynamcs models of physcal systems are nonlnear. Most control system desgn methods and analytcal methods are applcable only to lnear systems. Therefore, for the sake of beng able to analyze varous controller alternatves, we need to obtan approxmate lnearzed modes from the nonlnear models. Department of Mechancal Engneerng, Unversty Of Saskatchewan, 57 Campus Drve, Saskatoon, SK S7N 5A9, Canada

Lecture Notes of ME 475: Introducton to Mechatroncs. Dfferental Equatons. Bascs of Dfferental Equatons Contnuous tme dynamc systems are descrbed by dfferental equatons. A dfferental equaton s an equaton nvolvng dervatves of dependent varables wth respect to ndependent varables, for example, dy( + ay( u( dt where t s an ndependent varable, y s a dependent varable (e.g. the system outpu, and u s another dependent varable (e.g., the system npu. If there s only one ndependent varable, then the dfferental equaton s called an ordnary dfferental equaton (ODE). If there are two or more ndependent varables, then t s called a partal dfferental equaton (PDE). The hghest dervatve n the equaton s the order of the equaton. Soluton of an nthorder dfferental equaton contans n-arbtrary constants. These constants are determned by n-condtons on dependent varable (.e., the ntal condtons). Nonlneartes and Lnearzaton If the dependent varables or ther dervatves appear n nonlnear functons n the equatons, then the dfferental equaton s nonlnear; otherwse t s lnear. For example, the followng equaton s nonlnear dy ( dy( + dt dt + ay( u( A system s called a lnear dynamc system f ts dynamcs s descrbed by lnear dfferental equaton(s). A lnear system possesses two propertes: superposton and Homogenety. The property of superposton means the output response of a system to the sum of nputs s the sum of the responses to the ndvdual nputs. Thus, f an nput of r ( yelds an output of c ( and an nput of r ( yelds an output of c (, then an nput of r (+r ( wll yeld an output of c (+c (. The property of homogenety descrbes the response of the system to a multplcaton of the nput by a scalar. Specfcally, n a lnear system, the property of homogenety s demonstrated f for an nput of r( that yelds an output of c(, an nput of Kr( wll yeld an output of Kc(. In other words, the multplcaton of an nput by a scalar (.e., K) yelds a response that s multpled by the same scalar. Qute Often, a desgner needs to make a lnear approxmaton to a nonlnear system. Lnear approxmatons smplfy the analyss and desgn of a system and are used as long Department of Mechancal Engneerng, Unversty Of Saskatchewan, 57 Campus Drve, Saskatoon, SK S7N 5A9, Canada 3

Lecture Notes of ME 475: Introducton to Mechatroncs as the results yeld a good approxmaton to realty. For example, f a system conssts of nonlnear components, we must lnearze the system before we can fnd ts transfer functon. Now, let s see how to lnearze a nonlnear system n order to obtan ts transfer functon. The frst step s to wrte the nonlnear dfferental equaton and lnearze t. When we lnearze a nonlnear dfferental equaton, we lnearze t for small changes n the nput about the operatng pont A, as shown n Fgure, where the system nput and the output are x 0 and f(x 0 ), respectvely. Small changes n the nput can be related to changes n the output about the pont by way of the slope of the curve at the pont A. Thus, f the slope of the curve at pnt A s m a, then small excursons of the nput about pnt A, δx, yeld small changes n the output, δf(x), related the slope at pont A. Thus, where δ f ( x) f ( x) f ( x0 ) ma ( x x0 ) m a df ( x) dx x x 0 Fgure : Lnearzaton about the operatng pont A. Once we have the lnearzed dfferental equaton, next we take the Laplace transform of the equaton(s), assumng zero ntal condtons. Fnally, we separate nput and output varables and form the transfer functon. Example (a) Wrte the dfferental equaton for the smple pendulum shown n the followng fgure, where all the mass s concentrated at the endpont. (b) Lnearze the system about the operatng pont of θ 0 and then fnd ts transfer functon. (c) Use SIMULINK to determne the tme response of θ to a step nput T c of N m. Assume l m, m 0.5 kg, and g 9.8 m/s. Department of Mechancal Engneerng, Unversty Of Saskatchewan, 57 Campus Drve, Saskatoon, SK S7N 5A9, Canada 4

Lecture Notes of ME 475: Introducton to Mechatroncs Example Fnd the transfer functon, V L (s)/ V(s), for the electrcal network shown n the followng fgure, whch contans a nonlnear resstor whose voltage-current relatonshp s defned 0.vr by r e, where r and v r are the resstor current and voltage, respectvely. Also, t s know that v( s a small-sgnal source. Use SIMULINK to determne the tme response of v L ( to a step nput v( of 0. V. Department of Mechancal Engneerng, Unversty Of Saskatchewan, 57 Campus Drve, Saskatoon, SK S7N 5A9, Canada 5

Lecture Notes of ME 475: Introducton to Mechatroncs 3. Numercal Smulaton of Nonlnear Dynamc Systems The behavor of a dynamc system n the tme doman can be predcted by the soluton of ts mathematcal model, whch typcally s a set of ordnary dfferental equatons (ODEs). Analytcal soluton of ODEs s avalable for only lnear ODEs and very smple nonlnear ODEs. Therefore, tme doman response of any dynamc system model wth reasonable complexty must be solved usng numercal methods. The prmary tool s the numercal ntegraton of ODEs n the tme doman. Numercal ntegraton s performed by dscretzng ODEs usng varous approxmatons to dfferentaton. 3. Bascs for Solvng a Frst-Order ODE Gven that a dynamc system s descrbe by the followng frst-order ODE y & f ( y, u) The task at hand s to solve for y( gven the ntal condton y ( t0) y0 and the nput u(. The fundamental dea behnd numercal ntegraton s llustrated n Fgure 3, n whch where + y& dt t t + + y ( t ) y( t ) y& dt + t t can be obtaned by usng varous approxmatons, such as the Euler s and Runge-Kutta methods ntroduced n the followng. y& y& y& t 0 y& dτ Fgure 3: Graphcal nterpretaton of numercal ntegraton for solvng a frst-order ODE. Department of Mechancal Engneerng, Unversty Of Saskatchewan, 57 Campus Drve, Saskatoon, SK S7N 5A9, Canada 6

Lecture Notes of ME 475: Introducton to Mechatroncs 3. Euler s Method and Runge-Kutta Methods Euler s method s based on the defnton of a dervatve,.e., dy dt lm Δt 0 Δy Δt Let us examne the dfferental equaton for two values of tme, t and t +, where Δt s suffcently close to zero that the above equaton s approxmated by y y Δt + f ( y, u ) whch can be rewrtten as y y + Δtf ( y, u ) + Repeated evaluaton of the above equaton leads to the numercal soluton. As the ntal pont, y y0 and, for subsequent values of the ndex +, y + takes on the value from the prevous calculaton of y. Any arbtrary tme hstory of the nput u can be used: steps, ramps, snusods, random sequences, or stock market ndces. As the step sze Δt decreases, the accuracy of the method mproves and the requred computaton tme ncreases. Fgure 3 suggests that a more accurate formula s to use the average of the values of the dervatve at t and t +. Because ths s essentally a straght lne approxmaton to the y& curve between t and t +, t s called the trapezodal rule. Unfortunately, t s mpossble to mplement for numercal ntegraton of nonlnear system because the dervatve at t + depends on y(t + ), whch s not known yet. Many dfferent numercal ntegraton schemes have been developed to approxmate the area under the curve; and they are all teratve because the dervatve at the endpont s not ntally known. Runge-Kutta methods comprse one popular set of ntegraton schemes. The secondorder Runge-Kutta method obtans an approxmate value of the endpont usng the Euler method, estmates the dervatve at the endpont usng the approxmate y +, and then arrves at the fnal value for y + usng an average of the two dervatves: k k y f ( y, u ) + f ( y + k Δt, u Δt y + ( k + + k ) ) Department of Mechancal Engneerng, Unversty Of Saskatchewan, 57 Campus Drve, Saskatoon, SK S7N 5A9, Canada 7

Lecture Notes of ME 475: Introducton to Mechatroncs Thrd- and hgher-order Runge-Kutta methods use ths same basc dea; they dffer from the second-order formula by usng estmates of dervatves at md-ponts as well as endponts and ncludng them n a weghted average to arrve at the fnal estmate of y +. Most computer-aded control system desgn software ncludes some form of numercal ntegraton capablty such as Runge-Kutta method and most wll nclude some sort of automatc step sze determnaton. Any method wll be become more accurate as the step sze decrease: however, ntally, nether the computer algorthms nor the user knows what step sze s the best compromse between accuracy and speed. A commonly used scheme s to ntegrate usng two dfferent methods (perhaps a second- and thrd-order Rung-Kutta formula), compare the dfference, and then cut the step sze n half f the error exceeds a certan tolerance. The step sze wll contnue to be cut n half untl the error tolerance s met. 3.3 Smulaton of Nonlnear Dynamc Systems Usng SIMULINK In SIMULINK, we use a block, called Integrator, for contnuous-tme ntegraton of ts nput sgnal,.e., S out Δt 0 S n dt, where Δt s the step sze (specfed n the Solver optons n SIMULINK). The ntal condton of ntegraton can be specfed va the Functon Block Parameters wndow of the block. S n S out s Fgure 4: Integrator n SIMULINK. Suppose a dynamc system s descrbe by the followng n-order ODE y ( n) f ( y ( n ), y ( n ), L, y, u) wth ntal condtons: ( n ) ( n ) y ( t0) y0, ( n ) ( n ) y ( t0) y0,, ( t y0 y 0). The general process to solve the above ODE by means of SIMULINK s dscussed n class. Department of Mechancal Engneerng, Unversty Of Saskatchewan, 57 Campus Drve, Saskatoon, SK S7N 5A9, Canada 8

Lecture Notes of ME 475: Introducton to Mechatroncs Example 3 Use SIMULINK to determne the tme response of θ to a step nput of N m of the pendulum n Example based on the nonlnear dfferental equaton obtaned; and then compare t to the result from the transfer functon after lnearzaton. Example 4 Consder the lqud level n a tank and ts control system shown n the followng fgure. The purpose of control s to mantan the lqud heght n the tank at a constant level. Let us consder a computer-controlled verson of the system: the mechansm for manpulatng the nflow rate to the tank s controlled by a level sensor, a dgtal controller, and a valve. The dgtal controller s an ON/OFF type one wth hysteress: the controller ether fully turns ON or OFF the value, dependng the error sgnal to the controller; and the hysteress s added to the controller n order to make sure the controller does not swtch the valve ON/OFF at hgh frequency due to small change n the lqud level. Ths type of controller s called relay wth hysteress. The nflow rate s proportonal to the valve openng. Manpulated by the aforementoned ON/OFF controller, the flow rate has the value of ether zero or maxmum. The outflow rate s proportonal to the lqud level n the tank by multplyng a constant of /R. Smulate the system for the followng condtons: () the hysteress band of the controller s [-0.05, 0.05], () the maxmum nflow rate s 0.0 m 3 /s, (3) R has a value of 500 m/( m 3 /s), and (4) the cross-secton area of the tank s 0.0 m. Department of Mechancal Engneerng, Unversty Of Saskatchewan, 57 Campus Drve, Saskatoon, SK S7N 5A9, Canada 9