0

For the nonlinear optimization problem in two variables, say, x and y, how to check, if the function is smooth or not and is it medium scale or large scale problem. Should I use 'fmincon' solver (in MATLAB) as there is one linear constraint and bounds on the variables? I need global optima and for a convex function, local optima is same as global optima. But I am not sure about how to check convexity of my function?

My problem is Min f (x, y) where x < y and x, y > 0

Dr Nisha Arora
  • 632
  • 1
  • 10
  • 23

1 Answers1

1

The fmincon solver, specifically the sqp, is very suitable for solving nonlinear quadratic problems with linear constraints. It is best solver you can choose, if you know that your problem is convex. However, with so little information you gave, it is hard to say if your is convex or not. You can check the convex optimization book of Boyd & Vandenberghe (from page 23 on) to see the properties of convex sets and functions.

EDIT

For finding out, whether the function is convex or not, you may try using this file. I don't know how you can check smoothness. You may find a lot of information on large-scale , medium-scale problems at every optimization book. For short, it depends on the number of parameters you need to optimize. Plotting is a completely another issue. If you specifically search for it, you will find hundreds of resources.

T-800
  • 1,543
  • 2
  • 17
  • 26
  • Thanks, T-1000. I was asking is there any way MATLAB can check for convexity? And what about smoothness and scale of the problem (medium or large scale)? Do I need to plot it to see smoothness of the function? I am a newbie, please also tell how to get a 'surf plot'. I am using MATLAB 2013, plots are shown inactive with the comment 'no variable selected'. – Dr Nisha Arora Jul 16 '15 at 07:54
  • Thanks again I've download it, tried to run given code. It showed some errors. Initially, I got error like 'Undefined function or variable 'x1' Error in convex_checker (line 2) f=x1^2+sin(x2)-x1*x3 & many more. After struggling about writing the function (referring http://www.mathworks.com/matlabcentral/answers/14049-question-from-global-optimization-webinar) & other errors And finally when I run, I don't get any output. I've tried 'echo on & echo off' and 'stdout' too but not sure where can I get the output, plz help. I am new to it. Thanks & sorry for putting detailed explanation. – Dr Nisha Arora Jul 17 '15 at 17:26
  • Wow, it worked for me , thanks T-1000 for the link. I've pasted the code in my m file and changed the function to check for convexity. Is there a better way like I simply run the convex-checker in command window and when it ask for function, I refer my function, which is saved in some m file. As my function is longer one, which I've written by using sub-functions. – Dr Nisha Arora Jul 24 '15 at 06:55
  • @Dr.NishaArora I am glad that worked! You do not need to copy paste the code into your script. You can simply save the m-file with the same name as your function name in your working directory. Then, whenever the function is called, it will read the function from that m-file. – T-800 Jul 24 '15 at 08:08