Willcox-Research-Group / rom-operator-inference-Python3

Operator Inference for data-driven, non-intrusive model reduction of dynamical systems.
https://willcox-research-group.github.io/rom-operator-inference-Python3
MIT License
66 stars 30 forks source link

Jacobians #36

Closed shanemcq18 closed 1 year ago

shanemcq18 commented 1 year ago

This PR implements jacobian() methods for nonparametric operator classes and all ROM classes. The Jacobian of a function f: R^n -> R^m is an n x m matrix whose (ij)th entry is d fi / dxj. For quadratic H[qq] and cubic G[qqq], we have

Jac(H)[q] = H[(Iq) + (qI)]

Jac(G)[q] = H[(Iqq) + (qIq) + (q ⊗ qI)].

The implementation is efficient (no Kronecker products) but requires storing an (r, r, r) or (r, r, r, r) array.

The Jacobian is used automatically in ContinuousOpInfROM.predict() when the specified method of scipy.integrate.solve_ivp() requires it (BDF, Radau, LSODA). This can result in huge speedups for stiff problems.