Repository navigation
Replies: 2 comments
|
In general, yes, adding more constraints can help. |
|
Short answer: for ODE systems like Lotka–Volterra you usually do not need to enforce conservation explicitly — the conserved quantity is a consequence of the equations, and a PINN that satisfies the ODEs on the whole domain automatically preserves it up to training error. Enforcing it explicitly is worth it when (a) the quantity is the thing you actually care about (e.g. a probability mass, so the solution stays physical), or (b) the residual error accumulates along long time horizons. Two tested patterns:
When NOT to bother: I tested the drift question on a stationary homogeneous problem where the scale is genuinely free — without any anchor the PINN collapses to the trivial scale (mass 0.0003, 99.97% error in the linked test), so there the constraint is essential, not cosmetic. For your ODEs, first train unconstrained and measure the conserved-quantity drift on a held-out dense grid; add the penalty only if the drift matters at your tolerance. Keeping the penalty weight moderate (the constraint is a regularizer) avoids degrading the ODE residual fit. |
Uh oh!
There was an error while loading. Please reload this page.
ODEs and PDEs usually have quantities that are conserved by the dynamics: For example consider the simple system
if$(x(t),v(t))$ is a solution of this system, then $E(t)=v^2/2+V(x)$ is constant in time with a value $E_0$ determined by the initial condition. To solve this with deepXDE I can (1) just enforce the system (*) in the loss function or (2) I can add an additional term to the loss function $(v^2/2+V(x)-E_0)^2$ .
Of course, more complicated systems may have multiple constraints and/or will satisfy additional equations. For example, if in the above system (*) I add a linear "friction" term$-v$ to the rhs of the second equation then the solution satisfies
My question is this: is it better to just solve the "barebone" system, or is it better to add as many additional constrains are known?
All reactions