Adjusting existing Matlab code for YALMIP implementation

233 views
Skip to first unread message

Tom

unread,
Sep 18, 2018, 3:21:50 AM9/18/18
to YALMIP

Dear professor Lofberg,


First of all, thank You for your effort in developing and sharing such useful software.


After reading about YALMIP in one of the papers I have decided to try and test it myself.

The problems I am analysing are related to power system optimization. They are based on sequential (nonlinear, second order) load flow calculations (Newton-Raphson method), and incorporate both equality and non-equality constraints (linear and nonlinear). I have already written a substantial amount of Matlab code and successfully applied it in solving such problems. For this purpose, I have used both interior point (fmincon) and genetic algorithm (ga) optimization.

My initial idea was to try and merge my existing code with YALMIP solver in order to later possibly exploit some of YALMIP features. However, my initial efforts have, so far, proven to be unsuccessful.


The objective function and constraints I am using are adjusted for Matlab fmincon and ga optimization, and are generally defined as:

fitnessfcn=@(x)fitnessNC(x,IN,VAR); // Complex objective function where x is a decision variable vector, and IN and VAR contain all the information needed for the calculation
constraintfcn
=@(x)icsetcontraintSA(x,IN,VAR); //
Set of constraint functions

Initially, for testing purpose, I have tried to solve a simple optimization problem with a single linear decision variable x and without the complex constrint functions (constraint only on x: (F)). I used following modifications of the code:

sdpvar x;
assign(x,1.0);
ops = sdpsettings('solver','fmincon', 'usex0',1);
objective=fitnessNC(x,IN,VAR);
F = [0.8 <= x <= 1.2];
sol = optimize(F, objective, ops);

However, I always get stuck in at the initial point with the following message:

                                            First-order      Norm of

 Iter F-count            f(x)  Feasibility   optimality         step

    0       1    0.000000e+00    0.000e+00    0.000e+00

Initial point is a local minimum that satisfies the constraints.

Optimization completed because at the initial point, the objective function is non-decreasing

in feasible directions to within the selected value of the optimality tolerance, and

constraints are satisfied to within the selected value of the constraint tolerance.

<stopping criteria details>

Optimization completed: The final point is the initial point.

The first-order optimality measure, 0.000000e+00, is less than options.OptimalityTolerance =

1.000000e-06, and the maximum constraint violation, 0.000000e+00, is less than

options.ConstraintTolerance = 1.000000e-06.

Optimization Metric                                           Options

first-order optimality =   0.00e+00       OptimalityTolerance =   1e-06 (selected)

max(constraint violation) =   0.00e+00  ConstraintTolerance =   1e-06 (selected)


I was hoping if You could give me some advice on this subject on how to implement YALMIP to the existing code initially used with default Matlab optimization solvers.


Sorry for the long post, and for (possibly) stupid question. Thank You for every advice You could give me.

Best regards




Johan Löfberg

unread,
Sep 18, 2018, 4:11:12 AM9/18/18
to YALMIP
Well, since I don't have the function, I can only repeat what fmincon claims: Your initial point is a local minima
Reply all
Reply to author
Forward
0 new messages