Question

Problem 1:

The matrix e^A is defined by the Mclaurin series

e^A=1+A/1!+A^2/2!+A^3/3!+........+A^n/n!

This computation can be quite difficult, as this problem illustrates.

a)Enter the function

function E=matexp(A)

E=zeros(size(A));

F=eye(size(A));

k=1;

while norm (E+F-E,1) > 0

E=E+F;

F=A*F/k;

k=k+a;

end

that estimates e^A using Mclaurin series.

b)Apply matexp to the matrix a=[99 -100; 137 -138] to obtaion matrix A_Mclaurin

c)A_Mclaurin is far from the correct result.ompute the true value of e^A using the MATLAB function expm as follows:

>>showdemo expmdemo

The function uses the Pade approximation

d)Explain why the result in part (b) is so far from the correct result. Use MATLAB help by typingProblem 1 The matrix exponential e is defined by the McLaurin series A A2 A n! This computation can be quite difficult, as th

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


%%Matlab code for matrix exponential by McLaurin series clear all close all %Here matrix A A-99-100; 137-138); tApplying mateEXPM Matrix exponential EXPM(A) is the matrix exponential of A and is computed using a scaling and squaring algorithm with a

%%Matlab code for matrix exponential by McLaurin series
clear all
close all


%Here matrix A
A=[99 -100; 137 -138];
%Applying matexp on A

[E,F,k]=matexp(A);
fprintf('A matrix is \n')
disp(A)

fprintf('Using matexp A_Maclaurin is \n')
disp(E)

fprintf('Using expm A_Maclaurin is \n')
A_true= expm(A);
disp(A_true)

help expm

%function for matrix exponential
function [E,F,k]=matexp(A)

    E = zeros(size(A));
    F = eye(size(A));
    k = 1;

    while norm(E+F-E,1) > 0

        E = E+F;
        F = A*F/k;
        k = k+1;

    end

end

%%%%%%%%%%%%%%%% End of Code %%%%%%%%%%%%%%%%
   

Add a comment
Know the answer?
Add Answer to:
Problem 1: The matrix e^A is defined by the Mclaurin series e^A=1+A/1!+A^2/2!+A^3/3!+........+A^n/n! This computation ca...
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
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