Skip to content

feat: static/dynamic and rate-dependent armour friction law - #7

Merged
SMI-Lab-Inha merged 4 commits into
devfrom
feat/friction-law
Nov 16, 2026
Merged

SMI-Lab-Inha merged 4 commits into
devfrom
feat/friction-law

Conversation

@SMI-Lab-Inha

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

Copy link
Copy Markdown
Owner

Summary

Armour friction had one rate-independent Coulomb coefficient per material pair. This PR adds a FrictionLaw that gives every wire (direction-tied kernel) or helix node (distributed kernel) its own factor $m$ on $\mu$:

  • Static/dynamic: a static factor until the wire first slips in a stick episode, then a dynamic one, and back to static after a stick time.
  • Rate dependence (direction-tied kernel): a logarithmic and a viscous term on the dynamic factor.

The neutral law reproduces the present kernels bit for bit. Routes that cannot represent a state- or rate-dependent coefficient refuse a non-neutral law instead of computing something wrong.

The law (cx.FrictionLaw, cablexsec.mechanics.friction_law)

Where the factor acts. It sits inside the capstan exponent, so the signed bound of #2 keeps its asymmetry:

$$ -\sigma_0 g,\bigl(1 - e^{-m\lambda\psi}\bigr) \le \sigma_f \le \sigma_0 g,\bigl(e^{m\lambda\psi} - 1\bigr). $$

In the distributed kernel it multiplies the node bound, $m(\rho g + \lambda n)$.

Static/dynamic (static_factor, dynamic_factor, stick_time_s):

  • The static factor holds until the wire leaves its interval; the wire is then returned to the dynamic interval.
  • stick_time_s of completed stick steps heals it back. The default, inf, never heals; 0 heals after one stick step.
  • Either order works:
    • $\mu_s > \mu_d$ gives a breakaway drop;
    • $\mu_s < \mu_d$ (velocity strengthening) ends the stick episode at the static bound without slip, then continues elastically to the dynamic bound.

Rate, direction-tied kernel only. The dynamic factor is multiplied by

$$ R(v) = 1 + c,\ln(1 + v/v_0) + v/v_\eta. $$

  • Return map: backward-Euler (Perzyna), solved per wire by safeguarded Newton. The root is unique for $c \ge 0$, and the slipping stress lands exactly on its end-of-step bound.
  • Refused: $c < 0$ (velocity weakening), whose return is not unique.
  • Robust return: the root is bracketed between zero slip and the rate-free slip; a Newton step is taken only when it stays in the bracket and halves it, otherwise the step bisects. It stops at a residual of 2e-15 of the trial stress, and an unconverged return is refused instead of used. The end-of-step stress never exceeds the trial stress. A zero lay angle gives zero capstan friction under any law.
  • Viscous term: an overstress proportional to the bound ($\eta = b/v_\eta$). The parameter is therefore a velocity in both kernels, with no viscous force where there is no contact.
  • Slip rate: the direction-tied kernel slips in a reduced strain, so the rate is the plastic strain rate times $L = r/|\sin\alpha|$. This is a representative wire velocity, documented as such.

Energy. BendingWork gains viscous_J_per_m and a dissipation_J_per_m property. The balance is input = stored + friction + viscous + remainder.

Distributed kernel (static/dynamic only):

  • A healed node that leaves its static bound switches to the dynamic factor, and the increment is solved again.
  • Each node switches at most once per increment, and the state is restored on sub-step halving.

Single slider. slider_history runs the law on one spring-slider; the closed-form tests use it.

Entry points and time base

Entry points. These take friction_law= and time_s=:

  • compute_mkappa, compute_fatigue (both levels);
  • wire_slip_history, wire_friction_stress, distributed_friction_history;
  • wire_stress_field, compute_mkappa_wire_slip_front.

Time base:

  • A law with a rate term or a finite positive healing time needs time_s.
  • time_s without such a law is refused, except in compute_fatigue, where it still serves a thermal history.
  • Times must be finite and strictly rising. The stress-free start is one interval before the first sample.

Refused for a non-neutral law:

  • the progressive (Iwan) model;
  • core friction in compute_mkappa;
  • the rate-independent termination clamp increment;
  • export_bending_law: no Masing/Iwan law carries a state- or rate-dependent coefficient. A neutral law is accepted and gives an identical export.

Not wired:

  • the along-wire chain, the beam and rig test simulators, the sea-state batch and kinematics;
  • the project/settings codec, so the file formats are unchanged.

The crossing contact-life branches of the fatigue path keep their own Mindlin coefficient, and the provenance says so.

Tests (tests/test_friction_law.py, 76; 23 analytical_sanity)

Check Result
Slider breakaway ($\mu_s = 1.4\mu_d$) peak within one step of $1.4b$, then $b$ to 1e-15
Velocity strengthening no drop; holds at $1.15b$
Healing a 0.5 s hold (> stick_time_s 0.3 s) gives a second peak; 0.1 s does not
Steady viscous loop area $\pi\eta\omega x_0^2$ 3e-8 (tolerance 1e-6); Coulomb part $4bx_0$ to 1e-7
Steady logarithmic rate $m_d,b,R(v)$ 1e-12
Energy balance slider ≤ 1e-12 of the input work; kernels ≤ 1e-12 of the dissipation (measured about 2e-15)
Equal factors $m_s = m_d = m$ vs the layer with $m\mu$ direction-tied ≤ 1e-12; distributed 2.7e-14
Compiled vs NumPy reference, 4 laws × fixed/varying pressure ≤ 1e-12 of scale (measured about 1e-15)
Neutral law bit for bit within each path: direction-tied reference and compiled, distributed, compute_mkappa, compute_fatigue, export
Distributed breakaway equals the $1.4\mu$ model up to first slip, lower after
Rate law vs time step first order (error ratio 0.51 per halving)

Also tested:

  • zero contact (both paths exactly 0);
  • wires that never slip;
  • material work from stiffness changes;
  • kept caps;
  • the refusals at every entry point.

There are no new validation rows: CableXSec has no rate-dependent or static/dynamic loop data yet.

Checks

Gate Result
Full suite, CI's Python 3.12 wheels, rebased on dev efef92a (with #6) 4273 passed, 1 skipped
Full suite, CABLEXSEC_DISABLE_NUMBA=1 4169 passed, 105 skipped
Touched files with the Python 3.11 jobs' wheels (NumPy 2.4.6), numba on and off 111 passed each
ruff check, ruff format --check (CI trees) clean
mypy the same 38 errors as dev
Coverage 97.22 % (friction_law.py 98.3 %, fast_slip.py 97.7 %, papailiou.py 98.2 %); test_friction_law.py joins the coverage script's no-JIT pass so the compiled bodies are traced
Validation report taxonomy lines only

Docs: concepts.md (slip-state and rate-dependent coefficient), api_python.rst (Friction law), the module and kernel docstrings, and the CHANGELOG.

Every contact pair had one rate-independent Coulomb coefficient. A
FrictionLaw now gives each wire (direction-tied model) or helix node
(distributed model) a factor on its coefficient where the kernel applies
it: inside the capstan exponent of the wire bounds and on the whole node
bound m (rho g + lam n).

- Static/dynamic: static_factor until a wire slips in a stick episode,
  dynamic_factor while it slips and until it has stuck for stick_time_s,
  per-wire (per-node) stick timer, either order (breakaway peak or
  velocity strengthening).
- Rate: R(v) = 1 + c ln(1 + v/v0) + v/v_eta on the dynamic factor; the
  viscous term is t = b sign(v) + eta v with eta = b/v_eta, solved as a
  backward-Euler (Perzyna) return by safeguarded Newton, unique for
  c >= 0 and exact per step. BendingWork.viscous_J_per_m carries the
  rate-dependent dissipation and the balance closes with it. The
  direction-tied slip rate is the plastic strain rate times r/|sin a|.
- Direction-tied: NumPy reference in wire_slip_history and a compiled
  kernel in fast_slip; distributed: static/dynamic option with breakaway
  re-solve of the increment (rate terms refused).
- compute_mkappa and compute_fatigue take friction_law and time_s; a law
  that depends on time is refused without sample times, time_s without
  such a law is refused. The progressive law, core friction, the
  termination clamp increment and the bending-law export (Masing/Iwan is
  rate independent) refuse a non-neutral law.
- Neutral parameters keep the rate-independent code paths bit for bit.

Tests: one-slider closed forms (breakaway peak, strengthening, healing,
steady viscous loop area pi eta omega x0^2, steady logarithmic rate),
energy identity to round-off, equal factors equal to a scaled mu,
compiled kernel against the reference, entry-point refusals.

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 16, 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-16T06:20:21.750416Z ba0fda4 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 16, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 CableXSec | 🛠️ Build #35918280 | 📁 Comparing ba0fda4 against latest (240bf9c)

  🔍 Preview build  

17 files changed · ± 17 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: b2770b3d28

ℹ️ 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/mechanics/friction_law.py Resolved
Comment thread src/cablexsec/mechanics/papailiou.py Resolved
The slip return of a rate-dependent law took Newton steps from the
rate-free root and bisected only when a step left the bracket. With a
strong viscous term or a short step the bound rises steeply with the
slip, the steps shrink to a vanishing share of the bracket, and after
200 iterations the unconverged iterate was returned: its bound (6.6e100
Pa for a trial stress of 1e8 Pa) became the wire stress.

- Scalar (compiled) and NumPy returns: Newton steps only inside the
  bracket and only while the bracket at least halves every second
  iteration, bisection otherwise, so the bracket shrinks geometrically
  however steep the bound. Convergence on the residual at round-off of
  the trial stress or on the bracket at round-off of the slip itself.
  An unconverged return is NaN and is refused by every caller
  (wire_slip_history, wire_friction_stress, slider_history) instead of
  being consumed.
- The end-of-step stress is the bound at the slip, never above the trial
  stress (_return_stress; the NumPy path clips the same way).
- The bound exponent is capped at 600 (was 700) so that capped bounds
  and slopes stay finite in binary64: no overflow inside the bracket.
- A zero lay angle has zero capstan bounds; the law paths divided by
  sin(a) for the slip length. Both paths now give that layer zero
  friction under any law, as the existing bound and onset helpers do.
- wire_friction_stress refuses a law on a layer without stick stiffness,
  as the reference does.

Tests (all fail before this change): the reported return case and a
sweep of 864 extreme rate cases (residual <= 1e-14 of the trial
stress, bound between the rate-free bound and the trial stress, NumPy
equal to scalar); both kernels with a steep viscous term and 1e-6 s
steps (stress within the elastic envelope, kernels agree to 1e-12,
energy balance); refusal of an unresolved return; static/dynamic and
rate laws on a zero-lay-angle layer, compiled and NumPy.

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 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: f2f6271cc9

ℹ️ 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/mechanics/papailiou.py Resolved
Comment thread src/cablexsec/api.py Resolved
…ith a timed law

Two values were formed for both sides or consumers where only one is
valid.

- Direction-tied NumPy reference: the end-of-step bound of a slipping
  wire was evaluated on both sides at its rate factor. Under a strong
  viscous term the falling bound saturates at sigma0 g (a valid, finite
  return) while the rising exponential of the same factor overflows, so
  wire_slip_history raised for a finite solution (e.g. pressure 2e4 Pa,
  v_eta = 1e-9 m/s: falling bound 7.95e6 Pa, unused exponent 5401).
  The new _side_bound evaluates each wire on its own side only (with the
  scalar form's exponent cap); the kept cap of a slipping wire is that
  bound, and wires without slip, which carry no rate factor, keep both
  bounds. The NumPy return iteration evaluates bound and slope on each
  element's side only as well. The compiled kernel already evaluated one
  side (_bound).
- compute_fatigue: time_s serves a ThermalHistory and a time-dependent
  friction law. A frozen ThermalState refuses any time_s, so a frozen
  state with a timed law always failed one of the two checks. The times
  now go to the friction kernel and, for a frozen state, not to the
  thermal helper; a frozen state given time_s without a timed law is
  still refused, and a ThermalHistory still takes the times.

Tests (each fails before this change): the reported case on both curvature
signs, compiled against the NumPy reference, compressed wires on the
saturated bound, stresses within the trial stress, finite kept caps;
compute_fatigue with a frozen ThermalState and a rate law, equal to the
identical-block ThermalHistory, with the existing refusals.

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. Chef's kiss.

Reviewed commit: d420031d49

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

The parametrised friction-law tests add three more cases than were
counted; the three taxonomy lines now give the deselected counts the CI
coverage job collects (3164, 4227, 4270).

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: ba0fda4632

ℹ️ 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 77c66bf into dev Nov 16, 2026
12 checks passed
@SMI-Lab-Inha
SMI-Lab-Inha deleted the feat/friction-law branch November 16, 2026 06:52
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