Skip to content

Tracking: Missing tutorials / documentation for v16 #1433

@isaacsas

Description

@isaacsas

Several major v16 features will be advertised in the README and HISTORY.md but lack dedicated tutorial content in the documentation. This issue tracks the tutorials that should be added.

1. @brownians and @poissonians DSL options

Current state: Mentioned in the index.md example and listed in the API page (core_api.md lines 95-96), but no dedicated tutorial section exists. The coupled_non_crn_models.md page mentions them only in a one-line summary. The noise_modelling_approaches.md example page does not mention them at all.

What to add:

  • A section in coupled_non_crn_models.md (or dsl_advanced.md) demonstrating:
    • How to declare brownians/poissonians via the DSL (@brownians, @poissonians)
    • How to use them in @equations blocks to add environmental noise to non-species variables
    • How brownians interact with SDE problem creation (auto-enables mtkcompile)
    • How poissonians interact with jump problem creation
    • A worked example showing an ODE for a non-species variable with additive Brownian noise (similar to the README cell-volume example but with more explanation)
  • A mention/cross-reference in noise_modelling_approaches.md as a fourth approach for modeling noise

2. HybridProblem, hybrid_model, and PhysicalScale metadata

Current state: hybrid_model now has an API @docs block in core_api.md but there is zero tutorial content. PhysicalScale enum and per-reaction scale metadata are completely undocumented in tutorials.

What to add:

  • A new section in simulation_introduction.md (or a new dedicated page) covering:
    • The concept of hybrid models mixing ODE, SDE, and Jump reactions
    • How to set PhysicalScale metadata on individual reactions (via DSL and programmatic API)
    • The PhysicalScale enum values: Auto, ODE, SDE, Jump, VariableRateJump
    • Creating a HybridProblem from a ReactionSystem with mixed-scale reactions
    • Using hybrid_model to get the intermediate System
    • A worked example: e.g., a system where some reactions are deterministic (ODE) while others are stochastic (Jump)
    • Clarify the relationship: JumpProblem now produces pure-jump systems only; for mixed ODE+Jump or SDE+Jump, use HybridProblem

3. Unit validation

Current state: API @docs blocks exist in core_api.md for validate_units, assert_valid_units, unit_validation_report, etc. The @unit_checks DSL option is listed. But there is no tutorial showing how to use any of this.

What to add:

  • A new page (e.g., model_creation/unit_validation.md) or a section in an existing page covering:
    • Enabling unit checks via @unit_checks true in the DSL
    • Attaching units to species and parameters (via DynamicQuantities.jl symbolic units us"...")
    • How Catalyst validates dimensional consistency of reactions (rates vs. stoichiometry)
    • Using validate_units(rs) and assert_valid_units(rs) post-hoc
    • Reading a unit_validation_report
    • A worked example showing a model with correct units and one with intentional unit errors
    • Note about using symbolic units (us"...") vs. concrete units (u"...")

4. @discretes and @tstops DSL options

Current state: Listed in core_api.md (lines 97, and @tstops not listed at all). @discretes appears in one code example in events.md (line 177) without much explanation. @tstops is not mentioned anywhere in the docs.

What to add:

  • A section in events.md or dsl_advanced.md covering:
    • What discrete parameters are and when to use them (time-dependent parameters modified by events)
    • How to declare them via @discretes in the DSL
    • A worked example showing discrete parameters used with event callbacks
  • For @tstops:
    • What solver time stops are
    • How to declare them via @tstops in the DSL
    • When they are needed (e.g., ensuring the solver hits specific time points for discrete events)

5. mtkcompile keyword documentation

Current state: Mentioned in the Hodgkin-Huxley example and the FAQs, but not explained in the primary tutorials where users would encounter it.

What to add:

  • A note/subsection in coupled_non_crn_models.md and/or simulation_introduction.md explaining:
    • When mtkcompile = true is needed (algebraic equations require it; brownians auto-enable it)
    • What it does (runs ModelingToolkitBase's mtkcompile to structurally simplify the system)
    • The error message users will see if they forget it with algebraic equations
    • That it is automatically enabled when brownians are present (so users don't need to pass it in that case)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions