Sei sulla pagina 1di 4

ECE220 Problem Lab #3 Vectors, Matrices and Linear Equations Date: Week of June 17, 2013

The main goal of this lab is to give you practice on vectors, matrices and linear equations. Finish as many problems as you can during the lab period, and any remaining problems for the lab deadline. Feel free to experiment with the Matlab scripts and GUIs in any way you want.

I. Vector and Matrix operations


Do problems 5.8, 5.9 and 5.12. Copy the answers in your lab le.

II. Matrix inversion


Do problem 5.21 using the 2x2 matrix inverse formula given in class. Do problem 5.22 using Gaussian elimination and check your answer using the inv() function in Matlab.

III. Vectors and Matrices as a language in other courses


The TAs will provide help with any of these problems, if you need it. 1. Work out example 5.28. Write a MATLAB script to perform the computations. 1

IV. Types of systems of equations


In this part of the lab well examine the concepts of over/underdetermined and consistent/inconsistent systems of linear equations, and it consists of some problems in the book plus a Matlab program that helps further explain some of these concepts. You may choose to run the Matlab program rst if that is more helpful to you. From the book, work out problems 6.6, 6.7, 6.8. In addition, the following can be used to gain an intuitive feeling about these concepts, well use systems of equations with up to two unknowns. Such systems can be depicted graphically in the two-dimensional plane. Run the Matlab GUI oneline. You will nd it in the problem labs directory in the course locker, in the Matlab GUIs/LINEAR SYSTEMS subdirectory. This GUI shows the eects of the slope, a, and intercept, b, parameters in the equation of a straight line: y = ax + b. 1. Enable the Hold graphs button. Use the slider for the intercept (b) parameter to see the eect of increasing/decreasing b. Select both positive and negative values for b. Reset the GUI. Enable the Hold graphs button. Use the slider for the slope (a) parameter to see the eect of increasing/decreasing a. Select both positive and negative values for a. 2. Reset the GUI. Enable the Hold graphs button. Set the slope to 1, through the slope edit box. You have two lines on the graph. As we know, these two lines represent a system of two equations into the two unknowns x and y . Question 1. Does this system have a solution? Answer this question by looking at the graph. If you say yes, what is the solution? Is it unique? Why? Question 2. Write down the system of equations. Question 3. Write down the matrix A that corresponds to this system. Question 4. Write down the vector b that corresponds to this system. Question 5. Write a Matlab program to solve this system. Did Matlab give you the solution you see on the GUI? 3. Reset the GUI. Set the intercept to 0, through the intercept edit box. (Where did the @#@&!& line go?) Enable the Hold graphs button. Set the slope to 2, through the slope edit box. Set the slope to -3, through the slope edit box. Set the intercept to 4, through the intercept edit box. Now you have 3 lines on the graph. 2

Question 6. These 3 lines represent a linear system of 3 equations into 2 unknowns. Is this system over or underdetermined? Question 7. Is this system consistent or inconsistent? How can you tell from the graph? 4. Reset the GUI. Set the intercept to 0, through the intercept edit box. Enable the Hold graphs button. Question 8. Fool around with a and b until you get a system of two equations and two unknowns that has a unique solution x = 2, y = 4. Write down the A matrix and b vector for this system. Solve the system using Matlab to verify your answer. Matrices of course generalize the graphical intuition for the case of more than two unknowns, in which case no graphs are possible...

V. Solution of linear systems


This part focuses on nding solutions for systems of linear equations. Again, it consists of some problems in the book plus a Matlab program that helps further explain some of these concepts. You may choose to run the Matlab program rst if that is more helpful to you. Work out problems 6.18, 6.24, 6.25 and 6.27 in the book. Use Matlab for problem 6.27. The Matlab portion is described below. 1. Consider the system of equations (or matrix equation) given below.

3 x a 5 4 2 1 y = 0 1 b z 1 10 8 (a) Let a = 1 and b = 2. Solve the system using Matlab. Use both the inverse of the matrix and the backslash operator methods. (b) Let a = 1 and b = 2. Solve the system by hand, using Gaussian elimination. Check if your answer agrees with part (a). (c) Let a = 0.5 and b = 6. Rewrite the system of equations. Does the system have a unique solution? (Hint: look at the rst and third equations.) Try to solve the system using Matlab. Copy the answers to your LTF. 3

2. Consider the matrix equation Ax = b dened below.


2 3 2 1 2 1 1 1 2 2 4 2

x1 x2 =

x3

1 4 2 8

Find x using Matlab. Is this system overdetermined or underdetermined? Does it have a unique solution?

Potrebbero piacerti anche