Skip to content

feat: one exported bending law per friction group, each with its own scale table - #42

Merged
SMI-Lab-Inha merged 4 commits into
devfrom
feat/slip-group-laws
Nov 19, 2026
Merged

SMI-Lab-Inha merged 4 commits into
devfrom
feat/slip-group-laws

Conversation

@SMI-Lab-Inha

@SMI-Lab-Inha SMI-Lab-Inha commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

A global model that carries one slip scale per bending law cannot follow friction groups that scale differently with tension. With armour clamping the laid cores do: on the 66 kV template at 20 MPa winding stress the cores sit at 0.39 of their 100 kN cap at 10 kN, the armour and the filler profiles at 0.46. One cap-weighted scale then misses the exported backbone by up to 5.5 % and the cycle work by up to 7 %.

This PR lets export_bending_law hand over one law per friction group, each with its own scale table, so the global model sums the group laws instead:

$$ M(\kappa; T) = \sum_g s_g(T), B_g!\left(\frac{\kappa}{s_g(T)}\right) $$

with $B_g$ the backbone of group $g$ at the reference state and $s_g = \rho_g$ its own scale (already in SlipScaleTable). The first group carries the elastic part $EI_{slip},\kappa$, which the scaling leaves unchanged.

It also makes the default scale table run to zero tension: the caps of the contact model at $T = 0$ are added in front of the exported tensions (zero without clamping, so $s \to 0$; the clamping caps otherwise), instead of the table ending at the lowest exported tension.

API

export = cx.export_bending_law(cable, tensions_N=..., kappa_max_1_m=0.4,
                               slip_scale=True, core_friction=spec)
groups = export.slip_group_laws()                 # tuple[SlipGroupLaw, ...]
M = sum(g.backbone_at(kappa, 35e3) for g in groups)   # s_g B_g(kappa / s_g)
law_g = groups[2].law_at(35e3)                    # IwanBendingLaw of one group
M_hist = sum(g.moment(kappa_hist, tension_hist) for g in groups)
export.to_group_csv("groups")   # <group>_backbone.csv, <group>_slip_scale.csv
  • SlipGroupLaw (new, exported from cablexsec): name, kind, kappa_1_m, law, moment_Nm, scale, scale_dT_1_per_N, scale_at, law_at, backbone_at, moment, backbone_csv_text, scale_csv_text.
  • SlipScaleTable.group_law(index, kappa_1_m) builds one group law.
  • Changed default: slip_scale_tensions_N=None is now [0, *tensions_N] when the lowest exported tension is positive. An explicit slip_scale_tensions_N is used as given.

Checks (registered in doc/benchmarks.md before the run, first commit of this PR)

Case: 66 kV IEA Task 49 template, bounded contact, laid cores (wedged trefoil) and filler profiles, μ 0.46 on every core and profile contact, armour winding stress 0 / 20 / 40 MPa, export at 10–200 kN, kappa_max_1_m = 0.4, 200 base points.

ID Target 0 MPa 20 MPa 40 MPa Status
MX-group-B summed group backbones vs exported backbone, every grid curvature and tension: ≤ 0.5 % 4.6e-4 4.4e-4 4.5e-4 PASS
MX-group-E Masing work of 3 symmetric cycles (1e-3 … 0.3 1/m): ±1 % 0.99973–1.00003 0.99997–1.00054 0.99973–1.00003 PASS
MX-group-0 zero row = cap ratio at 0 N (1e-12), interpolated 5 kN = direct (1e-9) $s_g(0)=0$ 0.82–0.87 0.90–0.93 PASS
MX-group-1 one scale for all groups (reported) 0.046 % 5.5 %, work 0.961–1.074 4.8 %, work 0.944–1.073 reported

The residual of MX-group-B is the linear interpolation of each reference backbone between its grid points, not the scaling.

Gates

  • Full suite with the CI wheels (numpy 2.4.6, scipy 1.17.1) on the branch rebased onto dev (7e14481, with the Yun shear-stack fix), NUMBA_NUM_THREADS=1: 4610 passed, 4 skipped; with CABLEXSEC_DISABLE_NUMBA=1: 4495 passed, 119 skipped.
  • python -m mypy: no issues.
  • ruff check / ruff format --check on src tests examples validation release doc: clean.
  • Taxonomy in validation/validation_report.md: analytical_sanity 1200 → 1219 (19 new collected IDs, tests/test_bending_law_groups.py); the other two unchanged.
  • CHANGELOG: Added (group laws) and Changed (zero-tension row).

Review fixes

  • Group CSV file names are safe file-name components (Codex P2): letters, digits, ., - and _ are kept, every other character becomes _, a dots-only or empty stem becomes group, stems that would meet (case-insensitive) are numbered; the backbone file's comment line keeps the group name itself. Test test_group_csv_file_names_stay_in_the_directory (layers named armour/inner and ../outer).
  • Rebased onto dev after the Yun shear-stack fix (armour ξ of the 66 kV template changed): MX-group rerun, numbers above updated; all registered targets still PASS.

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T12:38:11.129661Z ea16a3c Manual request
ℹ️ 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.

@read-the-docs-community

read-the-docs-community Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 CableXSec | 🛠️ Build #36012670 | 📁 Comparing ea16a3c against latest (240bf9c)

  🔍 Preview build  

24 files changed · ± 24 modified

± Modified

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a320af4e4

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cablexsec/analysis/bending_law.py Resolved
…oup)

Targets registered before any run: summed per-group laws against the
exported backbone (0.5 %) and loop work (+-1 %) on the 66 kV template
with laid cores, filler profiles and armour clamping; the zero-tension
row of the default scale table.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
…scale table

A global model that carries one slip scale per law cannot follow groups
that scale differently with tension; with armour clamping the laid cores
do (66 kV template, 20 MPa: cores 0.39, armour and profiles 0.46 of their
100 kN cap at 10 kN). BendingLawExport.slip_group_laws() returns one
SlipGroupLaw per friction group: the group's backbone at the reference
with its own scale s_g(T), so that the global model sums
s_g B_g(kappa / s_g); the first group carries EI_slip. to_group_csv
writes a backbone and a scale table per group.

The default slip-scale table now starts at zero tension with the caps of
the contact model there (zero without clamping), so the scale runs to
zero instead of ending at the lowest exported tension.

Checks MX-group, registered before the run (66 kV template, cores and
profiles, 0/20/40 MPa winding stress, 10-200 kN): summed group laws
within 4.4e-4 of the exported backbone (target 0.5 %) and 0.13 % of the
cycle work (target 1 %); one scale for all groups misses by up to 5.3 %
and 7 %.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
A friction group is named after its armour layer, a free string: a name
with a slash or "../" made to_group_csv fail or write outside the
directory. The file stem now keeps letters, digits, ".", "-" and "_",
turns every other character into "_", gives a dots-only or empty stem
the name "group" and numbers stems that would meet (case-insensitive);
the backbone file's comment line keeps the group name itself.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
The armour stick coefficient of the 66 kV template changed with #39;
the registered MX-group checks were rerun on the rebased branch: summed
group laws within 4.6e-4 of the exported backbone and 0.06 % of the
cycle work (all PASS); one scale for all groups 5.5 % and 7 %.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: ea16a3ce8b

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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