initialize_with_LP_approximation

(function from pyomo.devel.initialization.initialize)

pyomo.devel.initialization.initialize.initialize_with_LP_approximation(nlp: BlockData, nlp_solver: SolverBase | None = None, lp_solver: SolverBase | None = None, default_bound: float = 100000000.0, use_univariate_nonlinear_decomposition: bool = True, aggressive_substitution: bool = False, num_samples_per_nonlinear_constraint: int = 100, seed=0, skip_initial_nlp_solve: bool = False) Results[source]

Attempt to initialize the problem with an LP 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

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

  • default_bound (float) –

    Some initialize methods require all nonlinear variables to be bounded. For these methods, all unbounded variables will be given lower and upper bounds equal to default_bound. Needed for the following methods:

    • pwl_approximation

    • lp_approximation

  • use_univariate_nonlinear_decomposition (bool) – If False, the transformation

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

  • num_samples_per_nonlinear_constraint (int) – This is the number of random samples used to build the linear least squares problem for each nonlinear constraint.

  • seed (int | np.random.Generator) – This is used to make the sampling for the linear least squares problems deterministic.

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

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