gEconpy.model.steady_state.build_root_graphs#

gEconpy.model.steady_state.build_root_graphs(equations, ss_input_nodes, use_jac=True)#

Build the pytensor graphs needed by scipy.optimize.root.

The equations are stacked into a residual vector internally. The Jacobian is computed via sparse_jacobian(), which exploits the sparsity pattern of the steady-state system.

Parameters:
equationslist of TensorVariable

Individual scalar equation graphs, each equal to zero at the steady state.

ss_input_nodeslist of TensorVariable

Scalar input nodes for each steady-state variable.

use_jacbool, optional

Whether to build the Jacobian graph. Default is True.

Returns:
residTensorVariable

Stacked residual vector of shape (n_eq,).

jacTensorVariable or None

Jacobian of shape (n_eq, n_var), or None if use_jac is False.