initialize_with_piecewise_linear_approximation

(function from pyomo.devel.initialization.initialize)

pyomo.devel.initialization.initialize.initialize_with_piecewise_linear_approximation(nlp: BlockData, nlp_solver: SolverBase | None = None, mip_solver: SolverBase | None = None, default_bound: float = 100000000.0, max_pwl_refinement_iter: int = 100, num_pwl_cons_to_refine_per_iter: int = 5, aggressive_substitution: bool = True, skip_initial_nlp_solve: bool = False, bounds_tol: float = 1e-06) Results[source]

Attempt to initialize the problem with a piecewise linear approximation and subsequently solve the model given by nlp.

Parameters:
  • nlp (BlockData) – The pyomo model to be initialized.

  • nlp_solver (Optional[SolverBase]) – A solver interface appropriate for NLPs. Default: ipopt

  • mip_solver (Optional[SolverBase]) – A solver interface appropriate for LPs and MILPs. Default: gurobi_persistent

  • default_bound (float) – All unbounded variables will be given lower and upper bounds equal to default_bound.

  • max_pwl_refinement_iter (int) – This is the maximum number of iterations used to refine the piecewise linear approximation.

  • num_pwl_cons_to_refine_per_iter (int) – This is the maximum number of constraints to be refined with additional segments in the piecewise linear approximation each iteration.

  • aggressive_substitution (bool) – This is passed along to the contrib.piecewise.univariate_nonlinear_decomposition transformation.

  • skip_initial_nlp_solve (bool) – If True, the initial attempt at solving the NLP without initialization will be skipped.

  • bounds_tol (float) – Bad things can happen with piecewise linear functions if the value of a variable ends up outside of the variable’s bounds. This bounds_tol is used to ensure that variable values are sufficiently inside of the variable’s bounds.

Returns:

res – The results object obtained the last time the nlp_solver was used to try and solve the model.

Return type:

pyomo.contrib.solver.common.results.Results