- Consider
- Compute (by hand) the eigenvectors and eigenvalues of A.
- Construct the matrix T whose columns are the eigenvectors of A.
- Verify by direct computation that
- Compute
- Compute
- Solve
- Consider
- Compute (by hand) the characteristic equation of A that the eigenvalues of A satisfy. Using a computer, if necessary, determine the eigenvectors and eigenvalues of A.
- Construct the matrix T whose columns are the eigenvectors of A.
- Verify by direct computation that
- Compute
You may use a computer to compute the inverse of any matrix that has dimensions greater than 2 x 2.
- Compute
- Solve
- Solve
- Do problem 3 again but for when
.
Homework 10, due December 8, 2004.
-
- Site Admin
- Posts: 1596
- Joined: Tue Aug 24, 2004 4:54 pm
- Location: 376 Fitzpatrick
- Contact:
Homework 10, due December 8, 2004.
Last edited by goodwine on Thu Jun 15, 2006 4:35 pm, edited 1 time in total.
Re: Homework 10, due December 8, 2004.
"On the same plot, plot x1 versus x2 for 0 < t < 30."
...what are x1 and x2?
...what are x1 and x2?
-
- Site Admin
- Posts: 1596
- Joined: Tue Aug 24, 2004 4:54 pm
- Location: 376 Fitzpatrick
- Contact:
Re: Homework 10, due December 8, 2004.
x1 and x2 are the two componetnts of x, i.e., x=(x1,x2).mjesick wrote:"On the same plot, plot x1 versus x2 for 0 < t < 30."
...what are x1 and x2?
If it's still not clear, skim the first section of chapter 9 -- that's what this is leading up to.
Mathematica
I was checking my work on mathematica for problem #1. I got
but the computer gave
which is correct. and also when you do Exp[T^-1 *A*T] since T^-1 *A*T has some 0's in it, should Exp^0 be = 1, but in the notes you said you wanted it to be a diagonal matrix. Should Exp[T^-1 *A*T] contain 1's or 0's ??
Code: Select all
T=[1 1]
[0 1]
Code: Select all
T=[1 0]
[1 1]
-
- Site Admin
- Posts: 1596
- Joined: Tue Aug 24, 2004 4:54 pm
- Location: 376 Fitzpatrick
- Contact:
Re: Mathematica
exp(T^{-1} A T} has 0's in it.Grendel wrote:I was checking my work on mathematica for problem #1. I gotbut the computer gaveCode: Select all
T=[1 1] [0 1]
which is correct. and also when you do Exp[T^-1 *A*T] since T^-1 *A*T has some 0's in it, should Exp^0 be = 1, but in the notes you said you wanted it to be a diagonal matrix. Should Exp[T^-1 *A*T] contain 1's or 0's ??Code: Select all
T=[1 0] [1 1]
You don't want to think of it as exponentiating each term, but rather, because it's diagonal, when you compute all the powers in the series expansion for the matrix exponential, all the higher powers are diagonal as well.
With regard to T, I usually use Eigensystem in mathematica. That way I can pair the eigenvalues with the eigenvectors (they are printed in order).
Bill Goodwine, 376 Fitzpatrick
problem 1
I tried problem 1, got a different answer than a friend for T because he swapped the order of his eigenvalues (z1 was his z2) and it changed T from my (1 1),(0 1) to (1 1),(1 0) and mathematica gave us (1 0),(1 1)... what is the problem? this is the mathematica code i used:
In[4]:=
Eigenvectors[m1={{2 ,-1},{0,1}}]
Out[4]=
{{1,0},{1,1}}
In[4]:=
Eigenvectors[m1={{2 ,-1},{0,1}}]
Out[4]=
{{1,0},{1,1}}
-
- Site Admin
- Posts: 1596
- Joined: Tue Aug 24, 2004 4:54 pm
- Location: 376 Fitzpatrick
- Contact:
Re: problem 1
T may differ for different people if you choose the eigenvectors and eigenvalues in a different order (remember they come in pairs, though). Your final x(t) answer should be identical, though.acrutchf wrote:I tried problem 1, got a different answer than a friend for T because he swapped the order of his eigenvalues (z1 was his z2) and it changed T from my (1 1),(0 1) to (1 1),(1 0) and mathematica gave us (1 0),(1 1)... what is the problem? this is the mathematica code i used:
In[4]:=
Eigenvectors[m1={{2 ,-1},{0,1}}]
Out[4]=
{{1,0},{1,1}}
You may want to use Eigensystem[] in mathematica -- that gives both the eigenvalues and eigenvectors, and they are ordered so that the first eigenvalue goes with the first eigenvector, etc.
Bill Goodwine, 376 Fitzpatrick
Numbers 3, 4
I just wanted to clarify whats going on in problems 3 and 4. Does x(0) correspond to an initial point on the graph where the top number in the vector is x1 and the bottom number is x2? Also, is it acceptable to plot x1 vs. x2 by hand?....i'm not really sure how to do it using C or Mathematica....
mathematica
In Mathematica, I used
A = {{100, -90, -9}, {0, 10, -9}, {0, 0, 1}}
Eigenvalues[A]
{100,10,1}
T = Eigenvectors[A]
{{1,0,0},{1,1,0},{1,1,1}}
which is what I got by hand, but when I try to compute AT I get
A T
{{100,-90,-9},{0,10,0},{0,0,0}}, which is not what I get; Matlab gives me
{{1,1,1},{10,10,0},{100,0,0}}, which IS what I get.
I got the inverse of T, X to be the same as both programs
X = Inverse[T]
{{0,0,1},{0,1,-1},{1,-1,0}}
but again, Matlab says the same as I do for X*A*T, but Mathematica says
X A T
{{0,0,-9},{0,10,0},{0,0,0}}
Why does Mathematica give differnet answers?[/code]
A = {{100, -90, -9}, {0, 10, -9}, {0, 0, 1}}
Eigenvalues[A]
{100,10,1}
T = Eigenvectors[A]
{{1,0,0},{1,1,0},{1,1,1}}
which is what I got by hand, but when I try to compute AT I get
A T
{{100,-90,-9},{0,10,0},{0,0,0}}, which is not what I get; Matlab gives me
{{1,1,1},{10,10,0},{100,0,0}}, which IS what I get.
I got the inverse of T, X to be the same as both programs
X = Inverse[T]
{{0,0,1},{0,1,-1},{1,-1,0}}
but again, Matlab says the same as I do for X*A*T, but Mathematica says
X A T
{{0,0,-9},{0,10,0},{0,0,0}}
Why does Mathematica give differnet answers?[/code]
hello fellow student,
yeah, Mathematica's kind of tricky sometimes.
You'd think putting two matrices together then shift-entering would multiply them.
BUT NO! You have to use the "." notation.
You can download Mathematica 5 from OIT for windoze.
Start a matrix by hitting CTRL-SHIFT-C, use the palette, or find it in the menu.
Some nice shortcuts are shift-, and shift-enter for making new rows.
When I use the dot my AT multiplication comes out correctly. Make one matrix, type in a period, then another matrix.
Interesting.
Use the somewhat helpful help in the help menu, or pick up an old copy of "The Mathematica Book." (Stephen Wolfram- any version 2.0 and up ought to do.)
Hope that helps.
yeah, Mathematica's kind of tricky sometimes.
You'd think putting two matrices together then shift-entering would multiply them.
BUT NO! You have to use the "." notation.
You can download Mathematica 5 from OIT for windoze.
Start a matrix by hitting CTRL-SHIFT-C, use the palette, or find it in the menu.
Some nice shortcuts are shift-, and shift-enter for making new rows.
When I use the dot my AT multiplication comes out correctly. Make one matrix, type in a period, then another matrix.
Interesting.
Use the somewhat helpful help in the help menu, or pick up an old copy of "The Mathematica Book." (Stephen Wolfram- any version 2.0 and up ought to do.)
Hope that helps.
7,
My notes say e^(T^-1*A*T)t = a matrix with e^(lamba_n*t) as the diagonal entries.
If you're really smart (I'm not), then you followed exactly all the theory behind all this stuff and understand how we got that from the definition we had on an earlier day.
But that's why I show up for class and take notes
Look at your notes from Monday and Friday, I believe. It builds up the theory for raising a # to the power of a matrix.
Let me know if I'm right/wrong here on anything.
My notes say e^(T^-1*A*T)t = a matrix with e^(lamba_n*t) as the diagonal entries.
If you're really smart (I'm not), then you followed exactly all the theory behind all this stuff and understand how we got that from the definition we had on an earlier day.
But that's why I show up for class and take notes

Look at your notes from Monday and Friday, I believe. It builds up the theory for raising a # to the power of a matrix.
Let me know if I'm right/wrong here on anything.
-
- Site Admin
- Posts: 1596
- Joined: Tue Aug 24, 2004 4:54 pm
- Location: 376 Fitzpatrick
- Contact:
Re: Numbers 3, 4
Your interpretation is correct. You may plot it by hand as long as it's an accurate representation of the solution(s).PhillyPhan17 wrote:I just wanted to clarify whats going on in problems 3 and 4. Does x(0) correspond to an initial point on the graph where the top number in the vector is x1 and the bottom number is x2? Also, is it acceptable to plot x1 vs. x2 by hand?....i'm not really sure how to do it using C or Mathematica....
Bill Goodwine, 376 Fitzpatrick
-
- Site Admin
- Posts: 1596
- Joined: Tue Aug 24, 2004 4:54 pm
- Location: 376 Fitzpatrick
- Contact:
I'm sure there is an easy way to do this, but I don't know it. Sorry!kdormuth wrote:Is there a way, in MatLab, to input data directly into a function? For example, if I create a function, f(x,y) and I have a data set, data=(x,y) is there any way to input data directly into f when I call that function? ie f(data) = f(x,y)
Thanks!
-Kristin
Bill Goodwine, 376 Fitzpatrick
-
- Site Admin
- Posts: 1596
- Joined: Tue Aug 24, 2004 4:54 pm
- Location: 376 Fitzpatrick
- Contact:
Re: mathematica
If you set T = Eigenvalues[A], then the rows of T are the eigenvectors, not the columns. Do astudent wrote:In Mathematica, I used
A = {{100, -90, -9}, {0, 10, -9}, {0, 0, 1}}
Eigenvalues[A]
{100,10,1}
T = Eigenvectors[A]
{{1,0,0},{1,1,0},{1,1,1}}
which is what I got by hand, but when I try to compute AT I get
A T
{{100,-90,-9},{0,10,0},{0,0,0}}, which is not what I get; Matlab gives me
{{1,1,1},{10,10,0},{100,0,0}}, which IS what I get.
I got the inverse of T, X to be the same as both programs
X = Inverse[T]
{{0,0,1},{0,1,-1},{1,-1,0}}
but again, Matlab says the same as I do for X*A*T, but Mathematica says
X A T
{{0,0,-9},{0,10,0},{0,0,0}}
Why does Mathematica give differnet answers?[/code]
Code: Select all
T = Transpose[T]
Bill Goodwine, 376 Fitzpatrick
-
- Site Admin
- Posts: 1596
- Joined: Tue Aug 24, 2004 4:54 pm
- Location: 376 Fitzpatrick
- Contact:
Re: 3 and 4
In either matlab or mathematica, one way would be, once you have the answer, just to do a Do or for loop for t = 0 to 30 and put the x1, x2 values into an array. Then just plot the array.student wrote:Is there a better way to plot 3 and 4, such as using some Matlab/Mathematica/C code, or do I just calculate X(t) for all 16 points?
Bill Goodwine, 376 Fitzpatrick