Skip to content

feat: contact pressure that follows the bending history in compute_mkappa - #3

Merged
SMI-Lab-Inha merged 5 commits into
devfrom
feat/mkappa-pressure-history
Nov 15, 2026
Merged

SMI-Lab-Inha merged 5 commits into
devfrom
feat/mkappa-pressure-history

Conversation

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner

Summary

compute_mkappa used to hold one contact pressure over a whole bending history, while the fatigue path already refreshed it at every sample. Two new options let the armour $P_1+P_2$ follow the history:

  • contact_tension_history_N: one tension per curvature sample. The selected contact model (bounded, qp or solved) turns it into per-layer pressures, through the same _contact_histories that compute_fatigue and armour_contact_histories use.
  • contact_pressure_Pa: the per-sample $P_1+P_2$ of every structural armour layer, keyed by layer name, given directly.

MkappaResult.contact_pressure_Pa returns the pressures used, or None when the pressure was held fixed.

What follows the history

Only the armour friction bound follows the history, for both the direction-tied and the progressive laws. The pressure enters each wire's return map, the same one the fatigue path uses, and the slip state is carried across each change.

Stays at the reference state:

  • the stick stiffness, EI_min and EI_max;
  • the laid-core and internal-ring contact loads;
  • the wire-yield range check.

The reference state is tension_N, section_state or radial_state, or the first sample of a tension history. The yield check uses the largest tension of the history.

SectionLaw and the bending-test simulator keep a fixed pressure: their leg solver evaluates trial curvature histories that carry no sample time, so a time-dependent pressure would break the leg property. The SectionLaw.from_cable docstring says so.

The exported bending law is unchanged.

Energy

The bound is not a stiffness, so no material-work term arises. When the bound of a slipping wire falls from $c_0$ to $c_1$, the wire releases the elastic energy

$$ \frac{A\cos\alpha,(c_0^2 - c_1^2)}{2k} $$

as friction work plus the integration remainder. A rising bound leaves a sticking wire unchanged. The work balance of BendingWork holds as before, and the tests check it.

Tests (tests/test_mkappa_pressure_history.py, 13)

Check Result
Constant pressure history vs the fixed law (direction-tied, progressive, laid-core) bit for bit
Constant tension history vs the scalar tension equal to within 1e-12 of the moment; measured difference 0
Pressure steps inside stick (×0.6, ×1.7, ×1.3) no change; friction work exactly 0
Pressure cycle at fixed curvature in full slip, against the closed form per wire 1.6e-15 for one step, 8.9e-16 over 400 steps; then shakes down
Tension cycle inside the bending cycles vs the fatigue path's friction stress 3.4e-16 of the moment (direction-tied), 2.3e-16 (progressive)
Stepped tension 0–80–0 kN in full slip, per-cycle work against the closed form to 1e-10; rises with tension, equal on the rising and falling legs
Input and conflict checks CableSchemaError / PhysicalRangeError
  • Where they ran: all 13 pass with the pip wheels of both CI Python versions (NumPy 2.5.4 / SciPy 1.18.1 and NumPy 2.4.6 / SciPy 1.17.1) and with the conda-forge build, each with NUMBA_NUM_THREADS=1 and again with CABLEXSEC_DISABLE_NUMBA=1.
  • Tolerances: comparisons between the vectorised and compiled paths use 1e-12 of scale, not bit-equality.

Validation

  • New tier-1 row MK-Tcyc: tension cycling inside the bending cycles against the fatigue path (3.4e-16), and the work balance over the friction work (1.1e-15), both against a gate of $< 10^{-12}$. Status: PASS.
  • Existing rows: no row changed status.
  • Report: only this row and the three test-count lines were inserted into validation/validation_report.md. A full regeneration on this machine also rewrote round-off digits in other rows, so it was not committed.

Checks

  • release/check_coverage.py --fail-under 95: total 97.63 %, and the new code is fully covered.
  • pre-commit run --all-files; ruff check and format.
  • mypy: the same 38 errors as dev, none new.
  • validation/scripts/run_validation.py --check: not stale, 48 rows. It exits 1 on the 4 FAIL rows that already fail on dev (HU-3PB, WITZ-ID, SV11-PLANE, SV11-GJ).
  • Docs: doc/concepts.md (the "held fixed" statement is replaced), doc/local_analysis_guide.md §6, doc/global_local_guide.md §8, the docstrings, the benchmark register, VALIDATION.md and CHANGELOG.

…appa

compute_mkappa held one contact pressure over a bending history, while
the fatigue path already refreshed it every sample. Two new options let
the armour P1+P2 follow the history:

- contact_tension_history_N: one tension per curvature sample, turned
  into per-layer pressures by the contact model (the histories
  compute_fatigue forms from tension_N, armour_contact_histories);
- contact_pressure_Pa: the per-sample P1+P2 of every structural armour
  layer, keyed by layer name.

The pressure moves only the friction bound of each wire's return map
(wire_slip_history and progressive_wire_history already take it), with
the slip state carried across. The cap is not a stiffness, so no
material-work term arises: a falling bound releases the elastic energy
A cos a (c0^2 - c1^2)/(2k) of a slipping wire as friction work plus
the integration remainder, and a rising bound leaves a sticking wire
unchanged. The stick and full-slip stiffnesses, the laid-core and ring
contact loads and the wire-yield range check stay at the reference
state (the first sample of a tension history; the yield check uses the
largest tension). MkappaResult.contact_pressure_Pa returns the
pressures used.

SectionLaw and the bending-test simulator keep a fixed pressure: their
leg solver evaluates trial curvature histories that carry no sample
time. The exported bending law is unchanged.

Tests (tests/test_mkappa_pressure_history.py): a constant pressure
history is the fixed law bit for bit (direction-tied, progressive,
laid-core); a constant tension history matches the scalar tension; a
pressure step inside stick changes nothing; a pressure cycle at fixed
curvature in full slip dissipates the closed-form work of every wire
(1.6e-15 relative for one step, 8.9e-16 over 400 steps) and then shakes
down; a tension cycle inside the bending cycles is the fatigue path's
friction stress (3.4e-16 of the moment); per-cycle work in full slip at
stepped tension follows the closed form at every level, rises with
tension and is equal on the rising and falling legs.

New validation row MK-Tcyc (tier 1): 3.4e-16; 1.1e-15 against
< 1e-12. Docs: concepts, local-analysis and global-local guides,
SectionLaw docstring, 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-15T21:01:52.921887Z e93f9c7 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 15, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 CableXSec | 🛠️ Build #35912266 | 📁 Comparing 77d3029 against latest (240bf9c)

  🔍 Preview build  

14 files changed · ± 14 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: 980739cfbd

ℹ️ 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/api.py Resolved
… loads

compute_mkappa's contact_tension_history_N went through _contact_histories,
which also forms the crossed-wire line loads. That representation refuses a
structural layer with two crossing interfaces (three touching, alternately
laid armour layers), so even a constant tension history failed where the
scalar tension works. The bending route uses only the pressures:
_contact_histories and solved_contact_histories take crossing_loads=False and
then skip the line loads. Test: the three-layer stack, whose contact
histories are refused, gives the scalar-tension law from a constant tension
history (bounded and solved contact models).

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: 0ffea656f1

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

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. More of your lovely PRs please.

Reviewed commit: 5396afbb4b

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

…ntact model

The qp and solved contact models are not reliable on the sheath-free synthetic
stack (singular on Linux); that stack now checks the bounded model only. A
concentric template checks bounded, qp and solved with the crossed-wire line
loads patched to raise, so the bending route is shown never to form them
(all four cases fail on the previous source).

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. Keep them coming!

Reviewed commit: e93f9c7025

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

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@SMI-Lab-Inha
SMI-Lab-Inha merged commit 910962c into dev Nov 15, 2026
12 checks passed
@SMI-Lab-Inha
SMI-Lab-Inha deleted the feat/mkappa-pressure-history branch November 15, 2026 21:59
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