ROCHESTER ME 406 - Study Notes - Using Eigenvector Methods with Mathematica to Solve Linear Autonomous Systems

Unformatted text preview:

ME 406Using Eigenvector Methods with Mathematica to Solve Linear Autonomous Systems of First Order Differential Equations ‡ 1. IntroductionIn this notebook, we use the methods of linear algebra -- specifically eigenvector and eigenvalue analysis-- to solve systems of linear autonomous ordinary differential equations. Although the Mathematica routinesDSolve and NDSolve could be used to attack these problems directly, we do not use them here. Our purpose is tomake clear the underlying linear algebra, and to use Mathematica to do all of the calculations. The canonicalproblem under consideration is the following:(1)X°= AX + b ,(2) X(0) = X0 ,where A is a constant n x n matrix, b is a constant n x 1 vector, and X0, the initial vector, is a given n x 1 vector.The general approach to this problem is the following. We first find a particular solution, which is definedto be any solution of equation (1). We call the particular solution Xp. The general solution Xgof the equation isthen (3)Xg= Xh + Xp , where Xhis the most general solution of the homogeneous equation: (4)X°h = AXh .The homogenous equation (4) has n linearly independent solutions. We call them XH1L, XH2L, . . . XHnL.The most general Xh is a linear combination of these. To solve the initial-value problem, we form the generalsolution Xgin terms of n constants a1, a2, . . . , an: (5)Xg= Xp + a1XH1L + a2XH2L + . . . + anXHnL.We now impose the initial condition (2) on the solution (5). This gives the following set of linear equations tosolve for the coefficients ai:(6) a1XH1L + a2XH2L + . . . + anXHnL= X0 - Xp at t = 0.The linear independence of the vectors XHiL guarantees that the matrix in the above equations is nonsingular andhence the solution for the coefficients aiis unique.The rest of this notebook provides the details in carrying this out, and shows how to use Mathematica toadvantage at each step. We will begin with a brief review of matrix manipulations in Mathematica. Then we willconsider the problem of finding the particular solution. After that, we will solve the homogeneous equation, in thefollowing sequence of cases of increasing difficulty: distinct real eigenvalues; distinct complex eigenvalues;repeated eigenvalues. Detailed examples will be done at each step.‡ 2. Basic Matrix Manipulations in MathematicaIn Mathematica, a matrix is a list of lists. Each component list is a row of the matrix. As an example, wedefine a matrix named A for Mathematica, and then use MatrixForm to print it out in traditional form.A = 881, -2, 3<, 8-2, -1, 4<, 83, 4, 5<<;MatrixForm@ADikjjjjjjj1 -23-2 -14345y{zzzzzzzOne way to find out whether A is singular is to compute the determinant.Det@AD-80Because the determinant is not zero, A is not singular, and thus has an inverse.B = Inverse@AD9921ÅÅÅÅÅÅÅ80, -11ÅÅÅÅÅÅÅ40,1ÅÅÅÅÅÅÅ16=, 9-11ÅÅÅÅÅÅÅ40,1ÅÅÅÅÅÅÅ20,1ÅÅÅÅ8=, 91ÅÅÅÅÅÅÅ16,1ÅÅÅÅ8,1ÅÅÅÅÅÅÅ16==We check the inverse by forming the product of A and the inverse of A. The product should be the identitymatrix. Matrix products are indicated by a period.A.B881, 0, 0<, 80, 1, 0<, 80, 0, 1<<B.A881, 0, 0<, 80, 1, 0<, 80, 0, 1<<We can use this inverse to solve a set of linear algebraic equations in which A is the coefficient matrix.Consider the equations (7)x - 2y + 3z = 1 ,-2x -y +4z = 0 ,2 lineig.nb3x +4y +5z = -1.The coefficient matrix is the matrix A, and the right-hand side is the vector b = 81, 0, -1<;We can use the inverse we have already calculated to solve these equations. We call the solution sol.sol = B.b91ÅÅÅÅ5, -2ÅÅÅÅ5,0=We check this:A.sol - b80, 0, 0<An alternative method of solution is to use Mathematica's LinearSolve.sol2 = LinearSolve@A, bD91ÅÅÅÅ5, -2ÅÅÅÅ5,0=We get the same result.In the above calculations, all the elements of A were integers, so Mathematica did an exact calculation. Ifone or more elements of A are written as real numbers, Mathematica will do a numerical rather than exact calcula-tion. Amod = 881., -2, 3<, 8-2, -1, 4<, 83, 4, 5 <<;[email protected], -0.275, 0.0625<,8-0.275, 0.05, 0.125<, 80.0625, 0.125, 0.0625<<For the present calculations, it doesn't matter much which way we do them. For larger matrices and moredifficult calculations, such as eigenanalysis, it is crucial to do the calculations numerically. We shall see anexample of this shortly.The determination of eigenvalues and eigenvectors is the central linear algebra calculation for solvingsystems of first-order linear autonomous differential equations. Given a square matrix A, we say that a non-zerovector c is an eigenvector of A with eigenvalue l if Ac = lc. Mathematica has a lot of built-in power to findeigenvectors and eigenvalues. We go back to our matrix A and use Mathematica to find its eigenvalue. lineig.nb 3eigvals = Eigenvalues@AD95ÅÅÅÅ3+23 52ê3ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ3 I-56 + 3 Âè!!!!!!!!!!!6411 M1ê3+1ÅÅÅÅ3I5 I-56 + 3 Âè!!!!!!!!!!!6411 MM1ê3,5ÅÅÅÅ3-23 52ê3I1 +Âè!!!3 MÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ6 I-56 + 3 Âè!!!!!!!!!!!6411 M1ê3-1ÅÅÅÅ6I1 -Âè!!!3 MI5 I-56 + 3 Âè!!!!!!!!!!!6411 MM1ê3,5ÅÅÅÅ3-23 52ê3I1 -Âè!!!3 MÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ6 I-56 + 3 Âè!!!!!!!!!!!6411 M1ê3-1ÅÅÅÅ6I1 +Âè!!!3 MI5 I-56 + 3 Âè!!!!!!!!!!!6411 MM1ê3=We are getting a graphic reminder about the difference between numerical and exact. Would you guess from theabove expression that the eigenvalues of A are real? Because A is symmetric it must have real eigenvalues. Let'sevaluate the above [email protected] - 1.33227 µ 10-15Â,-4.77934 - 1.11022 µ 10-15Â, 2.21196 + 2.66454 µ 10-15Â<We see that they are real, plus a tiny imaginary part due to numerical error. It is much easier just to get theeigenvalues numerically in the first place by using the modified form Amod, which contains a real number amongits entries.eigvals = [email protected], -4.77934, 2.21196<The eigenvectors are also easy to get. The Mathematica command is [email protected], 0.344798, 0.889066<,8-0.492759, -0.74195, 0.45464<, 80.816402, -0.574999, -0.0535175<<To get all


View Full Document

ROCHESTER ME 406 - Study Notes - Using Eigenvector Methods with Mathematica to Solve Linear Autonomous Systems

Download Study Notes - Using Eigenvector Methods with Mathematica to Solve Linear Autonomous Systems
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Notes - Using Eigenvector Methods with Mathematica to Solve Linear Autonomous Systems and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Notes - Using Eigenvector Methods with Mathematica to Solve Linear Autonomous Systems 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?