Skip to content

Restore compressible flow discovery in the PDE tutorial - #707

Open
antonsoo wants to merge 2 commits into
dynamicslab:mainfrom
antonsoo:fix/589-compressible-library
Open

antonsoo wants to merge 2 commits into
dynamicslab:mainfrom
antonsoo:fix/589-compressible-library

Conversation

@antonsoo

@antonsoo antonsoo commented Nov 4, 2026 •

Copy link
Copy Markdown

Related to #589. The current howto_PDE example cannot represent its own advection or continuity equations: its nonlinear library contains only reciprocals, so terms such as u u_1 and rho v_2 are absent. Inverting velocities also creates singular features where the flow crosses zero.

Include u, v, rho and only 1/rho. Match the simulator's periodic spatial boundaries, use 100 time samples to resolve the initial transient, and use the reported STLSQ setup for this nondimensional example. Correct the displayed variable-density equations and label density consistently. Regenerate and execute the paired notebook so the rendered tutorial includes the corrected code and results.

Executed the actual tutorial's data generation and both PDE fits on base and head. Both fits now select exactly the expected 14 coupled momentum/continuity terms, with no extras. The largest coefficient error is 8.73e-4 for PDE-FIND and 5.05e-3 for WeakSINDy. Both Burgers coefficient arrays remain exact in matched-seed source replays.

A separate NumPy periodic-difference implementation generates a flow with different initial phases and amplitudes and evaluates the learned equations against its RHS:

Learned equations Base relative RHS error Fixed
PDE-FIND 0.225 0.000149
WeakSINDy 12.0 0.00214

These are simulated-workload checks, not measured-fluid accuracy or a general discovery guarantee. The 2.1.0 version of the reporter's original library already recovers the expected terms with and without the stated noise; this PR repairs the separate configuration problem in the current tutorial and does not close the historical report.

The full tutorial script completes on its simulated data with open CVXPY solvers, including its later Trapping/plotting sections; those sections are smoke checks, not an accuracy claim. The project notebook test also passes, and 171 feature-library/weak-form checks pass with one skip. The standard full-suite attempt has the same 35 failing nodes on unchanged main and this head, primarily the installed GUROBI solver rejecting max_iter; the alternative environment cannot collect the full optimizer suite without optional MIOSR. Pre-commit passes. Strict Sphinx HTML builds complete without warnings on base and head.

Include velocity and density multipliers needed by advection and continuity. Invert only the strictly positive density, rather than velocities which cross zero. Match periodic spatial boundaries and resolve the early time transient. Use the STLSQ threshold from the reported workflow for this nondimensional example.

Correct the displayed variable-density equations and name the third state rho consistently. Related to dynamicslab#589.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-04T01:19:19.026028Z
We couldn’t complete this review. Comment @codex review to try again.
f58fdd9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

This branch has not been deployed

No deployments
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.

1 participant