pympcc.ParametricMPCC¶
- class pympcc.ParametricMPCC(n, n_comp, objective, comp_G, comp_H, eq_constraints=None, ineq_constraints=None, n_eq=0, n_ineq=0, xl=None, xu=None)[source]¶
Bases:
objectJAX-traceable MPCC parameterised by an external vector
θ.Mirrors
pympcc.MPCCProblembut every callable takes(x, θ)instead of justx. All callables must be JAX-differentiable (usejax.numpyoperations exclusively).- Parameters:
- objective¶
f(x, θ) -> scalar.- Type:
callable
- comp_G, comp_H
G(x, θ) -> (n_comp,)/H(x, θ) -> (n_comp,).- Type:
callable
- eq_constraints, ineq_constraints
h(x, θ) -> (n_eq,)/g(x, θ) -> (n_ineq,).- Type:
callable, optional
- n_eq, n_ineq
Constraint counts (default
0).- Type:
- xl, xu
Variable bounds; treated as constants by the autodiff pass.
- Type:
array-like, optional
- __init__(n, n_comp, objective, comp_G, comp_H, eq_constraints=None, ineq_constraints=None, n_eq=0, n_ineq=0, xl=None, xu=None)¶
Methods
__init__(n, n_comp, objective, comp_G, comp_H)materialise(theta_np, x0)Build a numeric
MPCCProblemwithθbaked into closures.Attributes
- materialise(theta_np, x0)[source]¶
Build a numeric
MPCCProblemwithθbaked into closures.Sets
derivatives="jax"so all gradients/Jacobians are produced byjax; the closure overtheta_npstays JAX-traceable in thexargument becausetheta_npis a constant.- Return type:
- Parameters: