From: Shu on
Hi all,

When I use fmincon to solve a nonlinear programming problem, I have the constraint from the system dynamic equations, like dx/dt = f(x,u). Is there any way to incorporate or transform this constraint to the form, like ceq = 0, which is used in fmincon?

Thanks a lot,

Shu
From: James Allison on
The usual way to solve this type of problem is to solve the differential
equation within the objective function. This approach implicitly
satisfies the constraint, so there is no need to add an explicit
equality constraint to the optimization problem. This approach is known
as the multidisciplinary feasible approach (MDF). See section 4.1.1 of:

http://deepblue.lib.umich.edu/handle/2027.42/58449

You can use one of MATLAB's ode solvers to solve the differential
equation, such as ode45. If the problem is stiff, you may need to use
one of the stiff solvers, such as ode15s.

When your objective function is the output of a simulation, the function
is not perfectly smooth. As a result, gradient-based algorithms (like
fmincon) can sometimes have a challenge solving these types of problems.
You can make the objective function smoother by reducing the simulation
step size, but this increases simulation time. Another approach is to
increase the minimum finite difference step size for fmincon. This
allows the optimization to see the response as smooth, but does come at
the cost of some precision in the solution. Often this is an acceptable
tradeoff. You can adjust the step size using optimset to change the
parameter DiffMinChange.

An alternate approach is to not use a simulation, and include an euality
constraint like you describe. You must discretize the ODE over t,
resulting in a large set of equality constraints. This is know as the
All-at-Once (AAO) approach, or Simultaneous Analysis and Design (SAND).
This is doable, but is harder to implement and may be hard to get the
same accuracy as the MDF approach. It may have faster solution time,
however. See section 4.1.3 in the document linked to above for a
description.

Best Regards,

-James

Shu wrote:
> Hi all,
>
> When I use fmincon to solve a nonlinear programming problem, I have the
> constraint from the system dynamic equations, like dx/dt = f(x,u). Is
> there any way to incorporate or transform this constraint to the form,
> like ceq = 0, which is used in fmincon?
>
> Thanks a lot,
>
> Shu
From: Shu on
Thanks a lot

Shu



James Allison <james.allison(a)mathworks.com> wrote in message <i2cdre$pto$1(a)fred.mathworks.com>...
> The usual way to solve this type of problem is to solve the differential
> equation within the objective function. This approach implicitly
> satisfies the constraint, so there is no need to add an explicit
> equality constraint to the optimization problem. This approach is known
> as the multidisciplinary feasible approach (MDF). See section 4.1.1 of:
>
> http://deepblue.lib.umich.edu/handle/2027.42/58449
>
> You can use one of MATLAB's ode solvers to solve the differential
> equation, such as ode45. If the problem is stiff, you may need to use
> one of the stiff solvers, such as ode15s.
>
> When your objective function is the output of a simulation, the function
> is not perfectly smooth. As a result, gradient-based algorithms (like
> fmincon) can sometimes have a challenge solving these types of problems.
> You can make the objective function smoother by reducing the simulation
> step size, but this increases simulation time. Another approach is to
> increase the minimum finite difference step size for fmincon. This
> allows the optimization to see the response as smooth, but does come at
> the cost of some precision in the solution. Often this is an acceptable
> tradeoff. You can adjust the step size using optimset to change the
> parameter DiffMinChange.
>
> An alternate approach is to not use a simulation, and include an euality
> constraint like you describe. You must discretize the ODE over t,
> resulting in a large set of equality constraints. This is know as the
> All-at-Once (AAO) approach, or Simultaneous Analysis and Design (SAND).
> This is doable, but is harder to implement and may be hard to get the
> same accuracy as the MDF approach. It may have faster solution time,
> however. See section 4.1.3 in the document linked to above for a
> description.
>
> Best Regards,
>
> -James
>
> Shu wrote:
> > Hi all,
> >
> > When I use fmincon to solve a nonlinear programming problem, I have the
> > constraint from the system dynamic equations, like dx/dt = f(x,u). Is
> > there any way to incorporate or transform this constraint to the form,
> > like ceq = 0, which is used in fmincon?
> >
> > Thanks a lot,
> >
> > Shu
 | 
Pages: 1
Prev: global variables in parfor loop
Next: GUI for loop