Skip to content

Chemostat PDE example: trait-structured population model #47

Description

@jc-macdonald

Chemostat PDE example: trait-structured population model

Add a chemostat PDE example that demonstrates op_engine on a real reaction-diffusion system. This is the first PDE testbed for the package and serves as validation for the structured-observables manuscript.

Model

Trait-structured chemostat with resource coupling:

∂n/∂t = n·g(θ,S) − D·n + d·∂²n/∂θ²    (population density)
dS/dt  = D·(S_in − S) − ∫ n·g(θ,S) w(θ) dθ  (resource)

where g(θ,S) is the growth function, D is dilution rate, d is trait diffusion, w(θ) is uptake weight.

IMEX splitting

Implementation

  • examples/chemostat_pde.py — complete working example
  • Non-uniform trait grid via adaptive generation (Adaptive curvature-weighted grid generation #46)
  • IMEX time-stepping via CoreSolver (imex-euler or imex-heun-tr)
  • Observable computation: total biomass I, mean trait ρ, variance Σ, skewness κ, kurtosis ξ
  • Comparison with explicit RK45 reference solution
  • Docs-site guide with figures

Source code reference

  • Thoery_1_Code.ipynb: simulate_model1_crank_nicolson — CN FV on non-uniform grid
  • Chemostat_Simulator.ipynb: simulate_model2_semi_implicit — CN with positivity projection

Depends on

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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