
Last chance! 50% off unlimited learning
Sale ends in
expm(A, np = 128)
A
.Here this is achieved by taking G to be a circle and approximating the integral by the trapezoid rule.
Another more accurate and more reliable approach for computing these functions can be found in the R package `expm'.
R. B. Burckel (1979). An Introduction to Classical Complex Analysis, Vol. 1. Birkh"auser, Basel Stuttgart.
expm::expm
## The Ward test cases described in the help for expm::expm agree up to
## 10 digits with the values here and with results from Matlab's expm !
A <- matrix(c(-49, -64, 24, 31), 2, 2)
expm(A)
# -0.7357588 0.5518191
# -1.4715176 1.1036382
## System of linear differential equations: y' = M y (y = c(y1, y2, y3))
M <- matrix(c(2,-1,1, 0,3,-1, 2,1,3), 3, 3, byrow=TRUE)
M
C1 <- 0.5; C2 <- 1.0; C3 <- 1.5
t <- 2.0; Mt <- expm(t * M)
yt <- Mt
Run the code above in your browser using DataLab