The question about numerical problem.

34 views
Skip to first unread message

MK

unread,
Jul 17, 2018, 9:14:00 AM7/17/18
to YALMIP
Dear sir,

When i sovle a convex problem which objection function is in the form of log(1 + xlog(1 + x/y)),fmincon stopped with "local minimum possible".

The problem is as bellow and the constraints (1)(2)(18)(19) are all linear function. The constraint (20)is also convex. 

And my program is attached. 


Can you give me some suggestions on the problem?  And how to tackle these similarly problem? 

Thank you, Sir.
cons_p2_convex.m
obj_p2_convex.m
two_stage_convex.m

Johan Löfberg

unread,
Jul 17, 2018, 9:24:17 AM7/17/18
to YALMIP
>> two_stage_convex
Undefined function or variable 'cons_p2'.

Error in two_stage_convex (line 115)
    tmp_p2 = cons_p2(alpha_u,alpha_d,fai_u,fai_d,q_iter(:,:,k));
 

MK

unread,
Jul 17, 2018, 9:44:45 AM7/17/18
to YALMIP
Sorry, there are some errors, i have reupload it. And it seems the first optimize problem didn't return the answer.

Thanks for your time.
two_stage_convex.m

Johan Löfberg

unread,
Jul 17, 2018, 9:48:17 AM7/17/18
to YALMIP

Undefined function or variable 'cons_p4'.

Error in two_stage_convex (line 127)
    tmp_p4 = cons_p4(alpha_u_opt,alpha_d_opt,p_u_opt,p_d_opt,q,q_iter(:,:,k));
 

and you should fix your strict inequalities to get rid of all the warnings

MK

unread,
Jul 17, 2018, 9:57:22 AM7/17/18
to YALMIP
I have add a breakpoint on line 118, and the problem in line 118 didn't return the solve result.

The problem in line 118 result in some variables to be NaN. Thus, it have the errors bellow when it keep running.


obj_p4.m
cons_p4.m

Johan Löfberg

unread,
Jul 17, 2018, 10:04:11 AM7/17/18
to YALMIP
well, your are not looking at result_p2, it says that the call failed.

result_p2 = 

  struct with fields:

    yalmiptime: NaN
    solvertime: NaN
          info: 'Unknown problem in solver (Turn on 'debug' in sdpsettings) (Error using barrier↵Objective function is undefined at initial point. Fmincon cannot continue.)'
       problem: 9

the solver has crashed due to evaluations in the origin with all your logarithms etc. You ill have to add lower bounds on variables so that the origin isn't tested as an initial point, or reformulate your objective to avoid these singularities. I think this can be pretty tricky in your model

MK

unread,
Jul 17, 2018, 10:09:30 AM7/17/18
to YALMIP
Thanks, i will check it now.
Reply all
Reply to author
Forward
0 new messages