Linear Systems of Differential Equations

Similar documents
7.5 Operations with Matrices. Copyright Cengage Learning. All rights reserved.

The useful linear algebra operations are contained in a special package that is loaded with the command

MATRICES. a m,1 a m,n A =

(b) Find the constituent matrices of A. For this, we need the eigenvalues of A, which we can find by using the Maple command "eigenvals":

TOPIC 2 Computer application for manipulating matrix using MATLAB

Lemma 8: Suppose the N by N matrix A has the following block upper triangular form:

Chapter 9: Systems of Equations and Inequalities

Matrices A matrix is a rectangular array of numbers. For example, the following rectangular arrays of numbers are matrices: 2 1 2

Handout 1 EXAMPLES OF SOLVING SYSTEMS OF LINEAR EQUATIONS

1 Matrices and matrix algebra

Matrix operations Linear Algebra with Computer Science Application

Section Matrices and Systems of Linear Eqns.

Introduction to Matrices

Phys 201. Matrices and Determinants

Linear Algebra. Solving SLEs with Matlab. Matrix Inversion. Solving SLE s by Matlab - Inverse. Solving Simultaneous Linear Equations in MATLAB

Formula for the inverse matrix. Cramer s rule. Review: 3 3 determinants can be computed expanding by any row or column

BCMB/CHEM 8190 Lab Exercise Using Maple for NMR Data Processing and Pulse Sequence Design March 2012

SECTION 2: VECTORS AND MATRICES. ENGR 112 Introduction to Engineering Computing

+ MATRIX VARIABLES AND TWO DIMENSIONAL ARRAYS

Matrix Algebra. Matrix Algebra. Chapter 8 - S&B

CSL361 Problem set 4: Basic linear algebra

Evaluating Determinants by Row Reduction

Math 4377/6308 Advanced Linear Algebra

MATH.2720 Introduction to Programming with MATLAB Vector and Matrix Algebra

10. Linear Systems of ODEs, Matrix multiplication, superposition principle (parts of sections )

3. Array and Matrix Operations

Chapter 2. Matrix Arithmetic. Chapter 2

7.6 The Inverse of a Square Matrix

Relation of Pure Minimum Cost Flow Model to Linear Programming

MAT 343 Laboratory 3 The LU factorization

Mathematics 13: Lecture 10

A primer on matrices

Elementary maths for GMT

MTH5112 Linear Algebra I MTH5212 Applied Linear Algebra (2017/2018)

Note: The command name is upper case in the description given by help, but must be lower case in actual use. And the backslash Anb is dierent when A i

MAT 1332: CALCULUS FOR LIFE SCIENCES. Contents. 1. Review: Linear Algebra II Vectors and matrices Definition. 1.2.

Programs for Natural Cubic Spline Interpolation

Matrix Algebra 2.1 MATRIX OPERATIONS Pearson Education, Inc.

Differential Equations and Linear Algebra C. Henry Edwards David E. Penney Third Edition

ICS 6N Computational Linear Algebra Matrix Algebra

Linear Algebra. The analysis of many models in the social sciences reduces to the study of systems of equations.

M. Matrices and Linear Algebra

SOLVING LINEAR SYSTEMS

Section Summary. Sequences. Recurrence Relations. Summations. Examples: Geometric Progression, Arithmetic Progression. Example: Fibonacci Sequence

Unit 1 Matrices Notes Packet Period: Matrices

Asymptotic Methods of ODEs: Exploring Singularities of the Second Kind

CS100: DISCRETE STRUCTURES. Lecture 3 Matrices Ch 3 Pages:

Chapter 2. Ma 322 Fall Ma 322. Sept 23-27

Lecture 9: Elementary Matrices

Introduction. Vectors and Matrices. Vectors [1] Vectors [2]

Vectors and Vector Arithmetic

Introduction to Matlab

1111: Linear Algebra I

a11 a A = : a 21 a 22

Matrix decompositions

5.2 Matrix Equations 289. An m n system of linear equations. x 2. x n

Basic Linear Algebra in MATLAB

Math 22AL Lab #4. 1 Objectives. 2 Header. 0.1 Notes

CS 246 Review of Linear Algebra 01/17/19

Matrix Arithmetic. (Multidimensional Math) Institute for Advanced Analytics. Shaina Race, PhD

Two matrices of the same size are added by adding their corresponding entries =.

Application 7.4 Earthquake-Induced Vibrations of Multistory Buildings

Finite Mathematics Chapter 2. where a, b, c, d, h, and k are real numbers and neither a and b nor c and d are both zero.

CS227-Scientific Computing. Lecture 4: A Crash Course in Linear Algebra

Matrix Arithmetic. a 11 a. A + B = + a m1 a mn. + b. a 11 + b 11 a 1n + b 1n = a m1. b m1 b mn. and scalar multiplication for matrices via.

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

Differential equations

Linear Algebra Using MATLAB

MATH Mathematics for Agriculture II

Review Questions REVIEW QUESTIONS 71

Linear Equations in Linear Algebra

Using MATLAB. Linear Algebra

Numerical Methods Lecture 2 Simultaneous Equations

Homework #2 solutions Due: June 15, 2012

Math 224, Fall 2007 Exam 3 Thursday, December 6, 2007

Matrix-Vector Operations

Definition. A matrix is a rectangular array of numbers enclosed by brackets (plural: matrices).

Section 12.4 Algebra of Matrices

The Multivariate Gaussian Distribution

(Linear equations) Applied Linear Algebra in Geoscience Using MATLAB

b 1 b 2.. b = b m A = [a 1,a 2,...,a n ] where a 1,j a 2,j a j = a m,j Let A R m n and x 1 x 2 x = x n

A fast and accurate algorithm for solving Said-Ball-Vandermonde linear systems

MATH 1210 Assignment 4 Solutions 16R-T1

Introduction to Matrix Algebra

Matrix decompositions

OR MSc Maths Revision Course

SUPPLEMENTARY NOTES: CHAPTER 1

Statistical methods. Mean value and standard deviations Standard statistical distributions Linear systems Matrix algebra

Review of Linear Algebra

Matrices, vectors and scalars. Operations. Matrix multiplication. notes linear algebra 1. Consider the following examples. a 11 a 12 a 21 a 22

Matrices BUSINESS MATHEMATICS

PH1105 Lecture Notes on Linear Algebra.

(Mathematical Operations with Arrays) Applied Linear Algebra in Geoscience Using MATLAB

Linear Algebra: A Constructive Approach

MATH 323 Linear Algebra Lecture 6: Matrix algebra (continued). Determinants.

The following steps will help you to record your work and save and submit it successfully.

Introduction. How to use this book. Linear algebra. Mathematica. Mathematica cells

System of Linear Equations

Computational Foundations of Cognitive Science

Computer Assignment 2

Transcription:

Chapter 5 Linear Systems of Differential Equations Project 5. Automatic Solution of Linear Systems Calculations with numerical matrices of order greater than 3 are most frequently carried out with the aid of calculators or computers. For example, in Example 8 of Section 5. in the text we needed to solve the linear system c + c + c = 0 3 c c = 3 c c + c = 6. 3 () Writing this system in matrix notation AC = B and working with a TI-86 calculator, for instance, we would store the 3 3 coefficient matrix A and the column vector B with the commands [[,,] [,0,-] [,-,]] A [[0] [] [6]] B in which each matrix and each of its successive rows in enclosed within square brackets. Then we calculate and store the solution C = A B with the command A *B C which yields the result [[ ] [-3] [ ]] Thus c =, c = 3, and c 3 =, as we found using elementary row operations in Example 8 in the text. Project 5. 9

Matrix notations and calculations in most computer systems are similar. In the sections below, we illustrate how to enter matrices and perform simple matrix calculations using Maple, Mathematica, and MATLAB. The investigations that follow are simple exercises to familiarize you with automatic matrix computation. Applications will appear in the remaining projects in this chapter. Investigation A To practice simple matrix algebra with whatever calculator or computer system is available, you might begin by defining a square matrix A of your own selection. Then calculate its inverse matrix B and check that the matrix product AB is the identity matrix. Do this with several square matrices of different dimensions. Investigation B Use matrix algebra as indicated above (for the computations of Example 8) to solve Problems 3 through 0 of Section 5. in the text. Investigation C An interesting n n matrix is the Hilbert matrix H n whose ijth element (in the ith row and jth column) is /(i + j ). For instance, the Hilbert matrix is H = 3 3 5 3 5 6 5 6 7 # $ #. () Set up the Hilbert matrices of orders n = 3,, 5, 6,..., and calculate their inverse matrices. The results will look more interesting than you might anticipate. () Show that the system H 3 x = b has the exact solution x = [ ] T if T T, b = 3 7 [ 83333.. 08333 0. 78333 ] 6 60 whereas it has the exact solution x = [ 06.. 0] T if b = [ 8.. 08. ] T. Thus linear systems with coefficient matrix H 3 can be quite unstable with respect to roundoff errors in the constant vector b. (This example is essentially the one given by Steven H. Weintraub on page 3 of the April 986 issue of the American Mathematical Monthly.) () Show that the system H x = b has the exact solution x = [ ] T if T T, b = 5 77 57 39 60 60 0 [. 08333. 8333 0. 95000 0. 7595] whereas it has the exact solution x = [. 8 8. 7. 8.] T if 0 Chapter 5

b = [. 08. 8 0. 95 0. 76] T. Using Maple In order to carry out matrix computations the Maple linalg package must first be loaded, with(linalg): A particular matrix can be entered either with a command of the form A := matrix( 3,3, [,,,,0,-,,-,]); A : = 0 where the first two arguments prescribe the numbers of rows and columns and the third argument is a vector listing the elements of A row-by-row, or with one of the form A := matrix( [[,,], [,0,-], [,-,]] ); in which the individual row vectors of A are prescribed. The inverse matrix A calculated with the command is then B := inverse(a); B : = 8 0 8 The function evalm (for evaluate matrices) is used for matrix multiplication, with &* denoting the matrix multiplication operator itself. Thus we can verify that B actually is the inverse matrix of A with the calculation evalm( B &* A ); 0 0 0 0 0 0 Having defined the right-hand side constant (column) vector b := matrix( 3,, [0,,6]); Project 5.

b : = 0 6 in (), we can then calculate the solution vector c = A b = Bb with the command c := evalm( B &* b ); c : = 3 For higher-dimensional linear systems the computation of the inverse matrix is not so efficient as immediate application of Maple's linsolve function: c := linsolve( A, b ); c : = 3 A matrix can also be defined by prescribing its ijth element as a function of the row index i and the column index i. For instance, the 3 3 Hilbert matrix is defined by H3 := matrix( 3,3, (i,j) -> /(i+j-) ); H3 : = 3 3 3 5 The linalg package also includes an explicit Hilbert matrix function. For instance, the command H := hilbert(); generates the Hilbert matrix displayed in (). Finally, the diagonal function can be used to generate the most ubiquitous of all special matrices the identity matrices such as I3 = diag(,,); Chapter 5

Using Mathematica 0 0 0 0 0 0 A particular matrix is entered in Mathematica as as list of row vectors, each row vector itself being a list of elements, as in the command A = { {,,}, {,0,-}, {,-,} } {{,, }, {, 0, -}, {, -, }} The MatrixForm function can be used to display A in standard matrix form: A // MatrixForm 0 - - The inverse matrix A is then calculated with the command B = Inverse[A] {{-, -, -}, {-, 0, -(-)}, {-, -(-), -}} 8 8 The period. denotes the matrix multiplication operator in Mathematica. Thus we can verify that B actually is the inverse matrix of A with the calculation B. A // MatrixForm 0 0 0 0 0 0 Having defined the right-hand side constant (column) vector b = { {0}, {}, {6} } {{0}, {}, {6}} in (), we can then calculate the solution vector c = A b = Bb with the command c = B. b {{}, {-3}, {}} Project 5. 3

For higher-dimensional linear systems the computation of the inverse matrix is not so efficient as immediate application of Mathematica's LinearSolve function: c = LinearSolve[ A, b ] {{}, {-3}, {}} The computation A. c - b {{0}, {0}, {0}} then verifies that c is a solution of the equation Ax = b. A matrix can also be defined by prescribing its ijth element as a function of the row index i and the column index i. For instance, the 3 3 Hilbert matrix is defined by H3 = Table[ /(i+j-), {i,,3},{j,,3} ] {{, -, -}, {-, -, -}, {-, -, -}} 3 3 3 5 H3 // MatrixForm - - 3 - - - 3 - - - 3 5 Finally, the DiagonalMatrix function can be used to generate the most ubiquitous of all special matrices the identity matrices such as I3 = DiagonalMatrix[ {,,} ] {{, 0, 0}, {0,, 0}, {0, 0, }} Actually, the identity matrix has its own function (of the dimension): IdentityMatrix[3] // MatrixForm 0 0 0 0 0 0 Chapter 5

Using MATLAB A particular matrix can be entered either with a command of the form A = [ [ ]; [ 0 -]; [ - ] ] A = 0 - - where the row vectors of A are separated by semicolons, or with one of the simplest possible form A = [ 0 - - ] in which the matrix is built just as it looks The inverse matrix A with the command is then calculated B = inv(b) B = 0.50 0.500 0.500 0.500 0-0.5000 0.50-0.500 0.500 The ordinary MATLAB multiplication operator * suffices to multiply matrices of appropriate dimensions. Thus we can verify that B actually is the inverse matrix of A with the calculation B*A ans = 0 0 0 0 0 0 Having defined the right-hand side constant (column) vector b = [0; ; 6] b = 0 6 in (), we can then calculate the solution vector c = A b = Bb with the command c = B*b Project 5. 5

c = -3 For higher-dimensional linear systems the computation of the inverse matrix is not so efficient as immediate application of MATLAB's linear solve function in the form of the operator \ that denotes matrix left division: c = A\b c = -3 A matrix can also be defined with a double loop prescribing its ijth element as a function of the row index i and the column index j. For instance, the 3 3 Hilbert matrix H 3 is defined by for i = : 3 for j = : 3 H3(i,j) = /(i+j-); end end using the notation A(i, j) for the ijth element of the matrix A. After specifying rational formatting of output, we can display the result as format rat H3 H3 = / /3 / /3 / /3 / /5 MATLAB also includes an explicit Hilbert matrix function. For instance, the command H = hilb() generates the Hilbert matrix H displayed in (). Finally, the diagonal function can be used to generate the most ubiquitous of all special matrices the identity matrices such as I = diag([ ]) 6 Chapter 5

I = 0 0 0 0 0 0 0 0 0 0 0 0 Actually, the identity matrix has its own MATLAB function (of the dimension): I5 = eye(5) I5 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Project 5. 7