This MATLAB library solves equality constrained optimization problems in reduced space with derivative (1st and 2nd) based optimization computed via adjoints. In addition, it automatically enables hyper-differential sensitivity analysis with respect to model discrepancy.
File Structure¶
src/: Source code defining class interfaces and codes for outer loop analysis.
examples/: Applications / examples with real physics.
tests/: Unit tests and toy examples for verification.
docs/: Documentation.
Formatting MATLAB Code (Style Enforcement)¶
Code in this repository is formatted using the mh_style command line tool provided in the MISS_HIT package by Florian Schanda.
Installation¶
pip install miss_hitUsage¶
Use the following commands to format the MATLAB source code.
mh_style # List style problems in detail without changing any files.
mh_style --brief # List style problems briefly without changing any files.
mh_style --fix # Fix style problems, overwriting offending files.To ensure proper formatting before committing changes, install a git pre-commit hook with the following command.
cp .pre-commit-formatting-hook .git/hooks/pre-commitNow git commit automatically runs the formatter and cleans the code.
A commit is aborted if the formatter makes any changes; in this case, review / add the changes and commit again.
To run the formatter without a commit:
./.pre-commit-formatting-hook