Skip to content

feat: slip scaling variable of the exported bending law - #4

Merged
SMI-Lab-Inha merged 3 commits into
devfrom
feat/law-scaling-variable
Nov 16, 2026
Merged

SMI-Lab-Inha merged 3 commits into
devfrom
feat/law-scaling-variable

Conversation

@SMI-Lab-Inha

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

Copy link
Copy Markdown
Owner

Summary

The exported bending law now carries a slip scaling variable, so a global analysis can follow the section's friction as tension (and, optionally, external pressure) changes. It comes with a stated slider-update rule for a changing state. The rule is exact per friction group and tested against compute_mkappa with a contact-tension history (#3). The format stays backward compatible.

This PR also corrects an "exact" claim in the docs that has been false since #2.

Why scaling is exact

Each direction-tied wire is a spring-slider. Its stiffness $k_f = \xi E\cos^2\alpha$ is fixed, and its friction bounds are proportional to its layer's $P_1+P_2$. The return map $f \leftarrow \mathrm{clip}(f + k\Delta d, -\rho l, \rho u)$ is positively homogeneous. A layer whose bounds scale by $\rho$ therefore obeys

$$ M(\kappa; \rho) = \rho, M(\kappa/\rho; 1) $$

over any curvature history, including the asymmetric capstan bound. Its Iwan elements keep $k_i$, and their yield curvatures become $\rho,\kappa_{y,i}$.

Friction groups and scales

  • Groups:

    • one group per structural armour layer;
    • a laid_cores group for the core lay stage, with its own contact load.
  • Group cap $R_g$: the planar full-slip friction moment, computed analytically from wire_slip_stress_bounds.

  • Group scale: $\rho_g = R_g/R_{g,\mathrm{ref}}$.

  • Single cap-weighted scale: $s = \sum R_g / \sum R_{g,\mathrm{ref}}$. It keeps the stick stiffness and the full-slip moment exact.

  • Slider update for a changing state:

    $$ e_i \leftarrow \mathrm{clip}\left(e_i + \Delta\kappa,\ -\rho_g\kappa_{y,i},\ \rho_g\kappa_{y,i}\right), \qquad M = EI_\mathrm{slip},\kappa + \sum_i k_i e_i, $$

    implemented as SlipScaleTable.moment, .law_at and .dissipated_energy.

  • Reference state: the smallest exported tension at which every group has contact, so that $\rho \ge 1$.

  • Axes:

    • tension, always;
    • external pressure, optionally (solve_section_state for bounded/qp, solve_cable_radial_state for solved);
    • derivatives $\partial/\partial T$ and $\partial/\partial p_e$ by central differences, one-sided at zero.
  • Not exported: torque, which needs a free twist and moves contra-wound layers in opposite senses. The internal-ring slip of resolved strands is refused.

Tests (tests/test_bending_law_slip_scale.py, 22)

Check Result
compute_mkappa at 70 kN vs the 20 kN law with the bound scaled (loop history, 66 kV with cores) 4e-16
Each group law at 60 kN on the grid $\rho_g\kappa$ vs the 10 kN law with yield curvatures × $\rho_g$ (Ménard; 33 kV three-core with cores) < 1e-13
Export at T2 on a scaled grid vs the single-scale law (66 kV) 1e-12
Tension cycle 10–70 kN inside bending cycles: scaled law vs compute_mkappa(contact_tension_history_N), symmetric wire bounds moment 8e-15, work 7e-15
The same comparison with the signed bound ≤ 1.02 × the fixed-tension Iwan residual
The law frozen at the reference, for contrast misses by 19 % and 43 %

All 22 also pass with the pip wheels of both CI Python versions and with CABLEXSEC_DISABLE_NUMBA=1.

Single-scale error against the per-group law

Range 10–150 kN, reference 10 kN. The moment error is in % of the moment range; the work is per cycle at 1.5 × full slip.

Template Tension only Tension + $p_e$ 0–2 MPa
66 kV IEA Task 49 0 (both layers ∝ T) 21 %, work 32 %
33 kV three-core 0.10 %, work 0.14 % 12 %, work 16 %
33 kV three-core with cores 0.29 %, work 0.36 % not run
Ménard 12 %, work 11 % 19 %, work 19 %

With external pressure, use the per-group scales.

Correction: the Iwan law is not exact under the signed bound

The docs stated that the exported Iwan law reproduces compute_mkappa exactly. That stopped being true with the signed capstan bound (#2): each wire's slip interval is now asymmetric, which no Masing element can carry. With symmetric bounds the residual drops tenfold, which confirms the cause. The residual is 0.08–0.26 % of the moment range near full slip on the templates, and 0.02 % at μ = 0.02.

The wording is corrected in the provenance strings (export_bending_law, cabledyn_bending_law), the module docstring, the global–local guide, concepts.md and benchmarks.md, with a CHANGELOG "Fixed" entry. The law itself is unchanged.

Format

  • JSON: a law with a slip scale is written as cablexsec.bending_law/2, with a new slip_scale object. Every version-1 field is unchanged. A law without a slip scale is still written as version 1, byte for byte.
  • CSV: SlipScaleTable.to_csv writes one row per state.
  • New exports: SlipScaleTable (with reference_law(), the law at the reference built from the group elements, so a reference outside the table axes still serialises) and CORE_GROUP; BendingLawSettings gains the slip_scale* options.
  • Project codec: it accepts a missing field that has a default, so project files saved before slip_scale load.
  • Option checks: export_bending_law refuses contact_pressure_Pa and contact_tension_history_N as options.

Validation and checks

  • New tier-1 row MX-scale: 4.1e-16; 8.3e-14; ratio 1.02, against < 1e-12; < 1e-9; ≤ 1.25. PASS. The group-element value is a few hundred machine epsilons (1.1e-13 on the CI runner), since the element stiffnesses are differences of fitted slopes. No existing row changed status; the report changes only by this row and the taxonomy counts.
  • Coverage: 97.64 % (bending_law.py 98.86 %).
  • Lint: ruff check and format on src tests examples validation release doc, as in CI.
  • mypy: the same 38 errors as dev.
  • Docs: global–local guide §8.1, file_formats.md, concepts.md, benchmarks.md (MX-scale, MX-scale-1), VALIDATION.md, ARCHITECTURE.md, project_guide.md and CHANGELOG.

The exported bending law held one contact state per tension and was
interpolated between tensions, with no rule for its slider states when
the tension changes. export_bending_law(..., slip_scale=True) now adds
BendingLawExport.slip_scale, a SlipScaleTable:

- the law at a reference tension split into friction groups, one per
  structural armour layer and laid_cores for the core lay stage, each
  with its Iwan elements (k_i, kappa_y,i), plus EI_slip;
- the cap R_g of every group (its planar full-slip friction moment) over
  a table of tensions and, optionally, external pressures (solved
  section states), the group scale rho_g = R_g / R_g,ref, the single
  cap-weighted scale s = sum R_g / sum R_g,ref, and the derivatives
  d/dT and d/dp_e (central differences of the contact model).

Why it is exact per group: the direction-tied wire is a spring-slider of
fixed stiffness k_f = xi E cos^2 a whose bounds are proportional to its
layer's P1+P2. The return map is positively homogeneous, so a group whose
bounds scale by rho obeys M(kappa; rho) = rho M(kappa / rho; 1) over any
history (the signed capstan bound included), and its Iwan elements keep
k_i while their yield curvatures become rho kappa_y,i. Under a changing
state every element follows the return map with the new cap,
e_i <- clip(e_i + dkappa, -rho kappa_y,i, rho kappa_y,i), the rule the
fatigue kernels and the contact-tension history of compute_mkappa apply
to every wire (SlipScaleTable.moment, law_at, dissipated_energy). The
caps come from the scalar-tension contact states of compute_mkappa
(pressure only; no crossed-wire line loads), so layer stacks whose
contact histories are refused still export a scale.

Tests (tests/test_bending_law_slip_scale.py):
- compute_mkappa at 70 kN is the 20 kN law with the bound scaled over a
  loop history, cores included (66 kV template, every group ~ T): 4e-16;
- every group law decomposed at 60 kN on the grid rho_g kappa is the
  10 kN group law with yield curvatures times rho_g (Menard, layers
  scaling by 2.06 and 1.40; 33 kV three-core with cores): < 1e-13;
- with symmetric wire bounds on a grid through every wire's slip
  curvature, the scaled law under a tension cycle inside bending cycles
  is compute_mkappa with the contact-tension history, moment and work,
  to 1e-14;
- with the signed bound it misses the history route by at most 1.02
  times the fixed-tension Iwan residual (Menard 0.17 %, 66 kV 0.11 % of
  the range); the frozen law misses by 19 % and 43 %;
- table values and slopes, the pressure axis, JSON/CSV, project round
  trip, input checks, a falling cap at fixed curvature.

One scale for all groups is exact when the groups scale alike and keeps
the stick stiffness and full-slip moment otherwise. Largest error against
the per-group law over 10-150 kN (backbone and cycles to 1.5 times full
slip): 66 kV 0; 33 kV three-core 0.10 % (0.29 % with cores); Menard 12 %;
with an external pressure of 0-2 MPa 21 % (66 kV), 12 % (33 kV), 19 %
(Menard). Torque is not a table variable, and the internal-ring slip of
resolved strands is refused.

Format: the JSON law with a slip scale is cablexsec.bending_law/2 (a new
slip_scale object, version-1 fields unchanged); without one it stays
version 1. SlipScaleTable.to_csv writes the table. BendingLawSettings
passes the new options. The project codec accepts a missing field that
has a default, so project files written before slip_scale existed still
load. export_bending_law refuses contact_pressure_Pa and
contact_tension_history_N as options.

Fixed: the docs and provenance claimed the exported Iwan law follows
compute_mkappa exactly. The signed capstan bound makes each wire's slip
interval asymmetric, which no Masing element carries; the residual is
about 0.1 % of the moment range near full slip (0.02 % at mu = 0.02,
0.017 % with symmetric bounds on Menard).

New validation row MX-scale (tier 1): 4.1e-16; 8.3e-14; ratio 1.02
against < 1e-12; < 1e-12; <= 1.25. Docs: global-local guide Section 8.1,
file formats, concepts, benchmark register, VALIDATION.md, changelog.

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

chatgpt-codex-connector Bot commented Nov 15, 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-16T00:04:29.941750Z 5e0fb29 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.

@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: 698bfd2766

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

@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: 698bfd2766

ℹ️ 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
@read-the-docs-community

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

Copy link
Copy Markdown

Documentation build overview

📚 CableXSec | 🛠️ Build #35913754 | 📁 Comparing 5e0fb29 against latest (240bf9c)

  🔍 Preview build  

16 files changed · ± 16 modified

± Modified

The group element stiffnesses are differences of fitted slopes, so the
identity holds to a few hundred machine epsilons: 8.3e-14 here, 1.1e-13 on
the CI runner, where the report checker read it as a real change against
the 1e-12 target. The target is now 1e-9 (round-off for the checker); a
wrong scaling misses it by orders of magnitude.

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. Can't wait for the next one!

Reviewed commit: a13ddbe6f1

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

…nce lies off the table axes

record() built the reference elements through law_at() at the reference
state, which the table refuses when its tension or pressure axis does not
hold that state (the default reference is the first exported tension with
contact, and the pressure reference is the cable's own). json_text() and
to_json() then failed on an export that was otherwise valid. At the
reference every group scale is 1, so SlipScaleTable.reference_law() now
merges the group elements unscaled, and law_at() shares that merge.

Test: a tension axis starting above the reference and a pressure axis
excluding the cable's external pressure both serialise (both failed
before), and reference_law() equals law_at() at the reference on a table
that holds it.

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. Delightful!

Reviewed commit: 5e0fb29b64

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

@SMI-Lab-Inha
SMI-Lab-Inha merged commit 6a907cf into dev Nov 16, 2026
12 checks passed
@SMI-Lab-Inha
SMI-Lab-Inha deleted the feat/law-scaling-variable branch November 16, 2026 00:36
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