You are on page 1of 4

MATLAB Laboratory Manual

with SIMULINK examples

Bruno D. Welfert

to accompany

Fundamentals of
Differential Equations
Sixth Edition

and

Fundamentals of
Differential Equations
and
Boundary Value Problems
Fourth Edition

Nagle Saff Snider


i
MATLAB and SIMULINK are registered trademarks of The MathWorks, Inc.
MAPLE is a registered trademark of Waterloo Maple, Inc.

c 2003 B. Welfert

ii
Contents

Preface v

1 Introduction to MATLAB 1
The MATLAB Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Basics and Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Plotting with MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Scripts and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Matrices and Linear Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
MATLAB Programming and Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

2 Ordinary Differential Equations


with MATLAB 19
Numerical Differentiation and Solution of the IVP . . . . . . . . . . . . . . . . . . . . . . . . . 19
Direction Fields and Graphical Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
First-Order Scalar IVP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Basic ode45 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Error Plot, Improving the Accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Parameter-Dependent ODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Higher-Order and Systems of IVPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

3 MATLAB sessions 35
Laboratory 1: First-Order Differential Equations, Graphical Analysis . . . . . . . . . . . . . . . 38
Direction fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Additional Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Laboratory 2: Numerical Solutions (Euler, Improved Euler) for Scalar Equations . . . . . . . . 42
Euler’s Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Improved Euler’s Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Additional Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Laboratory 3: Solution Sensitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Dependence of IVP Solution on IC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Existence and Uniqueness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Additional Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Laboratory 4: Picard Iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Picard iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Numerical Picard Iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Additional problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Laboratory 5: Applications of First-Order Differential Equations . . . . . . . . . . . . . . . . . 61
Population Growth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Other Models, Parameter Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Laboratory 6: Further Applications of First-Order Differential Equations . . . . . . . . . . . . 66

iii
Thank you for evaluating AnyBizSoft PDF to Word.

You can only convert 3 pages with the trial version.

To get all the pages converted, you need to purchase the software from:

http://www.anypdftools.com/buy/buy-pdf-to-word.html

You might also like