Matlab 4
Matlab 4
Exercise 4.1 (a) Define the matrix B in MATLAB with the values above. Copy and paste the input and output from your command into your Word document. (b) Use the MATLAB commands to find the eigenvalues and eigenvectors for the matrix B. Copy and paste the input and output from your command into your Word document.
(A). >> B=[1.2,2.5;4,.7] B= 1.2000 2.5000 4.0000 0.7000 >> (B) . >> [eigvec, eigval] = eig(B)
eigval = 4.1221 0
0 -2.2221 >>
Exercise 4.2 (a) When the system (4) above is put into the form v' = Av, what is the matrix A? Leave
Albert Calderon Math 20D May 13, 2010 MAtLAB 4 PID #A08674874
space in your Word document to write this in. (b) Enter the matrix A into MATLAB. Use MATLAB to find the characteristic roots (eigenvalues) and characteristic vectors (eigenvectors) of your matrix A. Copy and paste all input and output from your command into your Word document. (c) Use (2) above, and the results from part (b), to write the general solution of our system (4). Leave space in your Word document for this. What happens to the system as t gets large? (d) Use PPLANE to create a plot of the solutions. As in the example, choose Options -> Solution direction -> Forward and click on the plot several times. Include this plot in your writeup. Does this match your answer to (c)?
(a). >> A=[1,3;-1,-8] A= 1 3
Albert Calderon Math 20D May 13, 2010 MAtLAB 4 PID #A08674874
(d).
x '=1x +3y y '=- 1x - 8y 2
-1
-2
-3
-4 -2 -1 0 1 x 2 3 4
Exercise 4.3 (a) Put the system above in the form v' = Av and enter the matrix A into MATLAB. Use MATLAB to find eigenvalues and eigenvectors of A. Copy and paste all input and output from your command into your Word document. (c) Write the general solution of the system (6) by hand. Leave space in your Word document for this. (c) Use PPLANE to create a plot of the solutions. As in the example, choose Options -> Solution direction -> Forward and click on the plot several times. Include this plot in your writeup. What feature of the eigenvalues or eigenvectors causes the solutions to tend
Albert Calderon Math 20D May 13, 2010 MAtLAB 4 PID #A08674874
2.7000 -1.0000 4.2000 3.5000 >> [eigvec, eigval] = eig(A) eigvec = -0.0856 + 0.4301i -0.0856 - 0.4301i 0.8987 0.8987
3.1000 - 2.0100i
Albert Calderon Math 20D May 13, 2010 MAtLAB 4 PID #A08674874
x ' = 2 .7 x - 1 y y ' = 4 .2 x + 3.5 y 2
-1
-2
-3
-4 -2 -1 0 1 x 2 3 4
Exercise 4.4 (a) Define the matrix A in MATLAB with the values above, using A = [1.25, -.97, 4.6; 2.6, -5.2, -.31; 1.18, -10.3, 1.12], and calculate the eigenvalues of A. Copy and paste the input and output from MATLAB. (b) Using your answer from part (a), is the system in (10) stable? Justify your answer.
(a).
Albert Calderon Math 20D May 13, 2010 MAtLAB 4 PID #A08674874
eigvec =
-0.4490 - 0.2591i -0.4490 + 0.2591i 0.3375 - 0.2242i 0.3375 + 0.2242i 0.7530 0.7530
eigval =
5.5698 0 0
0 -4.1999 + 2.6606i 0
0 0
-4.1999 - 2.6606i
(b).This will not be stable because eigen value 1 will grow without bound as t approaches infinity.
(b) According to the mathematical definition is the system x'=Ax stable, asymptotically stable, or unstable? Why? (c) One of the eigenvalues you obtained is very close to 0. Look at the corresponding eigenvector. Which component is biggest? Which phenomenon is this eigenvector most closely associated with: yaw, roll or pitch?
(a). A=
Albert Calderon Math 20D May 13, 2010 MAtLAB 4 PID #A08674874 -0.0558 -0.9986 0.0802 0.0415 0.5980 -0.1150 -0.0318 -3.0500 0.3880 -0.4650 0 0.0805 1.0000 >> [eigvec, eigval] = eig(A) eigvec = 0.1996 - 0.1063i 0.1996 + 0.1063i -0.0172 -0.0780 - 0.1333i -0.0780 + 0.1333i -0.0118 -0.0165 + 0.6670i -0.0165 - 0.6670i -0.4896 0.6928 0.6928 0.8717 0.9991 0.0067 0.0404 -0.0105 0 0 0
(b).this answer is asymptotically stable since it will approach 0. . Mostly associate with yaw rate because it has biggest begative value.
(b) If F = (0 5 0 -.1), what is the matrix BF? (c) If F = (0 5 0 -.1), what is the matrix A + BF? Are its eigenvalues the same or different from those of A?
Albert Calderon Math 20D May 13, 2010 MAtLAB 4 PID #A08674874
(c) Find F = (F1 F2 F3 F4) that increases the damping of the yaw oscillation and so that the plane still responds decently to pilot commands. More specifically: we want the complex eigenvalues to have real part less that -0.2 and that we want one real eigenvalue within 0.02 of 0. (Hint: There is a solution with F1 = 0 and F3 = 0 and F4 = -.09 so you only need to fiddle with F2 to find an appropriate number.)
(a). F=[0 ;7; 0; -1]
F=
Albert Calderon Math 20D May 13, 2010 MAtLAB 4 PID #A08674874 >> A+B*F
ans =
-0.9308 -1.8736 -0.7948 -0.8335 -0.2770 -0.9900 -0.9068 -0.8750 -3.9250 -0.4870 -1.3400 -0.8750 -0.8750 -0.7945 0.1250 -0.8750
eigvec =
0.3219 + 0.1527i 0.3219 - 0.1527i -0.0761 0.2475 - 0.4128i 0.2475 + 0.4128i -0.0351 -0.7042 -0.7042 -0.6772
eigval =
-4.0049 0 0 0
0 0.3653 + 0.9619i 0 0
0 0
0 0 0
Albert Calderon Math 20D May 13, 2010 MAtLAB 4 PID #A08674874 Thr eigen values are different from those solely of A.