matlab求解逆矩阵_3

clear; clc;
n  = 40;
dt = 1e-12;

t  = linspace(0,2*pi,n)';
A  = rand(n);
temp = A';
A  = temp*A;
x0 = cos(t);
b  = A*x0;

H = -A;
F = dt * ( eye(n,n) + H*dt/2 + (H*dt)^2/6 + (H*dt)^3/24 );  % F(dt)
x = F * b;  % x0

x1 = x;
for i = 1 : 60
        T = expm(2^i*dt*H);
        x  = ( eye(n,n) + T ) * x;
end

x = 2 * x;
figure(1)
plot(t,x0,'-.',t,x,'o');

 

你可能感兴趣的:(数值分析)