Skip to main content
Version: v0.7.0 beta

Supported Problem Formulation

OPTIMake solves the following optimization problem:

minv1,,vNi=1Nl(vi,p)+le(vN,p)subject tofs(v1,p)=0,f(vi,vi+1,p)=0,i=1,,N1,fe(vN,p)=0,g(vi,p)0,i=1,,N\begin{split} &\quad \quad \quad \min_{v_1,\cdots,v_N} \sum_{i=1}^{N} l(v_i, p) + l_e(v_N, p) \\ &\begin{split} \text{subject to} &\quad f_s(v_1, p) = 0,\\ &\quad f(v_{i}, v_{i+1}, p) = 0,\quad i=1,\cdots,N - 1,\\ &\quad f_e(v_N, p) = 0,\\ &\quad g(v_i, p) \geq 0,\quad i=1,\cdots,N \end{split} \end{split}

This optimization problem has NN stages and may be a nonlinear non-convex optimization problem. Where:

  • v1,,vNRnvv_1,\cdots,v_N \in \mathbb{R}^{n_{v}} are the optimization variables
  • pRnpp\in \mathbb{R}^{n_{p}} are the parameters
  • l:Rnv×RnpRl: \mathbb{R}^{n_{v}} \times \mathbb{R}^{n_{p}} \rightarrow \mathbb{R} is the stage objective
  • le:Rnv×RnpRl_e: \mathbb{R}^{n_{v}} \times \mathbb{R}^{n_{p}} \rightarrow \mathbb{R} is the additional objective at the terminal point
  • fs:Rnv×RnpRnfsf_s: \mathbb{R}^{n_{v}} \times \mathbb{R}^{n_{p}} \rightarrow \mathbb{R}^{n_{f_s}} is the initial equality constraint
  • f:Rnv×Rnv×RnpRnff: \mathbb{R}^{n_{v}} \times \mathbb{R}^{n_{v}} \times \mathbb{R}^{n_{p}} \rightarrow \mathbb{R}^{n_{f}} is the transition equality constraint
  • fe:Rnv×RnpRnfef_e: \mathbb{R}^{n_{v}} \times \mathbb{R}^{n_{p}} \rightarrow \mathbb{R}^{n_{f_e}} is the terminal equality constraint
  • g:Rnv×RnpRngg: \mathbb{R}^{n_{v}} \times \mathbb{R}^{n_{p}} \rightarrow \mathbb{R}^{n_{g}} is the inequality constraint

Problem Definition

Below is an example of defining a problem, which specifies the problem name as vehicle with a maximum of 10 stages:

prob = multi_stage_problem(name='vehicle', N=10)

The function parameters are defined as follows:

  • name: str The name of the problem, which will be used in generated code file names, function names, etc.

  • N: int The maximum number of stages for the problem, must be greater than or equal to 1

info
  • Since the above optimization problem is a multi-stage optimization problem, the equality and inequality constraint expressions are identical across all stages, so they only need to be defined once rather than separately for each stage (the same applies to parameters and optimization variables)
  • N is the maximum number of stages. OPTIMake supports dynamic stage counts, meaning the effective number of stages can be set to less than N at solve time, but cannot exceed N

After defining the problem name and number of stages, the following sections describe how to define the parameters, optimization variables, and constraints in the optimization problem.