Journey 04 — Time-independent cost
Same stiff operator at T=1, 1e3, and 1e6 — n_solves and wall_s stay flat because T does not appear in the cost model.
Prerequisites: Journey 03 works. Scenario: The headline property: cost does not grow with T
Key APIs
solvlrde.solve()result['n_solves']result['wall_s']
Concepts to internalize
- Stiffness-immune — extreme κ does not inflate node count the way RK/BDF would.
- Far-horizon queries — steady-state and long-time limits without marching.
- Receipt logging — compare n_solves across T to validate T-independence in your integration tests.
Important code
The guided tour script wraps this pattern. Copy the production shape into your pipeline:
import numpy as np
import solvlrde as lrde
A = np.array([[-1e4, 0.0], [1e4, -1.0]])
for T in (1.0, 1e3, 1e6):
r = lrde.solve(A, [1.0, 0.0], T=T)
print(T, r['n_solves'], r['wall_s'])Act-by-act walkthrough
Act 1 — Why this matters
A time-stepping solver pays for every step from 0 to T, so y(1e6) costs a million times more than y(1). SolvLRDE evaluates y(T) as a single contour integral: the number of linear solves depends on the contour, not on T. y(1e6) costs the same as y(1).
Act 2 — Same system, three horizons
Solve at T = 1, 1e3, 1e6. Watch n_solves and wall_s stay flat while T spans six orders of magnitude. The slow component decays to ~0 by 1e6.
Horizon sweep (3 steps)
| Field | Value | Notes |
|---|---|---|
survived | True | |
y_slow | 3.679162e-01 | |
n_talbot_used | 32 | |
n_solves | 32 | |
wall_s | 0 | |
survived | True | |
y_slow | 7.613409e-13 | |
n_talbot_used | 32 | |
n_solves | 32 | |
wall_s | 0 | |
survived | True | |
y_slow | 1.748079e-15 | |
n_talbot_used | 32 | |
n_solves | 32 | |
wall_s | 0 |
Act 3 — Takeaway
Constant n_solves across a 1e6 range in T is the property no time-stepper has. If you need y at a far-future (or far-past-scale) horizon of a linear system, this is the tool.
Guided tour output
Verified console capture from 04_time_independence.py:
The headline property: cost does not grow with T
-- Act 1 - Why this matters --
-> A time-stepping solver pays for every step from 0 to T, so y(1e6) costs a million times more than y(1). SolvLRDE evaluates y(T) as a single contour integral: the number of linear solves depends on the contour, not on T. y(1e6) costs the same as y(1).
-- Act 2 - Same system, three horizons --
-> Solve at T = 1, 1e3, 1e6. Watch n_solves and wall_s stay flat while T spans six orders of magnitude. The slow component decays to ~0 by 1e6.
_section: Horizon sweep (3 steps)
survived: True
y_slow: 3.679162e-01
n_talbot_used: 32
n_solves: 32
wall_s: 0
survived: True
y_slow: 7.613409e-13
n_talbot_used: 32
n_solves: 32
wall_s: 0
survived: True
y_slow: 1.748079e-15
n_talbot_used: 32
n_solves: 32
wall_s: 0
-- Act 3 - Takeaway --
-> Constant n_solves across a 1e6 range in T is the property no time-stepper has. If you need y at a far-future (or far-past-scale) horizon of a linear system, this is the tool.
-- Run complete --
next_journey: 05_banded_dae.pyRun it
cd python
# Guided tour — narrated scenario walkthrough (recommended first run):
python examples/journeys/04_time_independence.py
# Production one-liner — same API call you ship:
python -c "import solvlrde,numpy as np; print(solvlrde.solve(np.array([[-1e4,0.],[1e4,-1.]]),[1,0],T=1e6)['n_solves'])"What comes next
Journey 05 uses banded and DAE reduction for structured operators.
Navigation
← Journey 03 — Configuration (contour + N) · Journey 05 — Banded + DAE →