-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Polynomialization for ODEs #22
Conversation
Codecov Report
@@ Coverage Diff @@
## main #22 +/- ##
===========================================
- Coverage 92.96% 45.48% -47.48%
===========================================
Files 5 6 +1
Lines 199 299 +100
===========================================
- Hits 185 136 -49
- Misses 14 163 +149
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Very good work, this is going in a really nice direction. Just one thought: Why restrict to linear-quadratic models? It has been a while since I read the Willcox group papers on that but my understanding was that this choice was mostly motivated because it is the next best thing that is not linear and still "easy" (bookkeeping-wise). Of course any polynomial dynamical system can be lifted to quadratic form but a) it is not clear to me that that is better for performance than just projecting the polynomial model and b) there are differential-algebraic polynomial systems that cannot be lifted to quadratic form (IIRC one needs to go to cubic models in that case)! It seems to me that the hardest part about this is not to find the projection (for which case linear-quadratic would be easier than polynomial) but rather to find the immersion that maps the nonlinear system to a linear-quadratic one. It seems finding an immersion that maps to arbitrary polynomials could be easier to automate. Thoughts? Because if so, we might want to consider going for the general polynomial case instead. |
maybe @ChrisRackauckas has thoughts on this too |
True. Going for general polynomials is more practical. I will go this way. Thanks for pointing it out. Initially I wanted to make a quadratic-linear polynomialization because the papers of lift & learn and operator inference demonstrate the quadratic case |
WIP: changing to use term rewriter |
src/lift_learn.jl
Outdated
function change_variables(add::SymbolicUtils.Add)::SymbolicUtils.Symbolic | ||
add_dict = Dict() | ||
sizehint!(add_dict, length(add.dict)) | ||
for (term, coeff) in add.dict | ||
var = change_variables(term) | ||
add_dict[var] = coeff | ||
end | ||
return SymbolicUtils.Add(Real, add.coeff, add_dict) | ||
end | ||
|
||
function change_variables(mul::SymbolicUtils.Mul)::SymbolicUtils.Symbolic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to isadd
, ismul
, etc. due to Unityper.
preview of documentation https://bowenszhu.github.io/ModelOrderReduction.jl/previews/PR2/
Linear projection based methods transform states$x$ to a subspace via $x = Vz$ , but may still live in the $\mathcal O(n)$ space because of the nonlinear vector function $f$ , where $n$ is the number of variables $x$ in the full-order system.
Some methods add additional approximation for the nonlinear function, such as DEIM. Some methods were designed to deal with the nonlinear function by, for example, exploiting some special forms of$f$ in order to pass $V^T$ or $V$ through $f(\cdot)$ . Polynomial functions can be projected rather cheaply as $V^TB x \otimes x = V^TB (Vz) \otimes (Vz) = V^TB (V \otimes V)(z \otimes z)$ .
We aim to add a function, named
polynomialize
or, to transfer system to an expanded system consisting of onlyquadratic_polynomialization
constant, linear and quadratic termspolynomials without information loss. For exampleFurthermore, polynomialization facilitates methods of lift & learn, operator inference, more accurate computation of quadrature.
resolve #3