chore(repo): close out project indexes and evidence boundaries

Add a canonical src package index, synchronize cross-project status and root navigation, and ignore local generated/runtime payloads while preserving the documented solver and evidence boundaries.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Frank14f
2026-08-09 22:32:55 +08:00
co-authored by Cursor
parent 86157c6f31
commit 140eea4d25
14 changed files with 638 additions and 2789 deletions
-452
View File
@@ -1,452 +0,0 @@
# Symbolic regression of learned flow-control policies
## 1. Purpose, evidence hierarchy and scope
The deep-reinforcement-learning (DRL) controllers used for hydrodynamic cloaking and illusion are effective, but their neural-network representation does not directly expose the control mechanism. Symbolic regression (SR) is therefore used as a post hoc policy-reduction method. The fitted expressions are empirical observation-to-action surrogates on states visited by PPO; they are not governing equations and are not identified directly from the Navier--Stokes equations.
This distinction matters in closed loop. A formula can reproduce PPO actions on a recorded trajectory and still alter the state distribution after deployment, accumulate phase error, develop an action bias, or destabilize CFD. Consequently, offline regression metrics are used to discover variables and topologies, whereas finite closed-loop CFD and trajectory similarity decide whether a candidate is useful. Term deletion and coefficient scaling then assess which parts of a deployed candidate matter.
The active software has three executable stages:
1. `stage_1_infer.py` collects contract-audited PPO trajectories;
2. `stage_2_fit.py` performs symbolic discovery and fixed-topology coefficient refitting;
3. `stage_3_validate.py` deploys PPO, symbolic, constant, or uncontrolled policies in CFD.
Within Stages 2--3, model selection has five phases: per-case discovery, within-objective joint discovery, topology freezing and coefficient refit, short and standard CFD screening, and term deletion/scaling. These phases are not additional software stages.
The fitted article evidence is deliberately narrower than the complete flow-control project. It contains four periodic Kármán-street cloaking policies and three cylinder-wake illusion policies. Kármán and illusion are never pooled into one regression. The disturbance-free steady scene is used only for post-selection calibration of the Kármán law. Transient-vortex, erase, V5, and historical SINDy analyses are outside the fitted evidence considered here.
Two evidence generations must remain separate:
- the **2026-07-18 primary evidence** contains the seven training trajectories, symbolic discovery, fixed-topology refits, 40-step screening, 200-step validation, and term tests;
- the **2026-07-20 coefficient-frozen extension** contains steady calibration, per-case diagnostic refits, 400-step duration tests, CSV exports, and pointwise unseen-condition deployments.
No extension condition participated in topology selection or coefficient estimation.
## 2. Physical labels, state contract and action units
### 2.1 Reynolds-number and target-size conventions
The inlet speed is \(U_0=0.01\) in lattice units and the pinball-cylinder diameter is \(D=20\). The historical Kármán scene names use a code Reynolds label based on the reference length \(2D=40\):
\[
Re_D=\frac{U_0D}{\nu}=\frac{\texttt{re\_code}}{2}.
\]
Thus `karman_re50`, `karman_re100`, `karman_re200`, and `karman_re400` denote \(\texttt{re\_code}=50,100,200,400\), corresponding to \(Re_D=25,50,100,200\). Both conventions must be stated whenever physical Reynolds numbers are compared.
The illusion scene names `illusion_0.75L`, `illusion_1L`, and `illusion_1.5L` are legacy target-size labels. Despite the historical configuration field name `target_diameter`, its value times \(L=20\) is passed to `LegacyCelerisLab.add_cylinder` as the cylinder **radius**. The labels are retained for provenance, but they must not be described as target-cylinder diameters.
The Kármán control sampling interval is 800 lattice steps. Illusion intervals are 400, 600, and 800 steps for the 0.75L, 1L, and 1.5L labels. With the convective scale \(D/U_0=2000\) lattice steps,
\[
\Delta t_c=\frac{\mathrm{sample\ interval}}{D/U_0},
\]
so the dimensionless control intervals are 0.4 for Kármán and 0.2, 0.3, and 0.4 for the three illusion scenes.
### 2.2 Native ordering
The canonical body and action order is
\[
(\mathrm{front},\mathrm{upper},\mathrm{lower}).
\]
The six downstream sensor channels are ordered
\[
(u_U,v_U,u_C,v_C,u_L,v_L),
\]
and the six force channels are
\[
(F_{x,F},F_{y,F},F_{x,U},F_{y,U},F_{x,L},F_{y,L}).
\]
This order follows the audited LegacyCelerisLab object IDs and force slots. It is not inferred from force signs. The runtime order gate is rerun after CFD or kernel changes because a silent slot permutation would change the physical meaning of every fitted coefficient.
### 2.3 PPO normalization and SR nondimensionalization
Two different transformations must not be conflated. PPO receives a clipped normalized observation: forces are divided by `force_norm_fact`, sensor velocities are centred by `sens_deviation` and divided by `sens_norm_fact`, and the result is clipped to \([-1,1]\). Illusion appends the normalized two-component target-cylinder force. The article trajectories use frozen existing normalization rather than recomputing normalization on each rollout.
SR does not fit these clipped PPO inputs. Recorded raw lattice data are converted to physical dimensionless features:
\[
\hat u=u/U_0,\qquad \hat v=v/U_0,
\]
\[
C_d=\frac{2F_x}{\rho U_0^2D},\qquad
C_l=\frac{2F_y}{\rho U_0^2D},
\]
with \(\rho=1\). The regression target is dimensionless cylinder surface velocity
\[
\boldsymbol{\alpha}_t
=\frac{\boldsymbol{\omega}_t}{U_0}
=(\alpha_{F,t},\alpha_{U,t},\alpha_{L,t})^{\mathsf T}.
\]
A PPO-normalized command is decoded before fitting as
\[
\boldsymbol{\alpha}
=s_a\mathbf a_{\mathrm{norm}}+\mathbf b_a.
\]
The Kármán action scale and bias are \(s_a=8\) and \((0,-4,4)\); the illusion values are \(s_a=4\) and \((0,-2,2)\). Stage 1 stores the normalized command, dimensionless \(\alpha\), and lattice \(\omega=U_0\alpha\), making unit conversion auditable.
## 3. Article trajectories and causal dataset
Seven new deterministic PPO trajectories were collected:
\[
\mathcal D_K=\{\texttt{re50},\texttt{re100},\texttt{re200},\texttt{re400}\},
\]
\[
\mathcal D_I=\{0.75L,1L,1.5L\}.
\]
Each trajectory contains 200 recorded post-action states. The causal contract is
\[
x_i\longmapsto\alpha_{i+1},
\]
named `causal_post_state_to_next_action`. At state \(x_i\), action-history features may use \(\alpha_i\) and \(\alpha_{i-1}\), but never a future action. The requirement for \(\alpha_{i+1}\) removes the final state and the two-row action-history warm-up removes indices 0 and 1, leaving state indices 2--198: 197 fitted rows per trajectory.
Every trajectory is aligned and split independently before stacking. The discovery split is contiguous 60/20/20% train, validation, and blind data; temporal rows are not randomly shuffled and boundaries never cross trajectories. The blind block is not fitted during topology discovery. After a topology has been frozen, its numerical constants are refitted on all eligible aligned rows. Therefore, the blind block protects topology selection but is no longer an untouched holdout after final refitting; final scientific acceptance comes from closed-loop CFD.
The PPO model was replayed on each stored causal state using the frozen observation normalization and decoder. All seven action sequences reproduced exactly. Historical and pre-contract trajectories remain available for diagnosis but are not pooled with the article dataset.
## 4. Candidate variables and reflection symmetry
### 4.1 Feature libraries
The `raw_complete` representation contains twelve variables: six dimensionless sensor velocities and the drag/lift coefficients of the front, upper, and lower cylinders.
The `symmetry` representation contains fourteen variables:
\[
(u_s,u_a,u_c,v_s,v_a,v_c,
C_{d,F},C_{d,\mathrm{rear},s},C_{d,\mathrm{rear},a},C_{d,\mathrm{tot}},
C_{l,F},C_{l,\mathrm{rear},s},C_{l,\mathrm{rear},a},C_{l,\mathrm{tot}}).
\]
The rear and sensor coordinates use half-sums and half-differences. For example,
\[
u_s=\frac{u_U+u_L}{2},\qquad
u_a=\frac{u_U-u_L}{2},
\]
\[
C_{d,\mathrm{rear},s}=\frac{C_{d,U}+C_{d,L}}{2},\qquad
C_{d,\mathrm{rear},a}=\frac{C_{d,U}-C_{d,L}}{2},
\]
with identical conventions for \(v\) and lift. This factor of one half is part of the formula contract: omitting it would rescale the reported coefficients.
Illusion discovery compares four controlled profiles:
- `actual_only`: actual-state variables only;
- `target_only`: target \(C_d\) and \(C_l\) only;
- `actual_plus_target`: actual state plus target force coefficients;
- `actual_plus_error`: actual state plus \(C_{d,\mathrm{tot}}-C_{d,\mathrm{target}}\) and \(C_{l,\mathrm{tot}}-C_{l,\mathrm{target}}\).
The article discovery does not add trigonometric phase coordinates or a manual bias column. PySR may still create numerical constants. Cross-correlation is never used to choose a feature lag.
### 4.2 Complete reflection map
Reflection \(G\) about the centreline exchanges upper and lower positions. Streamwise velocity is even, transverse velocity is odd, drag is even, and lift is odd. Thus upper/lower sensor and force slots are exchanged with the appropriate transverse/lift sign reversal. Front drag is even and front lift is odd. Target drag is even and target lift is odd. The same map is applied to any action history.
The native action transforms as
\[
G_a(\alpha_F,\alpha_U,\alpha_L)
=(-\alpha_F,-\alpha_L,-\alpha_U).
\]
Fit augmentation and deployment architecture are separate. G augmentation adds mirrored state-action rows during fitting. The final mapped-shared deployment imposes
\[
\operatorname{odd}[h](x)=\frac{h(x)-h(Gx)}{2},
\]
\[
\alpha_F(x)=\operatorname{odd}[h_F](x),\qquad
\alpha_U(x)=h_R(x),\qquad
\alpha_L(x)=-h_R(Gx).
\]
This is a physical inductive bias imposed on the symbolic controller. It does not establish exact PPO equivariance, and symmetrization may modify as well as simplify the PPO policy. Independent three-head fits are retained only as diagnostics of PPO structure.
## 5. Discovery, refitting and safety
### 5.1 PySR discovery
The discovery grammar uses binary \(+\), \(-\), and multiplication, with `square` as the unary operator. Search is deterministic and serial, without batching. The full defaults are 30 populations, population size 33, tournament size 10, maximum expression size 15, constant complexity 2, and parsimony 0.01. The bounded article discovery configuration (`--smoke`) uses two populations, population size 16, tournament size 4, and maximum size 7. At least three deterministic seeds are run per case/profile.
Only training blocks are fitted. Up to 25 retained Pareto candidates per head are evaluated on contiguous train, validation, and blind blocks using \(R^2\), MAE, RMSE, maximum error, complexity, and used variables. Static safety is a finite-value probe over sparse points spanning observed feature ranges; because no required output interval is supplied, it is not a global action-range guarantee.
Topology selection is a manual, evidence-based scientific step. It considers recurrence across seeds and cases, held-out diagnostics, complexity, finite static evaluation, compatibility with mapped-shared deployment, and CFD viability. PySR score or \(R^2\) never automatically promotes a formula, and an average cannot hide failure in one required scene.
### 5.2 Fixed-topology refit
After selecting a recurring topology, every numerical literal is replaced by a separate optimization parameter while operators and feature occurrences remain fixed. Constants are optimized with `scipy.optimize.least_squares`. Residuals use square-root sample weights so each case has equal total mass and trajectories within a case also have equal mass. Mapped-shared refits retain G augmentation. The artifact records initial/refitted constants, optimizer status, aggregate/per-case/per-trajectory metrics, discovery-parent path and hash, dataset hashes, feature order, action units, alignment, and deployment semantics.
Offline metrics describe PPO action imitation on PPO-visited states. They cannot be ranked directly against closed-loop DTW because symbolic deployment changes the state distribution.
### 5.3 Formula and CFD safety
Formula artifacts carry separate fitted/deployment expressions and hashes. Evaluation permits only declared features and a restricted function set, rejects unsupported syntax and variables, and performs a zero-state probe when Stage 3 loads a formula pair. Static finite probing is only a pre-screen.
Closed-loop safety is decisive. The symbolic policy maintains separate online feature histories for \(x\) and \(Gx\), initialized from the scene policy action. Every action and raw CFD observation is checked for finiteness. A failure retains partial telemetry, failed-step information, hashes, and the exception instead of overwriting the run. Candidates first receive a 40-step screen, then a 200-step standard validation. The 2026-07-20 extension adds 400-step tests without changing coefficients.
### 5.4 Legacy DTW metric
The only article metric is `legacy_dtw_v1_abs_n_unclipped`, recorded under `legacy_reference_cycle_vs_last_recorded_cycle`. For Kármán, `conv_len=30`; for illusion, `conv_len=36`. Lag is selected from transverse sensor channel 1 by cross-correlating target samples `conv_len:2*conv_len` with the final controlled `conv_len` samples. The complete target sequence is circularly shifted by that lag. Absolute, normalized, unclipped DTW similarity
\[
S_j=1-\frac{d_{\mathrm{DTW}}(y^{\mathrm{target}}_j,y^{\mathrm{controlled}}_j)}{N}
\]
is then computed independently for all six sensor channels, and the reported value is their arithmetic mean. One is ideal; the metric may be negative. Lag is a metric-alignment parameter, not a physical observation or actuation delay. The scalar score compares a reference cycle with the final recorded cycle; 400-step CSV convergence files are needed to inspect its evolution over duration.
## 6. Attempt ledger and selection lessons
Broad per-case searches showed heterogeneous Kármán formulas rather than a clean two-regime partition. Joint symmetry searches repeatedly selected front rear-drag asymmetry and a rear lift-plus-constant topology. For illusion, endpoint cases selected different variable families, motivating profile-controlled joint searches instead of a hand-reduced universal library.
Two illusion front topologies remained plausible offline. Topology A combined \(C_{d,\mathrm{rear},a}\) and \(C_{l,F}\). Topology B used \(C_{d,\mathrm{rear},s}C_{l,F}-C_{l,\mathrm{tot}}\). Topology B completed 40 steps at 0.75L with similarity 0.958889 and lag 7, but both 1L and 1.5L failed with `FloatingPointError: raw observation contains non-finite values`. Its formula-pair hash is `93615f0809c76d722a9cd781e08b23e1167a2004957964807a3d661f5c98ee38`. It was rejected, and its failures were retained. This is the clearest demonstration that an offline Pareto candidate and even one successful scene cannot substitute for all-case closed-loop screening.
Older pre-force-order formulas, round-one results, SINDy paths, V5 experiments, and archived Stage 4 figures remain historical or diagnostic. They are not alternative current entrypoints and their numbers are not imported into the article evidence.
## 7. Kármán-street cloaking results
### 7.1 Joint law and offline fit
The selected fixed-topology law is
\[
\boxed{\alpha_F(x)=\operatorname{odd}\!\left[-0.381391\,C_{d,\mathrm{rear},a}\right]},
\]
\[
\boxed{\alpha_U(x)=1.307782\,C_{l,\mathrm{rear},s}-3.431209,\qquad
\alpha_L(x)=-\alpha_U(Gx)}.
\]
The formula-pair hash is `a678f2019e0da7a0e1263f0c911b377106a668a6716ba93d6efd78f58de0a3f1`; the front and rear deployment-expression hashes are `367b5b7e...d4650` and `75207940...60f7`.
Aggregate offline metrics are:
- front head: \(R^2=0.5699\), MAE 0.8872, RMSE 1.1876, maximum error 3.1129;
- rear shared head: \(R^2=0.4363\), MAE 1.6187, RMSE 2.0608, maximum error 5.6964.
The per-case contrast is scientifically informative. Front \(R^2\) is 0.2488, 0.8671, 0.6100, and 0.8893 for the four code-Re labels. Rear \(R^2\) is -0.5315, 0.5666, 0.5483, and 0.2242. Re50 therefore has poor offline rear-action imitation but excellent closed-loop similarity, whereas Re400 has a strong front offline fit and the weakest standard closed-loop score. Offline action accuracy is not the control-performance ordering.
### 7.2 Standard and duration validation
The 200-step similarities at code labels Re50, Re100, Re200, and Re400 are 0.9543, 0.9427, 0.8560, and 0.7827. The shared law is strongest at lower/intermediate conditions and degrades at Re400; it is not a universal cross-Re law.
At 400 steps, similarities are 0.952178, 0.944339, 0.863850, and 0.833365. Every telemetry channel remains finite. The Re400 limitation is therefore not delayed numerical blow-up over this tested horizon, although one 400-step realization cannot establish statistical robustness.
### 7.3 Term deletion
Forty-step deletion tests provide the following sequence over Re50/Re100/Re200/Re400:
- delete front feedback: 0.939361 / 0.912182 / 0.881434 / 0.813289;
- remove rear lift feedback but retain the constant: 0.917126 / 0.869943 / 0.825250 / 0.789535;
- remove the rear constant but retain lift feedback: 0.839344 / 0.817735 / 0.708089 / 0.647401.
Within this short ablation horizon, the supported ordering is
\[
\text{rear constant}>\text{rear lift feedback}>\text{tested front feedback}.
\]
The persistent rear counter-rotation is therefore the dominant tested controller component. Its interpretation as downstream-deficit compensation is consistent with the expected gap-flow and momentum correction, but SR alone does not observe the spatial momentum field and does not prove causality.
### 7.4 Per-case fixed-topology diagnostics
Refitting the same topology separately gives \((a,b,c)\) in \(\alpha_F=-aC_{d,\mathrm{rear},a}\), \(\alpha_U=bC_{l,\mathrm{rear},s}-c\):
- Re50: (0.5836, 0.2212, 3.5820), rear \(R^2=0.0221\);
- Re100: (0.3248, 1.3203, 4.1774), rear \(R^2=0.7131\);
- Re200: (0.5003, 1.6971, 3.4109), rear \(R^2=0.5788\);
- Re400: (0.2947, 1.0549, 2.5545), rear \(R^2=0.3285\).
The coefficients vary non-monotonically and do not support a clean low/high-Re split. These fits are offline diagnostics and were not promoted as independent closed-loop controllers.
### 7.5 Steady calibration
A disturbance-free pinball independently calibrates the order of magnitude of the rear constant. A discrete constant counter-rotation sweep \(A=0,1,\ldots,6\), with rear commands \((-A,+A)\), gives similarities 0.631830, 0.723858, 0.857286, 0.955029, 0.976376, 0.987212, and 0.978674. Thus \(A=5\) is the best **sampled** value, not a continuously optimized value.
The Kármán law in the same steady scene gives similarity 0.966494. Its final-cycle mean actions are -0.000563, -3.430589, and 3.431828 for front, upper, and lower, consistent with its analytical constant magnitude 3.431209. The fitted value is about 68.6% of the sampled \(5U_0\) optimum. This establishes scale consistency between the learned constant and useful steady compensation; it is not an equality between wake velocity deficit, momentum deficit, and cylinder surface speed.
### 7.6 Pointwise unseen-Re extension
Without coefficient retuning, 200-step deployments at code labels Re25, Re70, Re150, and Re300 give 0.988078, 0.954339, 0.907496, and 0.835758. Re70/Re150/Re300 are interpolation points within the fitted code-label range; Re25 is one low-Re extrapolation. The results show finite pointwise deployment at these sampled configurations only. There is no high-Re extrapolation above Re400, no continuous coefficient law, and no repeated-initial-condition uncertainty estimate.
## 8. Illusion results
### 8.1 Per-size discovery and selected law
Broad discovery changes systematically across legacy target-size labels. At 0.75L, \(C_{d,\mathrm{rear},a}\) and \(C_{d,\mathrm{rear},s}\) appear 15 and 10 times across audited heads. The 1L searches are mixed/transitional, led by \(C_{d,F}\) (13) and \(C_{l,\mathrm{rear},s}\) (12). At 1.5L, \(C_{l,F}\) and \(C_{l,\mathrm{rear},s}\) appear 54 and 46 times, showing a lift-contrast-dominated endpoint.
The stable joint numerical candidate is
\[
\boxed{\alpha_F(x)=\operatorname{odd}\!\left[-1.826604\,C_{d,\mathrm{rear},a}+2.064493\,C_{l,F}\right]},
\]
\[
\boxed{\alpha_U(x)=1.254440\,C_{d,\mathrm{rear},a}-1.528074\,C_{l,F},\qquad
\alpha_L(x)=-\alpha_U(Gx)}.
\]
Its formula-pair hash is `ae67ae5071065b7ee8412791ee1841011530746865528641beddb1a203c51b83`; front/rear expression hashes are `1df7c515...0487` and `485de2ca...b8e8`.
### 8.2 Offline fit versus closed-loop performance
Aggregate offline metrics are:
- front head: \(R^2=0.4851\), MAE 1.3075, RMSE 1.9726, maximum error 6.6080;
- rear shared head: \(R^2=0.3598\), MAE 1.3347, RMSE 1.5823, maximum error 5.1284.
Per-case front \(R^2\) is 0.5850, -1.7176, and 0.5054 for 0.75L, 1L, and 1.5L; rear \(R^2\) is -5.7162, -12.5115, and 0.5923. The negative values must be retained: the candidate is not a uniformly accurate PPO action surrogate.
Nevertheless, 200-step closed-loop similarities are 0.8749, 0.9217, and 0.8306. At 400 steps they are 0.854379, 0.915609, and 0.833587, with finite telemetry. Closed-loop viability despite weak offline action fit again demonstrates that the deployed controller cannot be selected by \(R^2\) alone.
### 8.3 Per-size fixed-topology diagnostics
Separate refits produce:
- 0.75L front: \(-0.2420C_{d,\mathrm{rear},a}-0.8373C_{l,F}\), \(R^2=0.8035\); rear: \(0.2486C_{d,\mathrm{rear},a}+0.0829C_{l,F}\), \(R^2=-5.4396\);
- 1L front: \(2.0438C_{d,\mathrm{rear},a}-2.2193C_{l,F}\), \(R^2=0.6060\); rear: \(0.1843C_{d,\mathrm{rear},a}-0.1588C_{l,F}\), \(R^2=-11.2480\);
- 1.5L front: \(-0.0441C_{d,\mathrm{rear},a}+2.1015C_{l,F}\), \(R^2=0.5421\); rear: \(1.5683C_{d,\mathrm{rear},a}-1.6011C_{l,F}\), \(R^2=0.5948\).
The 1.5L front is nearly pure front-lift feedback and its rear coefficients are roughly an order of magnitude larger than the poorly identified smaller-target rear fits. Sign changes and very negative smaller-target rear \(R^2\) values prevent promotion of a clean two-group coefficient mechanism. These are diagnostics of the compromise made by a shared static topology.
### 8.4 Deletion and non-uniqueness
All four one-term deletion variants completed 40 steps. For 0.75L/1L/1.5L:
- delete first front term: 0.939375 / 0.933481 / 0.885085;
- delete second front term: 0.960067 / 0.927035 / 0.836563;
- delete first rear term: 0.954488 / 0.936851 / 0.887603;
- delete second rear term: 0.954641 / 0.930454 / 0.850816.
Thirty-seven preregistered coefficient-scaling shadow variants remained finite. The \(C_{l,F}\) terms dominate action-amplitude sensitivity, while \(C_{d,\mathrm{rear},a}\) is weaker and partly replaceable. Because all one-term deletions remain stable and differences are modest over 40 steps, the four-term expression is not unique and no individual term is established as universally necessary.
Target and error variables were available but did not recur in the selected low-complexity static topology. This is negative evidence against claiming explicit target tracking; it is not proof that target information is physically irrelevant. Target phase may be aliased into PPO-visited forces, may require memory, or may enter differently across size regimes.
### 8.5 Pointwise unseen-size extension
Coefficient-frozen 200-step interpolation at 0.8L and 1.2L gives 0.884573 and 0.925530. Extrapolation at 0.5L, 0.6L, and 2L gives 0.784055, 0.821103, and 0.756880. Every sampled run completes, but degradation toward the extremes is clear. These are single pointwise realizations and do not define a universal target-size law.
The defensible illusion conclusion is therefore narrower than for Kármán: a shared symmetric numerical controller exists over the tested family, with 1.5L a structurally different boundary regime, but the present static law does not identify a unique target-dependent mechanism.
## 9. SR-to-OID/CCD handover
SR identifies actuator-side observation-to-action structure. It does not identify where the corresponding flow correction is located. The handover to OID/CCD is therefore a ranked, falsifiable target list rather than a claim that the structures have already been found.
For Kármán:
1. **Rear steady counter-rotation, strongest evidence.** OID should search for a reflection-symmetric streamwise correction generated in the rear gap and retained at the sensor station. CCD should quantify the rear-pair relation to the mean/low-frequency downstream deficit mode.
2. **Symmetric rear lift feedback, moderate evidence.** Coefficients vary from 0.22 to 1.70, so the term is a condition-dependent modulation rather than a universal gain. Seek a rear-cylinder force-correlated source and lagged downstream descendant.
3. **Rear drag asymmetry in front action, weak evidence.** Test an antisymmetric near-front structure and expect weaker downstream canonical correlation.
For illusion:
1. **Front lift, moderate evidence.** Compare front-body source structures across target-size labels and test whether descendants change wavelength or phase.
2. **Rear drag asymmetry, weak-to-moderate evidence.** Search for antisymmetric rear-gap structures, explicitly contrasting 1.5L with smaller labels.
3. **Absence of explicit target/error terms, negative evidence.** Use lagged and phase-resolved analyses because static obs--act regression can alias memory or phase into force observations.
For every element, actuator-to-source and source-to-downstream relations must be reported separately; upper/lower parity must be preserved; lag must be stated in \(D/U_0\); and spatial coincidence must not be promoted to causality without time-lagged evidence. Agreement between SR ranking and OID/CCD correlation is convergent evidence. Contradictions must be retained and used to revise the interpretation rather than forcing agreement.
## 10. Limitations and claim discipline
The analysis has the following explicit limitations.
1. There is one 200-step PPO trajectory per fitted case. PySR seed recurrence is not recurrence over independent PPO or CFD trajectories.
2. Temporal rows are correlated; 197 rows are not 197 independent flow realizations.
3. The symbolic grammar, complexity bound, population settings, and finite seed count do not establish a global symbolic optimum.
4. Exact reflection symmetry is imposed, not discovered, and may modify the original PPO.
5. The selected laws are static and instantaneous. They cannot represent explicit memory, and failure to select target variables does not show memory or target information is unnecessary.
6. All eligible rows are reused after topology freezing, so final coefficient metrics are not a fully blind estimate.
7. The standard and extension runs report one deterministic realization per condition; no repeated-initial-phase or disturbance uncertainty interval is available.
8. The DTW result depends on the selected reference/final-cycle window and lag alignment, is not a full-field metric, and cannot prove mechanism identity.
9. Generalization is pointwise over sampled Reynolds labels and target sizes. Geometry perturbations, sensor noise, actuator mismatch, altered sampling, and other disturbances are untested.
10. No preregistered scalar DTW success threshold exists. Finiteness is a hard gate, while performance language is relative and case-specific.
11. There is no transient-vortex SR evidence in the current fitted package.
12. The steady sweep does not establish a momentum-balance equality or a continuous optimum.
13. OID/CCD causal structures are future/independent evidence, not present SR results.
Accordingly, the evidence **establishes** a reproducible discovery-to-CFD workflow, the dominance of the rear constant within the tested Kármán law, secondary short-horizon value of rear lift feedback, a finite shared illusion numerical candidate, and the inadequacy of offline fit alone for controller selection. It **supports, with bounded scope**, a shared Kármán backbone over tested conditions and finite pointwise extension performance. It does **not establish** uniqueness, universality, explicit illusion target tracking, necessity of every illusion term, physical delay from DTW lag, or causal deficit compensation without field-level analysis.
## 11. Reproducibility and evidence map
### 11.1 Environments and resources
Stage 1, policy replay, and Stage 3 use conda environment `pycuda_3_10`. PySR discovery and numerical refitting use `sr_env`. CFD runs are strictly serialized on physical GPU 2. With `CUDA_VISIBLE_DEVICES=2`, scripts use logical device 0; provenance records visibility and GPU identity. Run IDs are immutable and failure telemetry is retained.
At the 2026-07-21 final-consolidation revision, the CPU contract suite is run from the repository root with:
```bash
PYTHONPATH=src conda run -n sr_env python -m pytest \
src/SR_analysis/tests tests/test_stage_3_validate.py -q
```
The expected result at the 2026-07-21 plotting-package revision is 88 passed tests. This count is revision-specific rather than a timeless scientific result.
### 11.2 Primary and extension packages
The primary evidence index is:
```text
src/SR_analysis/results/runs/article-joint-sr-final-20260718/
readable_summary.txt
evidence_manifest.json
```
The coefficient-frozen extension is indexed by:
```text
src/SR_analysis/results/runs/article2-sr-elements-20260720/
src/SR_analysis/results/runs/article2-steady-analysis-20260720/
src/SR_analysis/results/runs/article2-percase-refit-summary-20260720/
src/SR_analysis/results/runs/article2-generalization-summary-20260720/
```
Standard-duration PPO/SR/target CSVs, including wide/long tables and DTW convergence, are under `article2-timeseries-csv-20260720/`. Four-hundred-step SR/target exports are under `article2-long-timeseries-csv-20260720/`.
### 11.3 Stable identities
The archived fitting Git SHA is `ca8ee5f238ee58eaaf48027ad026c35784f76d4d`. Kármán and illusion dataset hashes are respectively
```text
dcbfdaaa48a61bd904bb540f3067760530bd69e88ce87d54110a79ecc54b79d6
50c1d9f95bd72afc14e2d06a205bf4432672224ebf7daeb442ea6c517fbd9ab7
```
Formula-pair hashes are
```text
Karman: a678f2019e0da7a0e1263f0c911b377106a668a6716ba93d6efd78f58de0a3f1
Illusion: ae67ae5071065b7ee8412791ee1841011530746865528641beddb1a203c51b83
```
Formula JSON files carry exact commands, parent hashes, feature order, expression hashes, optimizer state, environment, and offline metrics. Validation JSON files carry formula/configuration hashes, metric details, GPU identity, telemetry hash, termination, and record hash. `scene_registry.json` is not the authority for current article evidence, and integrity auditing does not automatically promote a candidate.
## 12. Final paper-level conclusion
The Kármán analysis provides the strongest mechanism-oriented SR result. A persistent rear-pair counter-rotation is the dominant tested component; rear symmetric-lift feedback gives secondary short-horizon value; the tested front correction is weak. The constant has the same physical order as independently useful steady counter-rotation, which is consistent with a wake-deficit-compensation hypothesis. Spatial momentum correction and causality remain for OID/CCD, and reduced Re400 performance prevents a universal-law claim.
The illusion analysis provides a stable shared symmetric numerical controller but not a unique target-tracking mechanism. Front-lift terms dominate action sensitivity, drag-asymmetry terms are partly replaceable, and 1.5L is a distinct boundary regime. Static target/error variables were not selected robustly, so further mechanism work should use controlled target-aware dynamic structures and independent field decomposition rather than broader unconstrained symbolic searches.
The general methodological conclusion is that SR in closed-loop flow control should be treated as hypothesis generation plus deployment testing. Formula compactness and offline fit identify candidates; CFD stability, trajectory similarity, ablation, and independent flow-field evidence determine what can be interpreted physically.
-292
View File
@@ -1,292 +0,0 @@
# OID Analysis: Correction-Field Structure Diagnosis Results
> Date: 2026-06-15
> Project: DynamisLab -- Active hydrodynamic cloaking and illusion using DRL on a fluidic pinball.
> Analysis pipeline: OID (Observable-Inferred Decomposition) on correction fields (Delta-q_ctl).
---
## Executive Summary
Four key findings from the OID analysis pipeline:
1. **Force-relevant and signature-relevant correction structures systematically separate** across control tasks. In steady cloak, they are highly related (cosine similarity = 0.763); in Karman cloak, nearly orthogonal (-0.034); in illusion, increasingly anti-correlated as target diameter grows (from -0.082 to -0.932). This is the most striking result of the analysis.
2. **OID consistently and substantially outperforms POD** for predicting both force and future sensor signature. Across all periodic scenes, OID achieves R2 = 0.315-0.750 with 2 coordinates, while POD achieves R2 = -2.4 to 0.418. The success criterion ("m<=3 OID beats m<=3 POD") is satisfied for every scene.
3. **The separation is robust.** POD rank sensitivity tests (r=6,8,10,12,16) confirm Karman and illusion 1.0L/1.5L are very stable. Karman's force-sig separation is insensitive to the choice of convective delay tau_c (overlap ranges 0.11-0.31 across 10 different delays). The one exception is illusion 0.75L, which shows rank sensitivity and needs more data.
4. **OID coordinates are not control states.** Force-OID coordinates capture only 22.5% of action variance (vs 95.6% for raw sensor observations). This is expected and appropriate: OID identifies structures most relevant to forces and signatures, not to actions. Action-related coordinates require a separate causal-PCD analysis.
---
## 1. OID: What It Is and Why
### 1.1 The Problem with POD
Standard POD (Proper Orthogonal Decomposition) ranks flow structures by their **fluctuation energy**. The highest-energy modes capture the most "energetic" features of the flow -- typically the von Karman vortex shedding pair. But the DRL controller's objective is not "maximize energy" or "minimize energy." It is to match a downstream sensor signature, which may involve flow structures that are not the most energetic.
POD provides a useful unified coordinate system, but its ranking is by energy, not by task relevance.
### 1.2 The OID Idea
OID (Observable-Inferred Decomposition, Schlegel et al. 2012) is a generalization of POD that finds flow structures most correlated with a chosen **observable** of interest (e.g., total force, sensor error). The idea is:
1. Start with a POD coordinate system (the unified basis)
2. Choose an observable Y (e.g., total lift force, delayed sensor error)
3. Compute the cross-covariance matrix between POD coefficients A and observable Y
4. Perform SVD on this cross-covariance: `C_AY = U @ Sigma @ V.T`
5. The columns of U define directions in POD space that best predict the observable
The OID coordinates are:
```
z(t) = A(t) @ U
```
This is a simple rotation of the POD subspace. The singular values in Sigma tell us how much observable-relevant information each OID direction captures. The spatial modes are linear combinations of POD modes:
```
phi_k_OID(x,y) = sum_j U_{jk} * phi_j_POD(x,y)
```
### 1.3 The Correction-Field Preprocessing
Before OID, we must separate what the controller actually changed from what the flow inherently does. For each scene we construct three fields:
- **q_in**: Incident reference field (empty channel, or vortex street only)
- **q_blk**: Fixed pinball field (pinball present, zero rotation, natural shedding)
- **q_ctl**: Controlled pinball field (DRL policy active)
The two derived difference fields are:
- **Delta_q_blk = q_blk - q_in**: What the pinball's geometry does (passive blockage)
- **Delta_q_ctl = q_ctl - q_blk**: What the controller additionally does (active correction)
OID operates on Delta_q_ctl (the active correction), NOT on the raw controlled field. This separation prevents mixing up "structures that were already there" (inherent shedding) with "structures the controller introduced."
### 1.4 The OID Pipeline
```
Full field snapshots (500 steps)
|
v
Three-field decomposition: q_in, q_blk, q_ctl
|
v
Correction field: Delta_q_ctl = q_ctl - q_blk
|
v
POD on Delta_q_ctl -> coefficients A(t), modes phi(x,y)
(rank sensitivity: r=6,8,10,12,16)
|
v
Choose observable Y:
- Force-OID: Y = total force [Fx, Fy]
- Signature-OID: Y = delayed sensor error e_s(t + tau_c)
- Suppression-OID (steady only): Y = RMS fluctuation
|
v
Cross-covariance SVD: C_AY = (1/N) A^T Y = U Sigma V^T
|
v
OID coordinates: z(t) = A(t) @ U
OID modes: psi_k = sum_j U_{jk} * phi_j
```
### 1.5 Scene Setup
| Scene | Inflow | Uncontrolled | Controlled | SI | Action bias |
|-------|--------|-------------|------------|----|-------------|
| Steady cloak | Parabolic (uniform) | Pinball natural shedding | Rear cylinders at constant +-5.1U0 | 800 | [0, -5.1, 5.1] |
| Karman cloak | Upstream vortex street | Pinball disrupts street | PPO periodic rotation (d1a3o12_re100) | 800 | [0, -4, 4] |
| Illusion 0.75L | Parabolic | Pinball natural shedding | PPO (d1a3o14_075L_2U_400S) | 400 | [0, -2, 2] |
| Illusion 1.0L | Parabolic | Pinball natural shedding | PPO (d1a3o14_1L_2U_600S) | 600 | [0, -2, 2] |
| Illusion 1.5L | Parabolic | Pinball natural shedding | PPO (d1a3o14_15L_2U) | 800 | [0, -2, 2] |
System: 2D channel flow (1280x512 grid, 3 rotating cylinders, Re=100 code = Re_D=50 physical).
All models: PPO with Sin activation, SB3, 64x64 hidden layers.
---
## 2. Core Result: Force-vs-Signature Systematic Separation
### 2.1 The Monotonic Trend
**Figure 1** (the flagship figure) shows the cosine similarity between force-OID mode 1 and signature-OID mode 1 across all five scenes:
![Figure 1](src/OID_analysis/data/derived/figures/fig1_force_sig_overlap.png)
*File: `src/OID_analysis/data/derived/figures/fig1_force_sig_overlap.png`*
**Panel (a)** shows the signed overlap. A cosine similarity of +1 means the two modes point in identical directions; 0 means orthogonal; -1 means opposite directions.
**Panel (b)** shows the absolute overlap with three interpretation zones color-coded: green (same channel, |overlap| > 0.7), orange (partial separation, 0.3-0.7), red (orthogonal/separated, < 0.3). The gray arrow highlights the monotonic trend.
The trend is remarkably clean:
| Scene | Signed overlap | Separation level |
|-------|---------------|-----------------|
| Steady cloak | **+0.763** | Same channel |
| Karman cloak | **-0.034** | Nearly orthogonal |
| Illusion 0.75L | **-0.082** | Near-orthogonal |
| Illusion 1.0L | **-0.495** | Moderate separation |
| Illusion 1.5L | **-0.932** | Strongly opposite |
**Physical interpretation**: The DRL controller does not engage the same flow structures for all tasks:
- **Steady cloak**: The goal is to suppress natural shedding. Suppressing shedding IS suppressing force, so both objectives engage the same correction structures.
- **Karman cloak**: The goal is to let the incoming vortex street pass through undisturbed. The correction structures that preserve the street are orthogonal to those that would maximally alter the force. The controller must "stay out of the way" of natural force-generating modes.
- **Illusion**: The goal is to generate a target shedding pattern different from natural pinball shedding. Force-OID finds structures that modify the natural force, while signature-OID finds structures that generate the target frequency. These are increasingly different -- and eventually opposite -- as the target deviates further from the natural scale.
This monotonic trend from +0.763 through -0.034 to -0.932 is the most compelling evidence that **force-relevant and signature-relevant correction structures are not the same, and their divergence quantifies task difficulty**.
---
## 3. Robustness of the Core Result
### 3.1 POD Rank Sensitivity
**Figure 2** shows how the force-sig overlap changes when the POD truncation rank varies from 6 to 16:
![Figure 2](src/OID_analysis/data/derived/figures/fig2_rank_sensitivity.png)
*File: `src/OID_analysis/data/derived/figures/fig2_rank_sensitivity.png`*
Each subplot is one scene. The y-axis is force-sig overlap. Stability is measured by the standard deviation across ranks.
| Scene | std | Stability | Verdict |
|-------|-----|-----------|---------|
| Steady cloak | 0.10 | Moderate | Sign consistent, magnitude varies |
| **Karman cloak** | **0.07** | **Stable** | **Always near zero** |
| Illusion 0.75L | 0.26 | **Unstable** | **Needs more data** |
| **Illusion 1.0L** | **0.03** | **Stable** | **Monotonic trend confirmed** |
| **Illusion 1.5L** | **0.02** | **Stable** | **Strongly separated across all ranks** |
Three of five scenes are very stable. The exception (0.75L, std=0.26) is flagged for future investigation with longer time series.
### 3.2 Karman tau_c Sensitivity
For Karman cloak, the signature observable requires a convective delay tau_c (the time for flow structures to travel from pinball to downstream sensors). If tau_c is wrong, the signature-OID could be misaligned.
**Figure 4** sweeps tau_c from 0 to 60 steps (the shedding period is approximately 30 steps):
![Figure 4](src/OID_analysis/data/derived/figures/fig4_tauc_sensitivity.png)
*File: `src/OID_analysis/data/derived/figures/fig4_tauc_sensitivity.png`*
**Top panel**: Force-sig overlap stays between 0.11 and 0.31 across ALL tau_c values. The overlap is always near the orthogonal threshold. **The Karman force-sig separation is not an artifact of a bad delay choice.**
**Bottom panel**: Signature-OID R2 stays between 0.26-0.33 across all delays. Force-OID R2 is constant at 0.36 (since force has no delay). The signature prediction is modest but stable.
---
## 4. OID vs POD: Quantitative Advantage
### 4.1 Prediction Performance
**Figure 3** compares OID and POD for both force prediction and signature prediction, using m=2 coordinates:
![Figure 3](src/OID_analysis/data/derived/figures/fig3_oid_vs_pod_r2.png)
*File: `src/OID_analysis/data/derived/figures/fig3_oid_vs_pod_r2.png`*
**Panel (a)**: Force prediction. OID (blue bars) strongly outperforms POD (red bars) in every scene. POD gives negative R2 for illusion 0.75L and 1.0L (meaning it is worse than predicting the mean), while OID gives positive R2.
**Panel (b)**: Signature prediction. Sig-OID (green) outperforms POD (red) in every scene. The strongest effect is at 0.75L (OID R2=0.661 vs POD R2=-0.034).
Master comparison table:
| Scene | Task | OID R2 (m=2) | POD R2 (m=2) | OID wins? |
|-------|------|:-----------:|:-----------:|:---------:|
| Karman | Force | **0.750** | 0.418 | YES |
| Illusion 0.75L | Force | **0.435** | -2.426 | YES |
| Illusion 0.75L | Signature | **0.661** | -0.034 | YES |
| Illusion 1.0L | Force | **0.671** | -0.237 | YES |
| Illusion 1.0L | Signature | **0.586** | -0.160 | YES |
| Illusion 1.5L | Force | **0.640** | 0.264 | YES |
| Illusion 1.5L | Signature | **0.315** | 0.060 | YES |
### 4.2 Correction-Field Dimensionality
**Figure 5** confirms that correction fields are inherently low-dimensional:
![Figure 5](src/OID_analysis/data/derived/figures/fig5_pod_energy.png)
*File: `src/OID_analysis/data/derived/figures/fig5_pod_energy.png`*
All scenes capture 97.9-99.9% of correction-field fluctuation energy in just 5 POD modes. This justifies the "r=10" default truncation (safety margin) and confirms that the controller operates in a very low-dimensional correction space.
---
## 5. Steady Cloak: Suppression Metrics
**Figure 6** presents the physically meaningful metrics for steady cloak (replacing the inappropriate time-series R2):
![Figure 6](src/OID_analysis/data/derived/figures/fig6_steady_metrics.png)
*File: `src/OID_analysis/data/derived/figures/fig6_steady_metrics.png`*
| Metric | Value | Interpretation |
|--------|-------|---------------|
| Full-field RMS reduction | **99.43%** | Nearly complete fluctuation suppression |
| Recirculation area collapse | **38.55%** | The mean wake bubble shrinks significantly |
| Recirculation length change | **3.24%** | The bubble length barely changes |
| Fy (lift) RMS reduction | **83.29%** | Lift fluctuations strongly suppressed |
The large area collapse with minimal length change is interesting: the controlled wake becomes **narrower** but not **shorter**. This suggests the control primarily suppresses lateral (y-direction) fluctuations rather than shortening the streamwise extent of the recirculation zone.
---
## 6. OID and the Control Law
### 6.1 White-Box Chain
**Figure 7** answers: do OID coordinates capture the full control law?
![Figure 7](src/OID_analysis/data/derived/figures/fig7_whitebox_summary.png)
*File: `src/OID_analysis/data/derived/figures/fig7_whitebox_summary.png`*
| Model | Action R2 | Meaning |
|-------|:---------:|---------|
| obs -> act | **0.956** | PPO baseline: raw sensors predict actions |
| OID coord -> act | **0.225** | Force-OID coordinates capture 22.5% of action variance |
| OID+force -> act | **0.233** | Adding force doesn't help |
This is NOT a failure. OID is designed to find structures relevant to **observables** (force, signature), not to **actions**. Force-OID coordinates are physics-interpretable coordinates (what correction structures affect force), not control-state coordinates (what the controller internally uses). An action-related coordinate would require a separate causal-PCD analysis using the action itself as the observable.
---
## 7. Open Items and Caveats
1. **Illusion 0.75L rank sensitivity** -- The force-sig overlap varies with POD rank (std=0.26). This needs investigation with a longer time series or phase-resampled data.
2. **Karman future-signal R2** -- Signature-OID gives R2 near zero for Karman. This is under investigation. Possible causes: (a) the delayed error observable has artificially low variance due to target alignment; (b) tau_c needs scene-specific estimation using cross-correlation.
3. **No mode-to-field mapping** -- OID spatial modes (psi_k) are computed but not yet visualized as flow field plots. This would answer: "where in the physical domain does the force-sig separation live?" (near-body vs downstream). CCD zone analysis already suggests the answer is zone-dependent.
4. **PCD (whitened) did not outperform simple OID** -- The more complex whitened cross-correlation did not improve results. The simple cross-covariance SVD is sufficient for the current data quality.
5. **No cross-validation** -- The current R2 values are from 70/30 split on a single rollout. Cross-validation across multiple independent rollouts would strengthen the results.
6. **Data independence** -- All scenes use the same correction-field protocol (Delta-q_ctl = q_ctl - q_blk), ensuring fair cross-scene comparison. The illusion-position q_blk was collected separately from the cloak-position q_blk (geometry is different: front_x 19 vs 30, sensor_x 30 vs 40).
---
## 8. Figures
All figures in `src/OID_analysis/data/derived/figures/`:
| Figure | File | Description |
|--------|------|-------------|
| 1 | `fig1_force_sig_overlap.png` | **Flagship**: Force-OID vs signature-OID overlap across all 5 scenes. Signed and absolute versions with monotonic trend. |
| 2 | `fig2_rank_sensitivity.png` | POD rank sensitivity (r=6,8,10,12,16) of force-sig overlap. 5 subplots, one per scene. |
| 3 | `fig3_oid_vs_pod_r2.png` | OID vs POD prediction R2. Left: force. Right: signature. All 4 periodic scenes. |
| 4 | `fig4_tauc_sensitivity.png` | Karman tau_c sensitivity. Top: overlap vs delay. Bottom: R2 vs delay. 10 delays tested. |
| 5 | `fig5_pod_energy.png` | Correction-field POD energy capture (5 modes, cumulative %). |
| 6 | `fig6_steady_metrics.png` | Steady cloak suppression metrics: RMS reduction, recirculation collapse, force reduction. |
| 7 | `fig7_whitebox_summary.png` | White-box chain: obs->act vs OID->act vs OID+force->act. Horizontal bar chart. |
---
## 9. References
- Sch12: Schlegel et al. "On least-order flow representations for aerodynamics and aeroacoustics." JFM 2012.
- Lyu23: Lyu et al. "Canonical correlation decomposition for data-driven analysis."
- Kan17b: Kantsios et al. "Body-connected near wake as primary force determinant."
- Che19, Che21b: Chen-Liu line on rotation first rewriting near-body source terms.
- Tad10: Tadmor et al. "Low-dimensional state for flow control."
Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB