This project contains the experimental framework for generating perturbations of nonlinear dynamical systems via a nominal Koopman operator, per "An MCMC Method for Uncertainty Set Generation via Operator-Theoretic Metrics," by A. Srinivasan and N. Takeishi, submitted to IEEE CDC.
Below is the library organization. To run any module, simply use python -m FOLDER.MODULE
.
├── sampler
│ ├── ugen.py # High-level MCMC procedure for uncertainty set generation
│ ├── hmc.py # PyTorch autograd-based Hamiltonian Monte Carlo for tensor-valued arguments with support for constraint-based reflection
│ ├── hmc_nuts.py # No U-Turn Sampler integrator for HMC (not used in experiments)
│ ├── hmc_parallel.py # Parallel HMC sampler from a specified prior over initial conditions
│ ├── kernel.py # Positive-definite kernel over dynamical systems (autograd-compliant implementation of Ishikawa et al., https://arxiv.org/abs/1805.12324)
│ ├── reflections.py # Various boundary conditions for HMC
│ ├── features.py # Observables & kernels for Koopman operator
│ ├── operators.py # Dynamic Mode Decomposition & variants
│ └── utils.py
├── experiments # Examples of uncertainty set generation for prediction & control (see sections below)
└── ...
Please see the below sections for usage of the above procedures and replication of numerical examples, from prediction to control.
- Configure candidate systems in
systems/lti2x2.py
- Run
python -m experiments.2x2_perturb
withmethod = 'discounted_kernel'
to generate an uncertainty set - Run
python -m experiments.2x2_plot
with the correct filename to produce trace-determinant plots
- Configure Duffing equation parameters in
experiments/duffing_perturb.py
(unforced only for poly obs.) - Run
python -m experiments.duffing_perturb
withmethod = kernel'
to generate perturbations - Run
python -m experiments.duffing_plot
to generate attractor basin visualizations
- Configure VDP parameters in
experiments/vdp_perturb.py
- Run
python -m experiments.vdp_perturb
withmethod = 'kernel'
ormethod = 'constrained_kernel'
to generate uncertainty set - Run
python -m experiments.vdp_plot
to show phase-space results.
- Compute a nominal Koopman operator for the system. (See
experiments/duffing_perturb.py
for an example using theObservable
class fromsampler/features.py
. Any algorithm can be used here, including kernel DMD.) - Call
sampler.ugen.perturb(...)
withmodel = my_koopman_op, method = 'kernel'
, and any other arguments specified in the file. - Adjust parameters of parallel HMC (
hmc_step
,hmc_leapfrog
,n_ics
,ic_step
,ic_leapfrog
) until the desired stationary distribution is reached (i.e. MCMC is adequately mixed;sampler.ugen.perturb()
will return the posterior distribution as its second result, which can be used for visual/numerical verification.) - Use the resulting uncertainty set for robust prediction & control.
We're still working on tuning the method to achieve cool improvements for model-predictive controllers facing heavy observation noise, please check back in later! Some preliminary results...