Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trapping, extended to (a) enstrophy, and (b) local trapping #536

Merged
merged 100 commits into from
Jul 31, 2024

Conversation

Jacob-Stevens-Haas
Copy link
Member

@Jacob-Stevens-Haas Jacob-Stevens-Haas commented Jul 23, 2024

Here are the changes that Aland and Mai (and to a lesser extent, I) have been working on to expand trapping SINDy to local stability and, in parallel, to trapping enstrophy rather than just energy.

There are a few things to iron out, but I wanted to activate CI tests and merge conflict detection at this point

Remaining:

  • verify von karman trapping extended worked on the last commit pre-jake
  • Debug failing fits
    • Test out different rcond parameters (potentially refactor _update_coef_constraints to be generic equality-constrained least squares
    • Verify where mod_matrix is used in current iteration of trapping_extended vs previously
    • Check deeper into the math involved
  • Update notebooks to working python scripts
  • Update notebook tests to install requirements.txt if it exists skip experiment 8
  • Update doc build to correctly point to all elements of the example
  • Replace equations in docstring with rst math/inline-math blocks (::math .. and :math:)

Long term (after this PR, maybe not all)

  • move ConstrainedSR3/MIOSR constraints to fit
  • Have TrappingSR3 take a PolynomialLibrary as an argument; infer data-dependent params in fit().
  • Incorporate notebook metrics to trapping_sr3.py
  • Scrub warnings vs intended usage.
  • Change names of terms in _objective to be more diagnostically useful
  • Add test for inequality + equality constraints

Alan Kaptanoglu and others added 30 commits January 11, 2022 09:51
…s into single file (and objective function), fixed some test errors, fixed issue where trapping algorithm Qijk piece was slightly off (and reran notebooks).
…lambda machine. Rerunning the 9 mode von karman example is too intensive for my computer.
…so cleaned up the linting in trapping_sr3.py
…aping format needs to be fortran style. Added some of the examples from the dysts database, some of which dont seem to quite be behaving -- need to look closer at these. Importantly, added functionality in the code and in the example for including a bias (constant) term in the dynamical equations.
Jacob-Stevens-Haas and others added 21 commits June 1, 2024 22:59
Also: move m0 initialization to __init__, fix _objective calc
Merge changes from master into trapping_extended
May need to adjust correct way of testing inequality constraints
In Trapping algorithm, gradient (non-accelerated) descent
was stepping from the previous point.  However, this is
incorrect, and as the problem is nonconvex, was causing a lack of
convergence.
1. test that constraint implies PQW symmetry
2. test that PQW symmetry implies constraint
3. test that constraint matrix is full rank
4. add test for just the mixed double constraints

Currently, not all double constraints are being created, meaning that
2 is passing, but 1 and 3 are not.  4 is passing but for the rank test
…me code for computing PW now. Removed the option for accelerated prox grad descent since this seemed not to work very well anyways. Updated the trapping paper examples script. Everything now looks good except the constraint matrix is not quite right for the MHD case.
…solves the constraint breaking in the MHD case. The problem with the MHD case is the matrix is super ill conditioned.
Currently the enstrophy seems wrong.  Global trapping with enstrophy seems off,
and local trapping with enstrophy gives nonnegative As
Also gitignore some pdf outputs
Copy link

codecov bot commented Jul 23, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.

Project coverage is 94.31%. Comparing base (f2cdf2b) to head (94febf9).
Report is 16 commits behind head on master.

Files Patch % Lines
pysindy/optimizers/constrained_sr3.py 0.00% 1 Missing ⚠️
pysindy/optimizers/trapping_sr3.py 95.23% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #536      +/-   ##
==========================================
+ Coverage   94.05%   94.31%   +0.26%     
==========================================
  Files          38       37       -1     
  Lines        4157     4101      -56     
==========================================
- Hits         3910     3868      -42     
+ Misses        247      233      -14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Jacob-Stevens-Haas
Copy link
Member Author

I'm going to go ahead and merge this since others are starting to PR changes to master. Fixing the last bit can be done against the master branch, and we don't need to keep extra branches around.

@Jacob-Stevens-Haas Jacob-Stevens-Haas merged commit 889ac6d into master Jul 31, 2024
6 of 7 checks passed
@Jacob-Stevens-Haas Jacob-Stevens-Haas deleted the trapping_extended branch July 31, 2024 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants