Skip to content

Dynamic axis management: add/remove/reshape axes at specification time #2

@jc-macdonald

Description

@jc-macdonald

Support declarative addition and removal of axes in the system specification, so users can straightforwardly extend a model with new trait, spatial, or structured dimensions.

Motivation

A TRIDENT-like model starts with trait axes (phytoplankton size θ, zooplankton size ϑ) and a spatial axis (depth z). A user should be able to:

  1. Add a new trait axis (e.g. light-harvesting pigment ratio) with one YAML block
  2. The compiler should automatically:
    • Extend the state tensor dimensions
    • Wire diffusion operators for the new axis
    • Adjust reaction terms that depend on the new trait
    • Validate that rate functions have the right arity

Tasks

  • Axis type hierarchy: TraitAxis, SpatialAxis, StructuredAxis (age, stage, etc.)
  • Each axis declares: name, bounds, default resolution, diffusion coefficient (optional), boundary conditions
  • add_axis!(spec, axis) — extend a compiled SystemSpec with a new dimension
  • remove_axis!(spec, name) — project out a dimension (integrate or marginalise)
  • Validate: reaction terms must accept the correct number of trait arguments after axis changes
  • Tensor-product grid assembly: the full state is the outer product of all axis grids
  • Resolution independence: axes can have different resolutions; the compiler handles indexing

Cross-references

Boundary

This is specification — how axes are declared and validated. The grid points (uniform or adaptive) are computed by OpEngine.jl. The evaluation of whether adding an axis improves predictions is ModelCriticism.jl.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions