4) Linear inversion: Consider the following system of 10 linear equations with 1
ID: 2259790 • Letter: 4
Question
4) Linear inversion: Consider the following system of 10 linear equations with 10 unknowns x:X10 2x1-x2-1 -x1 + 2x2-x3 = -X2 + 2X3-X4 = 1 x3 + 2x4-x5-1 x5 + 2x6-x7-1 a) Construct the matrices to represent this system of equations d = G m, where d and m are your vectors for the data and model parameters, and G is your coefficient matrix. G should have 2s along the main diagonal and -1 above and below the main diagonal. This kind of tridiagonal matrix arises in the finite difference solutions of differential equations. You can build this matrix manually, or use the diag function to construct the matrix. Hint: do the matrix multiplication of your G and m matrices bv hand to make sure your equations are the same as those above [3 pts] b) Solve the system for 'm' using inv explicitly, as well as the backslash operator [2 pts]Explanation / Answer
Matlab code:
A=[2 -1 0 0 0 0 0 0 0 0; -1 2 -1 0 0 0 0 0 0 0; 0 0 -1 2 -1 0 0 0 0 0;0 -1 2 -1 0 0 0 0 0 0; 0 0 -1 2 -1 0 0 0 0 0; 0 0 0 0 -1 2 -1 0 0 0; 0 0 0 0 0 -1 2 -1 0 0; 0 0 0 0 0 0 -1 2 -1 0;0 0 0 0 0 0 0 -1 2 -1;0 0 0 0 0 0 0 0 -1 2]
B=[1; 1; 1; 1; 1; 1; 1; 1; 1;1]
Ain=inv(A)
P1=Ain*B
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.