Question

SOMEONE PLEASE HELP ME WITH THIS QUESTION. THUMBS UP WITH BE GIVEN IF DONE CORRECTLY AND CLEARLY. Use MATLAB for both part a and b!!!! THANKS!!!!2-1 0 Pj [MATLAB] Consider the matrix A =-1 2-1 0-1 2 a) Compute the largest eigenvalue using a power iteration (y random) b)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Q a) Power Iterative

*********************power_iterative.m************************

A=[2 -1 0;-1 2 -1;0 -1 2];

y0=ones(3,1);
err=inf;
tol=1e-6;
iters=0;
max_iters=10000;
e=inf;
while(iters<max_iters)
e0=e;
y_new=A*y0;

e=max(y_new);

y_new=y_new./max(y_new);
y0=y_new;
  
err=e-e0;
if abs(err)<tol
break;
end
iters=iters+1;
end

fprintf('The dominant eigen value is %f\n',e);

Q b

*****************************inversePowerIterative.m************************

A=[2 -1 0;-1 2 -1;0 -1 2];

%A Matrix should not be singular

B=inv(A);
y0=ones(3,1);
err=inf;
tol=1e-6;
iters=0;
max_iters=10000;
e=inf;
while(iters<max_iters)
e0=e;
y_new=B*y0;

e=max(y_new);

y_new=y_new./max(y_new);
y0=y_new;
  
err=e-e0;
if abs(err)<tol
break;
end
iters=iters+1;
end
%e is the dominant eigen value in inverse matrix
% and 1/e is the least dominant eigen value in the original matrix
e=1/e;
fprintf('The least dominant eigen value is %f\n',e);

>PowerIterativeMethod The dominant eigen value is 3.414213 InversePowerIterative The least dominant eigen value is 0.585786

Add a comment
Know the answer?
Add Answer to:
SOMEONE PLEASE HELP ME WITH THIS QUESTION. THUMBS UP WITH BE GIVEN IF DONE CORRECTLY AND CLEARLY....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • please answer all three questions Guaranteed thumbs up if correct, thanks! Determine the largest eigenvalue of...

    please answer all three questions Guaranteed thumbs up if correct, thanks! Determine the largest eigenvalue of the 3 x 3 matrix 281 309 001 O a. 1 06.6 OC.A Od.2 QUESTION 2 Determine the larger eigenvalue of the linear transformation T(x,y) = (2x + 3y . x + 4y) O a.5 Ob.2 O c. 1 Od.4 QUESTION 3 Determine an eigenvector associated with the repeated eigenvalue of [ 1 1 L-13] 0-[i'] o»[1] oc[:'] o«[] Click Save and Submit to...

  • Can someone help me out with this. I can't get my MATLAB to do these correctly,...

    Can someone help me out with this. I can't get my MATLAB to do these correctly, thanks! Solve the following differential equations using the Matlab function "ode45”, ”ode23” or “ode 15s". For all cases use odeset to set the stats to on, so you can see the process for the solver. Plot your result. Use a legend on your plots. (a) y' =-2y y(0) = 5, tfinal = 2 (b) y" + 3 y' + 25 y = 0 y(0)...

  • can someone do this for me please ? Problem 3: Given a matrix A as follows...

    can someone do this for me please ? Problem 3: Given a matrix A as follows [1 2 0 A = 8 4 41 18 08 a) Use the Gerschgorin's Circle Theorem to determine a region containing all the eigenvalues of A. b) Find the dominant eigenvalue (1) and the corresponding eigenvector of matrix A using Power method. Use v) = [0,0,1)". Do calculation in 3 decimal points and take e = 0.01.

  • please answer the question FULLY and clearly for a thumbs up Given: A = AJ +...

    please answer the question FULLY and clearly for a thumbs up Given: A = AJ + B ↑ + C hz and the following commutation relations [ Ix, Jy ] = ih ] , [ I ] ] = {ħ fx, [ fz , ] ]=- iħ ly a) As briefly as possible show it is possible that eigen functions cand b can be given as: (=t? JCJ+1); b= ħk where r = 0, +1, +2.. IJON L J2Y =...

  • Please work out so I can verify I've done it correctly. Thanks 3. Consider a system...

    Please work out so I can verify I've done it correctly. Thanks 3. Consider a system with the following state equation h(t)] 1-2-1-3] 1x3(t)] 11 Use MATLAB to (a) Let 0-13x3 and solve the Lyapunov equation to find P matrix (use lyap command. Note that this command takes A and Q as its inputs, not A and Q) whether the state equation is asymptotically stable or not. eigenvalues. Does the result match your answer to part (b)? (b) Find the...

  • Please answer all parts of the question and clearly label them. Thanks in advance for all...

    Please answer all parts of the question and clearly label them. Thanks in advance for all the help. 5. An eigenvalue problem: (a) Obtain the eigenvalues, In, and eigenfunctions, Yn(x), for the eigenvalue problem: y" +1²y = 0 '(0) = 0 and y'(1) = 0. (5) Hint: This equation is similar to the cases considered in lecture except that the boundary conditions are different. Notice how each eigenvalue corresponds to one eigenfunction. In your solution, first consider 12 = 0,...

  • MATLAB QUESTION !!! PLEASE USE MATLAB FOR BOTH QUESTIONS!!! THANKS 3) Below is a matrix of...

    MATLAB QUESTION !!! PLEASE USE MATLAB FOR BOTH QUESTIONS!!! THANKS 3) Below is a matrix of random numbers. Find the mean, median, and mode of the matrix. B=[0 1 2 3 4 50689 23092 6 8 407] Sort Matrix Z so that the largest numbers of each row are in the first column and smallest numbers descend towards the last column. Must use sort function. 4) Create a matrix X so that the first row has values from 0 to...

  • Can you help me with this question please? For the code, please do it on MATLAB. Thanks

    Can you help me with this question please? For the code, please do it on MATLAB. Thanks 7. Bonus [3+3+4pts] Before answering this question, read the Google page rank article on Pi- azza in the 'General Resources' section. The Google page rank algorithm has a lot to do with the eigenvector corresponding to the largest eigenvalue of a so-called stochastic matrix, which describes the links between websites.2 Stochastic matrices have non-negative entries and each column sums to1, and one can...

  • Question 3 (covers Unit 6) - 25 marks . Your answers to part (a) of this question must be shown with your own work . P...

    Question 3 (covers Unit 6) - 25 marks . Your answers to part (a) of this question must be shown with your own work . Part (b) and (c) of this question are required you to use Mathcad to compute your solutions. You must submit a copy or attached a copy of your Mathcad solutions to your tutor for marking (a) Consider the following matrix 2 1 -2 A-0 5 0 (i) Find three eigenvalues λ of A. One of...

  • CAN SOMEONE PLEASE HELP ME WITH THIS RECITATION QUESTION (both related). PLEASE PROVIDE EXPLANATION. THUMBS UP...

    CAN SOMEONE PLEASE HELP ME WITH THIS RECITATION QUESTION (both related). PLEASE PROVIDE EXPLANATION. THUMBS UP WILL BE GIVEN. THANKSSS! 1. Step through Dijkstra's algorithm to calculate the order in which the vertices are visited from vertex A to all other vertices in the undirected graph given below. Then to calculate (a) the shortest path distance from A to all other vertex and (b) the corresponding path taken. 2 12 7 2 3 10 2. With an example show that...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT