Introduction to MLAB The Royal Road to Dynamical Simulations Revision Date: September 24, 2015 Foster Morrison, author Turtle Hollow Associates, Inc. P.O. Box 3639 Gaithersburg, MD 20885 USA Daniel Kerner, editor Civilized Software, Inc. 12109 Heritage Park Circle Silver Spring, MD 20906 USA Email:
[email protected] Web-site: http://www.civilized.com (301) 962-3711 c 1992-2014 Turtle Hollow Associates, Inc. Contents Preface ii 1 BASIC MATHEMATICS AND ITS IMPLEMENTATION IN MLAB 1 1.1 What You Need to Know ................................ 1 1.2 Getting Started with MLAB ............................... 2 1.3 Foundations of Mathematics ............................... 2 1.4 Sets ............................................ 3 1.5 Numbers, Prime, Rational, and Real .......................... 4 1.6 Try Out MLAB ...................................... 6 2 PROGRAMMING IN MLAB 10 2.1 More Numerical Analysis vs. Analysis ......................... 10 2.2 Legendre Polynomials .................................. 11 3 VECTORS AND MATRICES 13 3.1 Vectors .......................................... 13 3.2 Matrices, Linear Algebra, and Modern Algebra .................... 14 3.3 Arrays ........................................... 16 3.4 Functional Analysis .................................... 16 i 4 LINEAR DYNAMIC SYSTEMS AND MODELS 19 4.1 Difference Equations ................................... 19 4.2 Differential Equations .................................. 21 4.3 Generalizations ...................................... 23 5 LINEAR DYNAMIC SYSTEMS WITH INPUTS