Product documentation — installation, licensing, and integration guides.
SolvSRK
Examples
04 Configuration and SolvScout hand-off

Journey 04 — Configuration and SolvScout hand-off

Why config_defaults() is a learning baseline only, how SolvScout recommend_product → run_profile works, and how to tighten rtol/atol on top of tuned knobs.

Prerequisites: Journey 03 — Robertson integrates successfully with tuned preset. Scenario: SolvScout tunes; SolvSRK integrates

Key APIs

  • solvsrk.config_defaults()
  • solvsrk.run_profile(token, ...)
  • solvsrk.profile_to_config(token)
  • cfg.cvode_rtol
  • cfg.cvode_max_step

Concepts to internalize

  • Untuned vs tuned — same Robertson problem; untuned may blow up where tuned reaches t_end.
  • run_profile — one-call decode + integrate for deployment.
  • profile_to_config — when you must layer physical constraints or tweak rtol on a tuned baseline.
  • cvode_max_step — cap largest internal step when forcing terms must not be skipped.

Important code

The guided tour script wraps this pattern. Copy the production shape into your pipeline:

import solvscout as scout
import solvsrk
 
# Production path:
profile = scout.classify(rhs, y0, t_span).profile
token = scout.recommend_product(profile).profile
result = solvsrk.run_profile(token, 3, t0, t_end, y0, rhs_fn=rhs, jac_fn=jac)
 
# When you need wrappers before run():
cfg, mode = solvsrk.profile_to_config(token)
cfg.handoff_conservation_sum = 1.0
solvsrk.run(cfg, 3, t0, t_end, y0, rhs, jac_fn=jac)

Act-by-act walkthrough

Act 1 — Tuning is the product

config_defaults() is a blank API baseline — safe for learning the struct, not what you ship on stiff chemistry. Resonix tuning lives in SolvScout: classify your rhs, call recommend_product(), and integrate with run_profile(token, ...) or profile_to_config(token) when you need to layer problem-specific wrappers.

FieldValueNotes
untunedsolvsrk.config_defaults() — not production-ready on stiff problems
productionsolvscout.classify -> recommend_product -> solvsrk.run_profile(token, ...)

Act 2 — Untuned vs tuned on Robertson

Same Robertson problem, same analytic Jacobian — only the knobs change. Untuned is config_defaults() with no overrides. Tuned is a SolvScout profile token (or the bundled tuned preset when Scout is offline). Compare finished_ok, wall_s, nfev, and y_final.

Untuned (config_defaults)

FieldValueNotes
finished_okFalse
failure_modeblowup
wall_s8.941e-05
nfev9
y_final[-992.191, -2.95518e+06, 2.95618e+06]

Tuned (SolvScout tuned (solvsrk, high))

FieldValueNotes
finished_okTrue
failure_modeok
wall_s0.002542
nfev795
y_final[0.715827, 9.18553e-06, 0.284164]Untuned blew up (blowup) at t=0.02; tuned knobs reached t_end. That gap is why you do not ship config_defaults() on stiff plants.

Act 3 — Production API — run_profile

run_profile decodes the opaque token and integrates in one call. Use profile_to_config when you need to add physical wrappers before run().

FieldValueNotes
solvscout_solversolvsrk
confidencehigh
token_prefixrx-UlgBAQAAAgkAcm9iZ...

run_profile(token, ...)

FieldValueNotes
finished_okTrue
failure_modeok
wall_s0.002516
nfev795
y_final[0.715827, 9.18553e-06, 0.284164]

Act 4 — Fine-tune on top of tuned knobs

Once Scout gives you a good baseline, tighten rtol/atol only if you need more accuracy — start from robertson_config() or a decoded token, not from config_defaults().

Tuned baseline, loose rtol/atol

FieldValueNotes
finished_okTrue
failure_modeok
wall_s0.002517
nfev871
y_final[0.715834, 9.18581e-06, 0.284157]

Tuned baseline, tight rtol/atol

FieldValueNotes
finished_okTrue
failure_modeok
wall_s0.003887
nfev1244
y_final[0.715827, 9.18553e-06, 0.284164]

Act 5 — Step-size cap

cvode_max_step bounds the largest internal step CVODE may take — useful when a forcing term or event must not be skipped over. 0.0 means 'no explicit cap' (the solver chooses). Applied on the tuned Robertson preset.

FieldValueNotes
cvode_max_step0.05
cvode_steps828

Guided tour output

Verified console capture from 04_configuration.py:

SolvScout tunes; SolvSRK integrates

-- Act 1 - Tuning is the product --
  -> config_defaults() is a blank API baseline — safe for learning the struct, not what you ship on stiff chemistry. Resonix tuning lives in SolvScout: classify your rhs, call recommend_product(), and integrate with run_profile(token, ...) or profile_to_config(token) when you need to layer problem-specific wrappers.
  untuned: solvsrk.config_defaults() — not production-ready on stiff problems
  production: solvscout.classify -> recommend_product -> solvsrk.run_profile(token, ...)

-- Act 2 - Untuned vs tuned on Robertson --
  -> Same Robertson problem, same analytic Jacobian — only the knobs change. Untuned is config_defaults() with no overrides. Tuned is a SolvScout profile token (or the bundled tuned preset when Scout is offline). Compare finished_ok, wall_s, nfev, and y_final.
  _section: Untuned (config_defaults)
  finished_ok: False
  failure_mode: blowup
  wall_s: 8.941e-05
  nfev: 9
  y_final: [-992.191, -2.95518e+06, 2.95618e+06]
  _section: Tuned (SolvScout tuned (solvsrk, high))
  finished_ok: True
  failure_mode: ok
  wall_s: 0.002542
  nfev: 795
  y_final: [0.715827, 9.18553e-06, 0.284164]
  -> Untuned blew up (blowup) at t=0.02; tuned knobs reached t_end. That gap is why you do not ship config_defaults() on stiff plants.

-- Act 3 - Production API — run_profile --
  -> run_profile decodes the opaque token and integrates in one call. Use profile_to_config when you need to add physical wrappers before run().
  solvscout_solver: solvsrk
  confidence: high
  token_prefix: rx-UlgBAQAAAgkAcm9iZ...
  _section: run_profile(token, ...)
  finished_ok: True
  failure_mode: ok
  wall_s: 0.002516
  nfev: 795
  y_final: [0.715827, 9.18553e-06, 0.284164]

-- Act 4 - Fine-tune on top of tuned knobs --
  -> Once Scout gives you a good baseline, tighten rtol/atol only if you need more accuracy — start from robertson_config() or a decoded token, not from config_defaults().
  _section: Tuned baseline, loose rtol/atol
  finished_ok: True
  failure_mode: ok
  wall_s: 0.002517
  nfev: 871
  y_final: [0.715834, 9.18581e-06, 0.284157]
  _section: Tuned baseline, tight rtol/atol
  finished_ok: True
  failure_mode: ok
  wall_s: 0.003887
  nfev: 1244
  y_final: [0.715827, 9.18553e-06, 0.284164]

-- Act 5 - Step-size cap --
  -> cvode_max_step bounds the largest internal step CVODE may take — useful when a forcing term or event must not be skipped over. 0.0 means 'no explicit cap' (the solver chooses). Applied on the tuned Robertson preset.
  cvode_max_step: 0.05
  cvode_steps: 828

-- Run complete --
  next_journey: 05_diagnostics.py

Run it

cd python
# Guided tour — narrated scenario walkthrough (recommended first run):
python examples/journeys/04_configuration.py
 
# Production one-liner — same API call you ship:
python examples/journeys/04_configuration.py

What comes next

Journey 05 walks every receipt field, emit_history, and emit_uq.

Navigation

← Journey 03 — Stiff chemistry (Robertson) · Journey 05 — Diagnostics →