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

Solver Robustness and Post-Processing Routines #18

Closed shanemcq18 closed 3 years ago

shanemcq18 commented 3 years ago

Improvements to the lstsq solver classes (lstsq._tikhonov.py).

Major improvement: lstsq.SolverTikhonov.predict() and lstsq.SolverTikhonovDecoupled.predict() attempt to solve the problem via the normal equations, (ATA + PTP)X = ATB. Though this problem is usually much smaller than the full system, it is notoriously ill conditioned if A has a high condition number (which it often does in OpInf). If the regularizer P is rank-deficient or not strong enough, then scipy.linalg.solve() can fail or give inaccurate results. If this is the case, the solvers now revert to solving the padded least-squares system [AT | PT ]T X = [BT 0T ]T with scipy.linalg.lstsq(), which handles the problem in a slightly slower but more stable way.

Other improvements/changes:

This also updates the package to version 1.2.1.