Filter löschen
Filter löschen

NLP problem with fmincon: Non-differentiable point in objective function

6 Ansichten (letzte 30 Tage)
Consider the simplified optimisation problem having as decision variable the vector:
where N is the number of discretisation points, multiplied by the number of variables per point (e.g. 6 state variables and 3 control variables).
Let the objective function be defined such that the control effort is minimised:
Where n is the number of discretisation points and is the 3x1 control vector at the i-th time instant.
In code notation, this becomes:
%% Example:
% Problem data:
timeInstants = 10;
stateVariables = 6;
controlVariables = 3;
allVariables = stateVariables + controlVariables;
decisionVariables = allVariables*timeInstants;
% Indeces:
idx = reshape(1:decisionVariables,allVariables,[])';
controlIdx = idx(:,1:controlVariables)';
% NLP vector:
x = rand(1,decisionVariables);
% Objective function:
f = sum(vecnorm(x(controlIdx)));
From literature, I know that the optimal solution of my problem is bang-bang, i.e.:
The analytical Jacobian and Hessian are defined as:
Considering the control profile I'm looking for, the convergence is affected by the singularity when , where both Jacobian and Hessian become indeterminate.
I tried to overcome the problem by imposing alternatives forms when the NaN occurs (such as ones or zeros), but considering that the zero solution is optimal, this causes convergence failures.
The same problem occurs with numerical derivatives.
How can I overcome this problem?
Do you have any reference about other people facing this issue?
Thanks in advance.

Antworten (1)

Torsten
Torsten am 12 Jun. 2024
Bearbeitet: Torsten am 12 Jun. 2024
The solution variables for "fmincon" must be continuous in order to compute gradients, Hessians etc. Therefore, the solver is not suited for problems with decision variables. Maybe you can use "intlinprog", maybe you have to use "ga".
  1 Kommentar
chicken vector
chicken vector am 14 Jun. 2024
Thanks for your reply.
I've found a solution which was actually quite simple, using the following lower bound:

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by