HeterogeneousSolution

experimental.network_dynamics.HeterogeneousSolution(
    ts,
    ys,
    *,
    dt=None,
    variable_names=None,
    group_nodes=None,
    n_nodes=None,
)

Trajectories for named dynamics groups on one shared time grid.

Args: ts: Shared time points with shape [n_time]. ys: Mapping from group names to natural trajectory arrays with shape [n_time, n_variables, n_group_nodes]. dt: Optional integration time step, stored as static PyTree metadata. variable_names: Optional mapping from group names to variable names in trajectory-axis order. group_nodes: Optional mapping from group names to their graph-node order. Required, together with n_nodes, for to_graph(). n_nodes: Optional size of the shared graph.

Attributes: ts: Shared time points. ys: Raw arrays in a Bunch keyed by group name. dt: Optional integration time step. variable_names: Variable-name tuples keyed by group. n_nodes: Optional shared graph size.

Notes: groups constructs lightweight NativeSolution views for named selection and plotting. Use ys when direct array access is preferred.

Attributes

Name Description
data Alias for the raw group-array ys mapping.
group_nodes Graph-node indices for groups with available projection metadata.
groups Construct NativeSolution views keyed by group name.
time Alias for ts.

Methods

Name Description
plot Plot one group or a multi-group trajectory overview.
sel Select variables and local nodes from one named group.
to_graph Project one named variable from selected groups to graph-node order.

plot

experimental.network_dynamics.HeterogeneousSolution.plot(
    group=None,
    *,
    groups=None,
    variables=None,
    nodes=None,
    t_range=None,
    max_nodes=10,
    default_window=10000.0,
    ax=None,
    figsize=None,
    dpi=150,
    **plot_kwargs,
)

Plot one group or a multi-group trajectory overview.

Passing group= preserves the group-local :meth:NativeSolution.plot view. With group=None, each group gets one column containing its own selected native-variable rows.

Args: group: Optional single group to plot with NativeSolution.plot. groups: Optional group names for the overview. None selects all groups. Incompatible with group. variables: Variable selection shared by all groups, or a mapping from group name to its selection. None plots every variable. nodes: Local-node selection shared by all groups, or a mapping from group name to its selection. Integer N means the first N local nodes, matching NativeSolution.plot. t_range: Optional (t_start, t_end) time window. max_nodes: Cap used for groups where nodes is None. default_window: Initial time window when t_range is None. ax: Optional mapping from group names to their Axes sequences. figsize: Figure size when creating the overview. dpi: Figure DPI when creating the overview. **plot_kwargs: Forwarded to each Axes.plot call.

Returns: For one group, the return value of NativeSolution.plot. For an overview, (fig, axes) with an Axes list keyed by group.

sel

experimental.network_dynamics.HeterogeneousSolution.sel(
    group,
    variables,
    nodes=None,
)

Select variables and local nodes from one named group.

to_graph

experimental.network_dynamics.HeterogeneousSolution.to_graph(
    variable,
    groups=None,
    fill_value=jnp.nan,
)

Project one named variable from selected groups to graph-node order.

Args: variable: Variable name to select from each chosen group. groups: Optional group names. With None, groups lacking the variable are skipped; explicitly selected groups must provide it. fill_value: Value for graph nodes not represented by the selection.

Returns: Array with shape [n_time, n_nodes].

Raises: ValueError: If graph metadata, selected groups, or the requested variable are unavailable.