API Reference ============= The entire public API is provided by the :any:`SymbolicCompartmentalModel ` class. The list below covers the most commonly used members; click any entry to jump to its full documentation. Model setup ----------- :any:`SymbolicCompartmentalModel(n_states) ` Constructor — create a new model with *n_states* compartments. :any:`contributed_turnovers ` Get / set the rate matrix **M** (*n_states* × *n_states*). ``M[i, j]`` is the transfer rate from state *j* into state *i*; diagonal entries must be ≤ 0. :any:`observed_pool_weights ` Get / set the fractional weights of the observed pools (must sum to 1). :any:`growth_rate ` Get / set the dilution rate µ (added to all diagonal entries during computation). :any:`add_parameter(symbol, lb, ub) ` Register a free symbolic parameter with lower and upper bounds for later fitting. Simulation and symbolic analysis --------------------------------- :any:`as_symbolic(key) ` Return a SymPy expression for any dynamic attribute (e.g. ``"f"``, ``"mean_age"``, ``"mean_residence_time"``). :any:`as_numeric(key) ` Return a numeric scalar, array, or callable for any dynamic attribute. Fitting ------- :any:`fit(tdata, ydata) ` Fit the model to a single labeling time series using basin-hopping global optimisation. :any:`fit_multiple_pools(data) ` Fit a single model to labeling data from multiple pools simultaneously. :any:`estimate_mean_age_trapezoid(tdata, ydata) ` Model-free estimate of mean age by numerical integration of the labeling curve. :any:`estimate_mean_residence_time_trapezoid(tdata, ydata, mu) ` Model-free estimate of mean residence time by numerical integration. Visualization ------------- :any:`plot(key) ` Plot any dynamic attribute over a time range on a matplotlib axes. :any:`draw_transition_matrix() ` Draw the compartment network as a directed graph. Full module reference --------------------- :doc:`symbolic_compartmental_model ` .. toctree:: :hidden: autoapi/symbolic_compartmental_model/index