Introduction to Matlab: Difference between revisions
From charlesreid1
| Line 105: | Line 105: | ||
\right] | \right] | ||
</math> | </math> | ||
What about the equations: | |||
<math> | |||
\begin{eqnarray} | |||
3x + 5y + z & = & 16 \\ | |||
2x - y - z & = & 3 \\ | |||
x + 4y - 2z &=& 3 | |||
\end{eqnarray} | |||
</math> | |||
How to represent this graphically? | |||
Instead of lines, use ''planes'' | |||
Let's look at the first 2 equations only: | |||
(Insert figure here) | |||
The two planes intersect to form a line | |||
Now the third equation: Also a plane | |||
The line that represents the intersection of these first two equations will intersect the third equation's plane at '''one''' point | |||
We can also represent these equations in matrix form: | |||
<math> | |||
\left[ \begin{array}{cc} 3 \\ 2 \\ 1 \end{array} \right] x | |||
+ \left[ \begin{array}{cc} 5 \\ -1 \\ 4 \end{array} \right] y | |||
+ \left[ \begin{array}{cc} 1 \\ -1 \\ -2 \end{array} \right] z | |||
= \left[ \begin{array}{cc} 16 \\ 3 \\ 3 \end{array} \right] | |||
</math> | |||
<math> | |||
\left[ | |||
\begin{array}{cc} | |||
3 & 5 & 1 \\ | |||
2 & -1 & -1 \\ | |||
1 & 4 & -2 | |||
\end{array} | |||
\right] | |||
\left[ | |||
\begin{array}{cc} | |||
x \\ | |||
y \\ | |||
z | |||
\end{array} | |||
\right] | |||
= | |||
\left[ | |||
\begin{array}{cc} | |||
16 \\ | |||
3 \\ | |||
3 | |||
\end{array} | |||
\right] | |||
</math> | |||
How do we represent 4 equations graphically? | |||
5 equations? | |||
6 equations? | |||
We run into a limit using graphical methods | |||
What about the matrix representation of 4 equations? 5 equations? 6 equations? | |||
The matrix representation is really easy | |||
Revision as of 19:53, 15 October 2010
1703 Lecture: Introduction to Matlab
$ x - 2y = 1 $
Can someone give me some values of x and y that satisfy this equation?
| x | y |
| 3 | 1 |
| 1 | 0 |
| 2 | $ \frac{1}{2} $ |
| 101 | 50 |
How many combinations of x and y will satisfy this equation? $ \infty $
How else can we represent this equation?
As a line:
(insert figure here)
Is the slope positive or negative?
What's the slope?
$ 3x + 2y = 11 $
Some values of x and y that satisfy this equation?
| x | y |
| 3 | 1 |
| 1 | 4 |
| 75 | -107 |
How many combinations of x and y will satisfy this equation? $ \infty $
We can also represent this equation as a line
(insert figure here - both lines on same plot)
What's the slope?
We can see that the point x=3, y=1 is where these two lines meet - which means it is the combination of x and y that satisfies both of these equations.
How else can we represent these equations?
In column form:
$ \left[ \begin{array}{cc} 1 \\ 3 \end{array} \right] x + \left[ \begin{array}{cc} -2 \\ 2 \end{array} \right] y = \left[ \begin{array}{cc} 1 \\ 11 \end{array} \right] $
After pushing these two columns together, we get:
$ \left[ \begin{array}{cc} 1 & -2 \\ 3 & 2 \end{array} \right] \left[ \begin{array}{cc} x \\ y \end{array} \right] = \left[ \begin{array}{cc} 1 \\ 11 \end{array} \right] $
What about the equations:
$ \begin{eqnarray} 3x + 5y + z & = & 16 \\ 2x - y - z & = & 3 \\ x + 4y - 2z &=& 3 \end{eqnarray} $
How to represent this graphically?
Instead of lines, use planes
Let's look at the first 2 equations only:
(Insert figure here)
The two planes intersect to form a line
Now the third equation: Also a plane
The line that represents the intersection of these first two equations will intersect the third equation's plane at one point
We can also represent these equations in matrix form:
$ \left[ \begin{array}{cc} 3 \\ 2 \\ 1 \end{array} \right] x + \left[ \begin{array}{cc} 5 \\ -1 \\ 4 \end{array} \right] y + \left[ \begin{array}{cc} 1 \\ -1 \\ -2 \end{array} \right] z = \left[ \begin{array}{cc} 16 \\ 3 \\ 3 \end{array} \right] $
$ \left[ \begin{array}{cc} 3 & 5 & 1 \\ 2 & -1 & -1 \\ 1 & 4 & -2 \end{array} \right] \left[ \begin{array}{cc} x \\ y \\ z \end{array} \right] = \left[ \begin{array}{cc} 16 \\ 3 \\ 3 \end{array} \right] $
How do we represent 4 equations graphically?
5 equations?
6 equations?
We run into a limit using graphical methods
What about the matrix representation of 4 equations? 5 equations? 6 equations?
The matrix representation is really easy