MCPcopy Create free account
hub / github.com/casadi/casadi / expm

Method expm

test/python/function.py:1705–1718  ·  view source on GitHub ↗
(A)

Source from the content-addressed store, hash-verified

1703 Yb = np.random.random((n,2))
1704
1705 def expm(A):
1706
1707 n = A.shape[0]
1708 x = MX.sym('x',n)
1709 As = MX.sym('A',n,n)
1710
1711 dae = {'x':x,'p':vec(As),'ode':mtimes(As,x)}
1712 intg = integrator('intg','cvodes',dae,{'reltol':1e-14,'abstol':1e-14})
1713
1714 Intg = intg.map('identity','serial',n,[1],[])
1715
1716 out = Intg(x0=DM.eye(n),p=vec(As))
1717 expmF = Function('expm',[As],[out["xf"]])
1718 return expmF(A)
1719
1720 A = MX.sym("A",n,n)
1721 t = MX.sym("t")

Callers 1

test_expmMethod · 0.45

Calls 6

integratorFunction · 0.85
vecFunction · 0.50
FunctionClass · 0.50
symMethod · 0.45
mapMethod · 0.45
eyeMethod · 0.45

Tested by 1

test_expmMethod · 0.36