Chapter 7 Differential Equation Problems

Slides:



Advertisements
Similar presentations
Lect.3 Modeling in The Time Domain Basil Hamed
Advertisements

Lecture 3: Signals & Systems Concepts
Differential Equations Math Review with Matlab: Finding Solutions to Differential Equations S. Awad, Ph.D. M. Corless, M.S.E.E. D. Cinpinski E.C.E. Department.
ECE 8443 – Pattern Recognition ECE 3163 – Signals and Systems Objectives: Review Resources: Wiki: State Variables YMZ: State Variable Technique Wiki: Controllability.
Ch 7.9: Nonhomogeneous Linear Systems
Laplace Transforms Important analytical method for solving linear ordinary differential equations. - Application to nonlinear ODEs? Must linearize first.
SIMULINK Dr. Samir Al-Amer. SIMULINK SIMULINK is a power simulation program that comes with MATLAB Used to simulate wide range of dynamical systems To.
Ordinary Differential Equations S.-Y. Leu Sept. 21,28, 2005.
Partial differential equations Function depends on two or more independent variables This is a very simple one - there are many more complicated ones.
Ordinary Differential Equations (ODEs)
Differential Equations and Boundary Value Problems
Lecture 24 Introduction to state variable modeling Overall idea Example Simulating system response using MATLAB Related educational modules: –Section 2.6.1,
EPSII 59:006 Spring Topics Using TextPad If Statements Relational Operators Nested If Statements Else and Elseif Clauses Logical Functions For Loops.
Lecture 35 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
Autumn 2008 EEE8013 Revision lecture 1 Ordinary Differential Equations.
Sistem Kontrol I Kuliah II : Transformasi Laplace Imron Rosyadi, ST 1.
ME451 Kinematics and Dynamics of Machine Systems Numerical Solution of DAE IVP Newmark Method November 1, 2013 Radu Serban University of Wisconsin-Madison.
Ordinary Differential Equations
Prepared by Mrs. Azduwin Binti Khasri
Solution of a Partial Differential Equations using the Method of Lines
Motivation Thus far we have dealt primarily with the input/output characteristics of linear systems. State variable, or state space, representations describe.
EE3417 – Introduction to Simulink
Recap Cubic Spline Interpolation Multidimensional Interpolation Curve Fitting Linear Regression Polynomial Regression The Polyval Function The Interactive.
INTRODUCTION TO SIMULINK by Yasmin Hanum Md Thayoob & Aidil Azwin Zainul Abidin.
Math 3120 Differential Equations with Boundary Value Problems
ERT 210/4 Process Control & Dynamics DYNAMIC BEHAVIOR OF PROCESSES :
Lecture 39 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
1 Spring 2003 Prof. Tim Warburton MA557/MA578/CS557 Lecture 32.
Math for CS Fourier Transforms
DYNAMIC BEHAVIOR OF PROCESSES :
Getting started with Simulink An introductory tutorial.
Boyce/DiPrima 10th ed, Ch 7.9: Nonhomogeneous Linear Systems Elementary Differential Equations and Boundary Value Problems, 10th edition, by William E.
Transfer Functions Convenient representation of a linear, dynamic model. A transfer function (TF) relates one input and one output: The following terminology.
Chapter 12 Design via State Space <<<4.1>>>
Modeling and Simulation Dr. Mohammad Kilani
Laplace Transforms Chapter 3 Standard notation in dynamics and control
State Space Representation
Transfer Functions Chapter 4
Boundary Element Analysis of Systems Using Interval Methods
Digital Control Systems (DCS)
Mathematical Modeling of Control Systems
Systems of Ordinary Differential Equations Case I: real eigenvalues of multiplicity 1 MAT 275.
Advanced Numerical Methods (S. A. Sahu) Code: AMC 51151
Introduction Mathcad is a product of mathSoft inc. The Mathcad can help us to calculate, graph, and communicate technical ideas. It lets us work with.
Mechanical Engineering at Virginia Tech
Systems of First Order Linear Equations
525602:Advanced Numerical Methods for ME
Chapter 6 Nonlinear Equations and Optimization Problems
Chapter 5 Integral Transforms and Complex Variable Functions
Chapter 10: Solving Linear Systems of Equations
Class Notes 18: Numerical Methods (1/2)
Autonomous Cyber-Physical Systems: Dynamical Systems
Chapter 4 Linear Algebra Problems
Digital Control Systems (DCS)
Digital Control Systems (DCS)
Chapter 27.
Ch 5.2: Series Solutions Near an Ordinary Point, Part I
Getting Started With Simulink
State Space Analysis UNIT-V.
Boundary-value problems and Finite-difference equations
Digital and Non-Linear Control
Homework 9 Refer to the last example.
Numerical Analysis Lecture 37.
Equivalent State Equations
Linearization of Nonlinear Models
Numerical Analysis Lecture 38.
Solution of ODEs by Laplace Transforms
Chapter 3 Modeling in the Time Domain
Laplace Transforms Important analytical method for solving linear ordinary differential equations. - Application to nonlinear ODEs? Must linearize first.
Laplace Transforms Important analytical method for solving linear ordinary differential equations. - Application to nonlinear ODEs? Must linearize first.
Presentation transcript:

Chapter 7 Differential Equation Problems Solving Applied Mathematical Problems with MATLAB CRC/Taylor & Francis Press Chinese version by Tsinghua University Press PPT by Wenbin Dong and Jun Peng, Northeastern University, PRC Proofread by Dingyu Xue & YangQuan Chen 星期四, 2008-4- 24, 22:08:34 Slide 1 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Chapter 7 MATLAB Solutions to Differential Equation Problems Analytical Solutions of Differential Equations Numerical Solutions to Ordinary Differential Equations Numerical Solutions to Special Ordinary Differential Equations Solving Boundary Value Problems Introduction to Partial Differential Equations Solving Ordinary Differential Equations using Simulink Blocks 星期四, 2008-4- 24, 22:08:34 Slide 2 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.1 Analytical Solutions of Differential Equations Mathematical descriptions Analytical solution methods Applications of Laplace transforms Analytical solutions to linear state-space equations Analytical solutions to special nonlinear differential equations 星期四, 2008-4- 24, 22:08:34 Slide 3 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.1.1 Mathematical descriptions A general description of linear ordinary differential equations with constant coefficients: where are constants. 星期四, 2008-4- 24, 22:08:34 Slide 4 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

For zero initial value problems, Correspondingly, the Laplace transform is: If the characteristic roots si are distinct roots, the analytical solutions become: where Ci are constants to be determined and g(t) is the special solution with respect to the input u(t) . 星期四, 2008-4- 24, 22:08:34 Slide 5 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.1.2 Analytical solution methods Simple form, where the independent variable is assume to be t With independent variable of x 星期四, 2008-4- 24, 22:08:34 Slide 6 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-1 Assume that the input signal is defined by find the general solution to the ODE 星期四, 2008-4- 24, 22:08:34 Slide 7 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Assume that the following conditions are given Results Assume that the following conditions are given 星期四, 2008-4- 24, 22:08:34 Slide 8 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

星期四, 2008-4- 24, 22:08:34 Slide 9 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

the analytically solution to the equation can be obtained Let the analytically solution to the equation can be obtained 星期四, 2008-4- 24, 22:08:34 Slide 10 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

The final solution is given by 星期四, 2008-4- 24, 22:08:34 Slide 11 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-2 For input signal , solve with 星期四, 2008-4- 24, 22:08:34 星期四, 2008-4- 24, 22:08:34 Slide 12 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Results 星期四, 2008-4- 24, 22:08:34 Slide 13 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-3 Find the analytical solution to the differential equation sets Direct solution 星期四, 2008-4- 24, 22:08:34 Slide 14 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.1.3 Applications of Laplace Transforms Transfer function: 星期四, 2008-4- 24, 22:08:34 Slide 15 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

If U(s) is given as a rational function Then, the output signal can be expressed, after rearrangement of terms, by the following s-domain function With If U(s) is given as a rational function 星期四, 2008-4- 24, 22:08:34 Slide 16 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-4 Given the input signal u(t)=e-5tcos(2t+1)+5 , assuming all zero initial conditions, solve analytically the differential equation 星期四, 2008-4- 24, 22:08:34 Slide 17 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

step 1: step 2: 星期四, 2008-4- 24, 22:08:34 Slide 18 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Analytical output signal in time domain: 星期四, 2008-4- 24, 22:08:34 Slide 19 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Using dsolve() function call Step1: Step2: 星期四, 2008-4- 24, 22:08:34 Slide 20 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

The analytical solution is the same Step3 The analytical solution is the same 星期四, 2008-4- 24, 22:08:34 Slide 21 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.1.4 Analytical solutions to linear state-space equations Assume that the linear state-space model of a given system is where A,B,C,D are constant matrices, The analytical solutions for such an equation is 星期四, 2008-4- 24, 22:08:34 Slide 22 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-5 For the input signal u(t) = 2 + 2e-3t sin 2t, find the analytical solutions to the system given by 星期四, 2008-4- 24, 22:08:34 Slide 23 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Solution by direct integration 星期四, 2008-4- 24, 22:08:34 Slide 24 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.1.5 Analytical solutions to special nonlinear differential equations Very few nonlinear differential equations can be analytically solved by dsolve() function An example for the analytical solution to a special nonlinear differential equation is demonstrated. Other examples which cannot be solved are also demonstrated. 星期四, 2008-4- 24, 22:08:34 Slide 25 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-6 Solve nonlinear differential equation Change the form of the original ODE: 星期四, 2008-4- 24, 22:08:34 Slide 26 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-7 Try to find the analytical solutions to the well-known Van der Pol equation. The following command tested 星期四, 2008-4- 24, 22:08:34 Slide 27 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.2 Numerical Solutions to Ordinary Differential Equations Overview of numerical solution algorithms Fixed-step Runge-Kutta algorithm and its MATLAB implementations Numerical solution to first-order differential equation sets Transforms to standard ordinary differential equations Validation of numerical solutions to ODEs 星期四, 2008-4- 24, 22:08:34 Slide 28 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.2.1 Overview of numerical solution algorithms Explicit first-order differential equation Standard form where State vector Nonlinear functions 星期四, 2008-4- 24, 22:08:34 Slide 29 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.2.1.1 Numerical error and step-size problem Euler algorithm: Consider IVP. Given x(t0), the initial state vector at time instant . The derivative in the left hand can be approximated by a simple Euler formula The solution can be approximated by 星期四, 2008-4- 24, 22:08:34 Slide 30 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

At time instant , the state vector is denoted by So, suppose at any time instant tk ,the state vector is xk then, at the , Euler algorithm is given by h is called the step size. 星期四, 2008-4- 24, 22:08:34 Slide 31 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Two reasons that we cannot reduce the step size h unlimitedly: Slow down in computation Increase the cumulative errors Three considerations in numerically solving ODEs: Suitable step-size selection Improved algorithms Variable-step-size algorithms 星期四, 2008-4- 24, 22:08:34 Slide 32 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.2.2 Fixed-step Runge-Kutta algorithm and its MATLAB implementations The fourth-order fixed step size Runge-Kutta algorithm: 星期四, 2008-4- 24, 22:08:34 Slide 33 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

The state vector for the next step: where h is the step size The state vector for the next step: MATLAB syntax Loop structure can be used in the function See next slide the MATLAB implementations 星期四, 2008-4- 24, 22:08:34 Slide 34 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

星期四, 2008-4- 24, 22:08:34 Slide 35 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.2.3 Numerical solution to first-order differential equation sets Runge-Kutta-Felhberg algorithm The current step is hk. Define 6 variables ki: State vector for the next step: 星期四, 2008-4- 24, 22:08:34 Slide 36 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

MATLAB functions for solving ordinary differential equations Define an error vector: MATLAB functions for solving ordinary differential equations 星期四, 2008-4- 24, 22:08:34 Slide 37 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Prepare the ODE's right hand side function (RHSF) under study as: Modify the option parameters: 星期四, 2008-4- 24, 22:08:34 Slide 38 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Solution Procedures Write mathematically the equation Write MATLAB code for the equation M-function Anonymous function Inline function, not recommended Solve equation Draw results Verification of results 星期四, 2008-4- 24, 22:08:34 Slide 39 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-8 Solve the following Lorenz model parameters The initial values are 星期四, 2008-4- 24, 22:08:34 Slide 40 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Describing the equation M-function Anonymous function Inline function (not recommended) 星期四, 2008-4- 24, 22:08:34 Slide 41 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

MATLAB command for solutions Phase space trajectory 星期四, 2008-4- 24, 22:08:34 Slide 42 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Solving ODEs in MATLAB with additional arguments Why to introduce additional arguments In the previous example, if parameters changes, no need to modify function additional arguments can be used New function format New calling command 星期四, 2008-4- 24, 22:08:34 Slide 43 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-9 Prepare a MATLAB function with parameters for Lorenz equation. Then use the new function to find the numerical solutions for another set of parameters with additional parameters 星期四, 2008-4- 24, 22:08:34 Slide 44 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Solution procedure in MATLAB Phase space trajectory 星期四, 2008-4- 24, 22:08:34 Slide 45 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Choose new parameters New calling command 星期四, 2008-4- 24, 22:08:34 星期四, 2008-4- 24, 22:08:34 Slide 46 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.2.4 Transforms to standard ordinary differential equations Manipulating a single high-order ODE General high order ODE: with zero initial conditions select a set of state variables as 星期四, 2008-4- 24, 22:08:34 Slide 47 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Then, the original high order ODE can be written as a set of first order ODEs: with initial values 星期四, 2008-4- 24, 22:08:34 Slide 48 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-10 Van der Pol equation With initial Selecting states New ODE MATLAB code 星期四, 2008-4- 24, 22:08:34 Slide 49 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

MATLAB solutions A counter-example 星期四, 2008-4- 24, 22:08:34 星期四, 2008-4- 24, 22:08:34 Slide 50 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

A counter-example For the following parameters Suggestions: DO NOT RUN the following Stiff equation algorithms should be used 星期四, 2008-4- 24, 22:08:34 Slide 51 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Manipulating multiple high-order ODEs State choosing method is not unique Suggestions: choose the state variables: 星期四, 2008-4- 24, 22:08:34 Slide 52 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

The new state equation is then 星期四, 2008-4- 24, 22:08:34 Slide 53 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-11 Apollo satellite trajectory (x, y) is governed by where and Initial states 星期四, 2008-4- 24, 22:08:34 Slide 54 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Define a set of state variables: After conversion, the new ODE Where And 星期四, 2008-4- 24, 22:08:34 Slide 55 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

MATLAB description 星期四, 2008-4- 24, 22:08:34 星期四, 2008-4- 24, 22:08:34 Slide 56 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Solutions Verification 星期四, 2008-4- 24, 22:08:34 星期四, 2008-4- 24, 22:08:34 Slide 57 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Step size plot Comments Should not rely too much on defaults Better set precision control to Step size should be as small as 0.0001 Solutions should be verified 星期四, 2008-4- 24, 22:08:34 Slide 58 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-12 Fixed step size Runge-Kutta algorithm where 星期四, 2008-4- 24, 22:08:34 Slide 59 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Using a fixed step size 0.01: 星期四, 2008-4- 24, 22:08:34 Slide 60 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-13 Solve the differential equation sets Select the state variables: and 星期四, 2008-4- 24, 22:08:34 Slide 61 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Substitute into the second eqn to find The first order ODE can be constructed 星期四, 2008-4- 24, 22:08:34 Slide 62 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

With solve function One also finds 星期四, 2008-4- 24, 22:08:34 星期四, 2008-4- 24, 22:08:34 Slide 63 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Transformation of differential matrix equations The Lagrange equation Where matrices column vectors Selecting state vector 星期四, 2008-4- 24, 22:08:34 Slide 64 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

the state-space equation can be rewritten as Where Thus the matrix equation can be solved with the ode45() or ode15s() functions 星期四, 2008-4- 24, 22:08:34 Slide 65 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-14 Consider the inverted pendulum model expressed as where q = [a,q1,q2]T, and a is the position of the cart, and q1, q2 are the angles of the two bars. The matrices are given by 星期四, 2008-4- 24, 22:08:34 Slide 66 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

The parameters 星期四, 2008-4- 24, 22:08:34 星期四, 2008-4- 24, 22:08:34 Slide 67 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

MATLAB description 星期四, 2008-4- 24, 22:08:34 星期四, 2008-4- 24, 22:08:34 Slide 68 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Solving the inverted pendulum problem with the following MATLAB code Original system unstable 星期四, 2008-4- 24, 22:08:34 Slide 69 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.2.5 Validation of numerical solutions to ODEs It has been shown through examples that if the control parameters are not properly chosen, the solutions may not be correct. Thus the numerical solutions should be validated. The most effective control parameter is the RelTol property. The default value for it is 10-3, which is too large. It can be set respectively to 10-6 or even 10-8. 星期四, 2008-4- 24, 22:08:34 Slide 70 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.3 Numerical Solutions to Special Ordinary Differential Equations Solutions of stiff differential equations Solutions of implicit differential equations Solutions to differential algebraic equations Solutions to delay differential equations 星期四, 2008-4- 24, 22:08:34 Slide 71 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.3.1 Solutions of stiff differential equations In the Van der Pol equation, In many differential equations, the solutions to some states changes very rapidly while others may change very slowly. Stiff equations. An alternative function, ode15s(), can be used instead and this function has exactly the same syntax as that of the ode45() function. 星期四, 2008-4- 24, 22:08:34 Slide 72 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-15 Find the numerical solutions to Van der Pol equation, when 星期四, 2008-4- 24, 22:08:34 Slide 73 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-16 Solve the ODE Regarded as stiff in classical courses The analytical solutions 星期四, 2008-4- 24, 22:08:34 Slide 74 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Numerical solutions to the problem 星期四, 2008-4- 24, 22:08:34 Slide 75 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Using a fixed step size: For better results, one should reduce the step size, however slow 星期四, 2008-4- 24, 22:08:34 Slide 76 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-17 Numerically solve the ODE Initial condition Solutions 星期四, 2008-4- 24, 22:08:34 Slide 77 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Using variable step size: Using ode15s() instead of ode45(): 星期四, 2008-4- 24, 22:08:34 Slide 78 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.3.2 Solutions of implicit differential equations The so-called implicit differential equations are those who cannot be converted into the first-order explicit equations. The implicit equations can still be solved by the use of explicit equations. Or use of solver ode15i 星期四, 2008-4- 24, 22:08:34 Slide 79 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-18 Given x1(0)=x2(0)=0 , numerically solve By denoting x=[x1,x2]T, re-write the original ODE as follows: 星期四, 2008-4- 24, 22:08:34 Slide 80 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

where 星期四, 2008-4- 24, 22:08:34 Slide 81 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-19 Given x(0)=[1,0,0,1]T, numerically solve Define the state vector: Re-write the original implicit ODE: 星期四, 2008-4- 24, 22:08:34 Slide 82 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Solve the Algebraic equation in the model Describe the equation in MATLAB 星期四, 2008-4- 24, 22:08:34 Slide 83 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

continued from overleaf The derivatives can be evaluated Solution process: 星期四, 2008-4- 24, 22:08:34 Slide 84 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Use of ode15i(): It is a new ODE command in MATLAB 7.0 for solving implicit ODEs directly. General description of implicit ODEs: 星期四, 2008-4- 24, 22:08:34 Slide 85 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-20 Using implicit ODE solution method, for initial state x(0)=[1,0,0,1]T State variables: 星期四, 2008-4- 24, 22:08:34 Slide 86 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

The differential equation can be rewritten as Recall the form 星期四, 2008-4- 24, 22:08:34 Slide 87 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Solutions 星期四, 2008-4- 24, 22:08:34 Slide 88 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.3.3 Solutions to differential algebraic equations A more general form of the differential equations: is singular Differential algebraic equation Cannot use 星期四, 2008-4- 24, 22:08:34 Slide 89 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-21 Given initial conditions, x1(0)=0.8, x2(0)=x3(0)=0.1, Numerically solve the following DAE: Using matrix form description for this DAE: 星期四, 2008-4- 24, 22:08:34 Slide 90 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Solving the equation 星期四, 2008-4- 24, 22:08:34 星期四, 2008-4- 24, 22:08:34 Slide 91 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Alternative solution method We can also transform this DAE to the normal ODE. From the algebraic constraint: by substitution, we get An anonymous function can be written to describe the differential equations 星期四, 2008-4- 24, 22:08:34 Slide 92 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Solving again 星期四, 2008-4- 24, 22:08:34 Slide 93 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

To use ode15i() command 星期四, 2008-4- 24, 22:08:34 星期四, 2008-4- 24, 22:08:34 Slide 94 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-22 Solve when 星期四, 2008-4- 24, 22:08:34 星期四, 2008-4- 24, 22:08:34 Slide 95 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.3.4 Solutions to delay differential equations General form of the DDEs where is the time delay for the state x(t) Implicit Runge-Kutta algorithm dde23() 星期四, 2008-4- 24, 22:08:34 Slide 96 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-23 Numerically solve this DDE: Initial states Select the state variables: 星期四, 2008-4- 24, 22:08:34 Slide 97 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

M-function description New standard form M-function description 星期四, 2008-4- 24, 22:08:34 Slide 98 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

MATLAB solutions 星期四, 2008-4- 24, 22:08:34 星期四, 2008-4- 24, 22:08:34 Slide 99 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-24 Neutral-type DDE Cannot be solved with dde23() function. 星期四, 2008-4- 24, 22:08:34 Slide 100 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.4 Solving Boundary Value Problems Solutions of two-point boundary value problems Solutions of general boundary value problems 星期四, 2008-4- 24, 22:08:34 Slide 101 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

The above are the conditions at two boundaries a and b. General mathematical description of boundary value problem for second-order differential equations: interval of interest: [a, b]. Study the solution when the following boundary conditions are specified: The above are the conditions at two boundaries a and b. 星期四, 2008-4- 24, 22:08:34 Slide 102 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.4.1 Solutions of two-point boundary value problems Standard form Problem can be converted as Newton iteration: 星期四, 2008-4- 24, 22:08:34 Slide 103 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

where Solving this 星期四, 2008-4- 24, 22:08:34 星期四, 2008-4- 24, 22:08:34 Slide 104 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

where it is required to explicitly solve Prepare the MATLAB function: 星期四, 2008-4- 24, 22:08:34 Slide 105 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-25 Solve the following boundary value problem to the nonlinear differential equations Derive the partial derivatives: We get 星期四, 2008-4- 24, 22:08:34 Slide 106 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Analytical solution is Verification: Solution process: Analytical solution is Verification: 星期四, 2008-4- 24, 22:08:34 Slide 107 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.4.2 Solutions of general boundary value problems bvp5c() function for general BVPs Parameter initialization MATLAB descriptions to differential equations and boundary value problems 星期四, 2008-4- 24, 22:08:34 Slide 108 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-26 Solve again the boundary value problem in Example 7.25 with the bvp5c() solver. Select states The new state equation MATLAB description 星期四, 2008-4- 24, 22:08:34 Slide 109 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Rewrite the boundary conditions The problem can be solved with Pay attention to the last command 星期四, 2008-4- 24, 22:08:34 Slide 110 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

If the boundary value problem is It can be rewritten as The solution can be found by 星期四, 2008-4- 24, 22:08:34 Slide 111 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-27 For a differential equation With Four conditions find the parameters and solve the BVP 星期四, 2008-4- 24, 22:08:34 Slide 112 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

The equations can be written as Let The equations can be written as MATLAB description 星期四, 2008-4- 24, 22:08:34 Slide 113 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

The problem can be solved with 星期四, 2008-4- 24, 22:08:34 Slide 114 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.5 Introduction to Partial Differential Equations Solving a set of PDEs Mathematical description to the two-dimensional PDEs The GUI for the PDE Toolbox --- an introduction 星期四, 2008-4- 24, 22:08:34 Slide 115 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.5.1 Solving a set of PDEs The pdepe() command can be used to solve the following class of PDEs 星期四, 2008-4- 24, 22:08:34 Slide 116 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Boundary conditions can be specified as Initial conditions Simple MATLAB solutions of IC Solutions of PDE 星期四, 2008-4- 24, 22:08:34 Slide 117 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-28 Solve the following PDE 星期四, 2008-4- 24, 22:08:34 星期四, 2008-4- 24, 22:08:34 Slide 118 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

The function Initial conditions Boundary conditions 星期四, 2008-4- 24, 22:08:34 Slide 119 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Change the original PDE as the following: Clearly, here , and also 星期四, 2008-4- 24, 22:08:34 Slide 120 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

The M-function describing the PDE Specify the boundary conditions left bounds right bounds 星期四, 2008-4- 24, 22:08:34 Slide 121 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Prepare the MATLAB function for BC: Prepare the MATLAB function for IC: 星期四, 2008-4- 24, 22:08:34 Slide 122 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Solution process: 星期四, 2008-4- 24, 22:08:34 星期四, 2008-4- 24, 22:08:34 Slide 123 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.5.2 Mathematical description to the two-dimensional PDEs Four kinds of PDEs Elliptic Parabolic Hyperbolic Eigenvalue type 星期四, 2008-4- 24, 22:08:34 Slide 124 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Elliptic PDEs General description of elliptic PDE: Gradient where Gradient Divergence: 星期四, 2008-4- 24, 22:08:34 Slide 125 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

If c is a constant, the above can be simplified as Elliptic PDEs: 星期四, 2008-4- 24, 22:08:34 Slide 126 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Parabolic PDEs The general form of a parabolic PDE If c is a constant, the above equation can be simplified as 星期四, 2008-4- 24, 22:08:34 Slide 127 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Hyperbolic PDEs The general form of a hyperbolic PDE If c is a constant, the above equation can be simplified 星期四, 2008-4- 24, 22:08:34 Slide 128 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Eigenvalue PDEs An eigenvalue PDE problem is defined as If c is a constant, the above equation can be simplified as 星期四, 2008-4- 24, 22:08:34 Slide 129 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.5.3 The GUI for the PDE Toolbox --- an introduction PDE Toolbox --- an overview Start the PDE Toolbox GUI Type pdetool in MATLAB Four elements in this GUI Menu system Toolbar Set formula Solution regions 星期四, 2008-4- 24, 22:08:34 Slide 130 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Drawing and defining the region in PDE solution the button labeled as can be used to define the solution region. the button labeled as D, can be used to made triangular mesh within the solution region. Boundary conditions for PDEs Dirichlet BC: 星期四, 2008-4- 24, 22:08:34 Slide 131 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Examples of PDE solution via PDE Toolbox Neumann BC: Expanded form: where is the partial differential of u,w,r,t . The vector normal to x. Examples of PDE solution via PDE Toolbox 星期四, 2008-4- 24, 22:08:34 Slide 132 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-29 Solving the following hyperbolic PDE: 星期四, 2008-4- 24, 22:08:34 Slide 133 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Animation of the time varying solutions Solving PDEs when parameters are not constants 星期四, 2008-4- 24, 22:08:34 Slide 134 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-30 Assume that the partial differential equations are described as which is an elliptic PDE where Solve this PDE with u=0 on the boundary. 星期四, 2008-4- 24, 22:08:34 Slide 135 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.6 Solving Ordinary Differential Equations using Simulink Blocks An introduction to Simulink Simulink --- relevant blocks Using Simulink for modeling and simulation of ODEs 星期四, 2008-4- 24, 22:08:34 Slide 136 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.6.1 An introduction to Simulink 1990 – first appearance of Simulink, with an old name of SimuLAB, renamed Simulink Simulink: two meanings simulation (simu) and model/block interconnection/link (link) Use odegroup to open self-defined model block library. 星期四, 2008-4- 24, 22:08:34 Slide 137 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.6.2 Simulink --- relevant blocks Commonly used blocks: Input and output port blocks (In1, Out1) Clock block: generates time variable t Commonly used input blocks: Sine Step Constant Integrator block (Int): just to integrate the dynamic system Transport delay blocks (Transport Delay) 星期四, 2008-4- 24, 22:08:34 Slide 138 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Mathematical operation blocks Mathematical function blocks Gain blocks: Gain Sliding Gain Matrix Gain Mathematical operation blocks +, -, *, ÷ Mathematical function blocks Sin, exp Signal vectorization blocks: Mux DeMux 星期四, 2008-4- 24, 22:08:34 Slide 139 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

7.6.3 Using Simulink for modeling and simulation of ODEs Build the corresponding Simulink model for ODE. Use sim( ) command to solve the Simulink block model. Get the ODE numerical solution. 星期四, 2008-4- 24, 22:08:34 Slide 140 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-31 Solve Lorenz equation: with b=8/3, r=10, s=28, and initial conditions x1(0)= x2(0)= 0, x3(0)=10-10, Use Simulink to construct this model and obtain the simulation result. 星期四, 2008-4- 24, 22:08:34 Slide 141 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Establish the block diagram Create model c7mlor1b.mdl Solve the system Compare with ode45 results 星期四, 2008-4- 24, 22:08:34 Slide 142 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-32 Solve the following DDE using Simulink. Create model c7mdde2.mdl Solution process: 星期四, 2008-4- 24, 22:08:34 Slide 143 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

The first order state space model: Assign the new states The first order state space model: 星期四, 2008-4- 24, 22:08:34 Slide 144 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Example 7-33 Where t1=0.15, t2=0.5 Use Simulink to build this DDE system. 星期四, 2008-4- 24, 22:08:34 Slide 145 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Enter the known matrices: Create the model c7mdde3.mdl Solution process: 星期四, 2008-4- 24, 22:08:34 Slide 146 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Chapter summary Functions 星期四, 2008-4- 24, 22:08:34 星期四, 2008-4- 24, 22:08:34 Slide 147 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

星期四, 2008-4- 24, 22:08:34 Slide 148 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

For general nonlinear ODE, it is not possible to obtain its analytical solution. So, must rely on numerical solutions. This chapter introduced the concept of numerical solution of ODEs starting with the simplest Euler algorithm. Then, for general numerical solutions, we introduced the basic idea and the related concept of step size. The MATLAB ODE solver ode45( ) has been introduced with several demo examples. 星期四, 2008-4- 24, 22:08:34 Slide 149 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

In initial value problem of ODEs can be solved easily when they are in the first-order explicit equations. If not, we introduced the conversion method using the concept of state variables. In particular, we introduced how to convert the high order ODEs into a set of first-order ODEs. Matrix differential equations are discussed, one may first convert the matrix differential equations into first-order explicit equations, then the equations can be solved. 星期四, 2008-4- 24, 22:08:34 Slide 150 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

When the ODE solution process is very slow, it is possible that the ODE is stiff and we must use stiff ODE solvers such as ode15s() for a reliable and fast solution. Additionally, we introduced other types of ODEs such as differential algebraic equations (DAEs), implicit ODEs, and delay differential equations (DDEs). The relevant MATLAB solution techniques for these special types of ODEs were introduced with examples. 星期四, 2008-4- 24, 22:08:34 Slide 151 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

For the boundary value problem (BVP) for second order ODEs, we can use the universal solver bvp5c() with examples. For partial differential equations (PDEs), we can use the ready commands provided in MATLAB PDE Toolbox. For 2D PDEs, we can use MATLAB PDE Toolbox via the GUI. This PDE toolbox is also useful for high dimensional PDEs. 星期四, 2008-4- 24, 22:08:34 Slide 152 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008

Simulink is an important dynamic system simulation platform within MATLAB. We can use the block diagram connections to construct any given dynamic system model using the existing Simulink block library. In this book, we focused more on Simulink basic knowledge and more on ODEs and DDEs. 星期四, 2008-4- 24, 22:08:34 Slide 153 (of 153) Dingyü Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008