Using the procedure shown in Matrix Exponentiation , I have performed the calculation of the exponential matrix:
for the case of the first matrix, the result of the procedure matches the result returned by the function exp ():
08:22:59->>2×2 Array{Int64,2}:
1 -1
2 4
Julia>exp(A)
08:22:59->>2×2 Array{Float64,2}:
-5.30742 -12.6965
25.393 32.782
Julia>F=eigen(A)
08:22:59->>Eigen{Float64,Float64,Array{Float64,2},Array{Float64,1}}
values:
2-element Array{Float64,1}:
2.0
3.0
vectors:
2×2 Array{Float64,2}:
-0.707107 0.447214
0.707107 -0.894427
Julia>v=F.vectors
08:22:59->>2×2 Array{Float64,2}:
-0.707107 0.447214
0.707107 -0.894427
Julia>Λ=exp.(F.values)
08:22:59->>2-element Array{Float64,1}:
7.38905609893065
20.085536923187668
Julia>D=diagm(Λ)
08:22:59->>2×2 Array{Float64,2}:
7.38906 0.0
0.0 20.0855
Julia>v*D*inv(v)
08:22:59->>2×2 Array{Float64,2}:
-5.30742 -12.6965
25.393 32.782
But for the second matrix, the results do not match !!
I would like to know why and what I should do to obtain the expected result
Julia>C=[-0.4 -1;1 0.45]
08:27:43->>2×2 Array{Float64,2}:
-0.4 -1.0
1.0 0.45
Julia>exp(C)
08:27:43->>2×2 Array{Float64,2}:
0.254525 -0.890921
0.890921 1.01181
Julia>F=eigen(C)
08:27:43->>Eigen{Complex{Float64},Complex{Float64},Array{Complex{Float64},2},Array{Complex{Float64},1}}
values:
2-element Array{Complex{Float64},1}:
0.02499999999999991 - 0.9051933495115836im
0.02499999999999991 + 0.9051933495115836im
vectors:
2×2 Array{Complex{Float64},2}:
-0.30052-0.640068im -0.30052+0.640068im
0.707107-0.0im 0.707107+0.0im
Julia>v=F.vectors
08:27:43->>2×2 Array{Complex{Float64},2}:
-0.30052-0.640068im -0.30052+0.640068im
0.707107-0.0im 0.707107+0.0im
Julia>Λ=exp.(F.values)
08:27:43->>2-element Array{Complex{Float64},1}:
0.6331664487902933 - 0.8064560400308953im
0.6331664487902933 + 0.8064560400308953im
Julia>D=diagm(Λ)
08:27:43->>2×2 Array{Complex{Float64},2}:
0.633166-0.806456im 0.0+0.0im
0.0+0.0im 0.633166+0.806456im
Julia>v*D*inv(v)
08:27:43->>2×2 Array{Complex{Float64},2}:
0.254525+0.0im -0.890921+5.55112e-17im
0.890921-5.55112e-17im 1.01181-1.11022e-16im