Add Lao beta_p/li profile adjustment for VCs - #79
Conversation
|
Had a quick look at this, will return to it later. Example09 runs smoothly for me but I'm not sure it's doing what it intended. While the betap and li are held fixed using the new VCs, the actual perturbation of Rin and Rout (2cm requested) were <1e-5 (i.e. the shape doesn't change). Probably requires a bit of digging. |
…rofile # Conflicts: # examples/example09 - virtual_circuits_MASTU.ipynb # freegsnke/virtual_circuits.py
|
@kpentland Thanks, this exposed two issues in the VC construction. Baseline targets were recorded before the fixed-beta_p/li profile refit, so every column subtracted stale targets. Successive columns also reused the preceding fitted Lao coefficients, making the underdetermined fit order-dependent. Both are now corrected: targets are evaluated after the adjusted baseline solve, and every perturbation starts from that same fitted profile. I added a synthetic regression with an exact known target derivative, and merged current I removed the previously saved failed outputs from Example09. A full physical rerun on this machine timed out in the expensive profile-metric finite-difference fit, so I have not replaced them with unverified output values. |
|
I've tried running Example09 but I'm getting some errors when calculating the VCs (with fixed betp and li). Cell 17 is failing with: |
Summary
Reviewer correction
The original fixed-beta_p/li calculation recorded target values before refitting the baseline Lao profile. Each perturbed column therefore subtracted stale pre-fit targets. It also reused the preceding column's fitted Lao coefficients, making the underdetermined four-coefficient/two-metric fit depend on column order.
The correction evaluates targets after the adjusted baseline solve and resets every perturbation to a copy of that same fitted profile. The new synthetic regression has an exact known target derivative and also checks that all perturbations begin from the baseline profile state.
Validation
python -m pytest freegsnke/tests/test_jtor_update.py freegsnke/tests/test_virtual_circuits.py -q: 10 passed before merging current mainA full physical execution of the fixed-profile VC section was attempted, but timed out during the expensive profile-metric finite-difference solve on this machine. The previously saved failed outputs were removed rather than replaced with unverified values.