MC MATH 282 - MATLAB Assignment 6
Pages 12

Unformatted text preview:

ax by dx dt dy dt cx dy MATH 282 MATLAB Assignment 6 Phase Portraits and Direction Fields We restrict our discussion to systems of the form where a b c d are constants We let a b c d Y t x t 1 Strait Line Solutions Recall if the matrix A has a real eigenvalue with associated eigenvector v then the linear system AY has the straight line solution Y t e t v Example Consider the system dY We use the MATLAB command eig to calculate the eigenvalues and their associated eigenvectors as follows y t and we write the system in the form dY 1 3 Y AY 2 2 dY dt dt dt The eigenpairs of the system are 1 1 v1 2 1 and 2 4 v2 1 1 So the system has two straight line solutions namely Y 1 t et 2 and Y 2 t e4t e4t We can plot the direction field of the system exactly as we did for non linear systems 1 2et et To plot half of the straight line solution we type Any multiple of the vector v1 is also an eigeinvector of 1 In particular v1 is an eigenvector and the lower half of the line is obtained by plotting the solution et v1 Similarly we can plot the second straight solution as follows Next we use MATLAB to solve linear systems in two different ways We will focus on the technical parts students should consult their textbooks to learn about the valuable information that eigenpairs pairs contain 2 Solving Systems in Terms of Eigenpairs Case I two distinct real eigenvalues Example As an example we solve the system dY We enter the coefficient matrix A 3 1 dt 0 2 Y Y 0 2 5 2 in MATLAB 3 1 0 Next we use the command eig to calculate the eigenpairs of A 1 provides the eigenvectors associated to the distinct 0 Note that the columns of the matrix Evr 1 1 5 eigenvalues 1 3 and 2 2 found along the diagonal of the matrix Evl Therefore the general solution is Substituting for the initial condition Y 0 2 5 Y t c1 e 3t 1 0 c2 e2t 1 5 1 c1 1 0 c2 1 5 1 2 5 which can be written in the form Observe that Evr 1 1 5 1 c1 c2 2 5 1 1 5 5 Now we use MATLAB to solve for c1 and c2 as follows Evr c1 c2 2 1 hence we obtain 0 0 Y t e 3 t 1 0 5e2t 1 5 1 that is c1 1 c2 5 and the solution to our initial value problem is or Case II two complex eigenvalues As an example we find the general solution of the system dY 0 e 3t 1 5 e2t Y t 1 3 2 Y 2 3 dt 1 2 2 3i v2 i 1 2 3i v1 i 1 So the eigenpairs are and Consider the second pair and let us calculate the real and imaginary parts of the complex solution 1 e 2 3i t Consequently the general solution of this system is 1 e 2t cos3t isin3t i e 2t cos3t e 2t sin 3t Case III The eigenvalue has multiplicity 2 Y t C1 e 2t sin 3 t e 2t cos3t C2 e 2t cos3t e 2t sin 3t i There are two independent eigenvectors associated with dY e 2t cos3t i e 2t sin3t e 2t sin 3t e 2 t cos3t e 2t cos3t e 2t sin 3t i Y t i Y t i 3 0 0 3 Y dt In this case the general solution is Y t c1 e3t 1 There is only one linearly independent vector associated with dY ii 0 c2 e3 t 0 1 3 0 1 3 Y dt So there is one vector v 0 1 associated with 3 A particular solution is given by Y 1 e t v e3t 0 1 A second solution is Y 2 te t v w e t where A I w v Note that Evr is just the vector v hence we can easily solve for w 0 e3t and the general solution is T t C 1Y 1 t C 2Y 2 t Therefore Y 2 te t v w e t te3t 0 3 Solving Systems using the command dsolve Let us consider the system discussed in Case III ii dY That is the system 1 1 dt 1 3 Y 3 0 3 x dx dt dy dt x 3 y To find the general solution we type To solve the same system but with the initial conditions x 0 2 y 0 5 Consider the initial value problem We can use desolve to solve this IVP problem in terms of m and n dx dt dy dt x 3 y x 0 m y 0 n 2 x 2 y As we have indicated before the outputs of the desolve command are symbolic expressions We can use MATLAB to change those symbolic expressions into functions xf t m n and yf t m n This can be done using the MATLAB command eval Finally since we intend to plot solutions curves we need to make sure that all expressions are vectorized has dots before and otherwise t will be interpreted as a matrix and multiplications and divisions will not make any sense The following script should plot the straight line solutions Let us plot the straight line solutions together with some solutions curves Putting everything together by adding a direction field dx dt Exercise Consider the initial value problem 1 Draw a direction field for the system 2 Determine the type of the equilibrium point at the origin 3 Use dsolve to solve the IVP in terms of m and n 4 Find all straight line solutions 5 Plot the straight line solutions together with the solutions with initial conditions 2x 1 2 dy dt y x 0 m y 0 n y m n 2 1 1 2 2 2 2 0

View Full Document

MC MATH 282 - MATLAB Assignment 6

Pages: 12
Documents in this Course

12 pages

7 pages

8 pages

6 pages