Rank: 245679 based on 0 downloads (last 30 days) and 0 file submitted
photo

Alvaro Campos Duque

E-mail
Company/University
University of Castilla La Mancha

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Alvaro View all
Updated File Comments Rating
17 May 2013 fminsearchbnd, fminsearchcon Bound constrained optimization using fminsearch Author: John D'Errico

Yeah, it works =) Thank u so much!!

16 May 2013 fminsearchbnd, fminsearchcon Bound constrained optimization using fminsearch Author: John D'Errico

Congrats again for the useful function John. I just have a qestion: i'm trying to use fminsearchcon in a 5 parameter function i've created:

function error=fit(parameters)
x1=parameters(1);
x2=parameters(2);
x3=parameters(3);
x4=parameters(4);
x5=parameters(5);
(...) Here there is a long script but, at the end, the important thing are the input and outputs (...)

What I wonder is to find the parameters that optimize the error function. These parameters are interelated by the non-linear constrain:

-2.3*(x4^2+x3)^0.5+x5+x2>0

The problem is that I don't know how to implement this constrain, the examples I have seen are just with one parameter. I have tried this:

x0=[0.5,0.05,0.05,1,0.5];
lb=[0,0,0,0,0];
ub=[2,1,1,10,5];
[x,fval]=fminsearchcon(@fit,x0,lb,ub,[],[],@(x2,x3,x4,x5) 2.3*(x4^2+x3)^0.5-x5-x2)

But, of course, it doesn't recognise what is x2, x3, x4, or x5 because it is defined nowhere.

Any clue?? Thanks in advance! :)

16 May 2013 fminsearchbnd, fminsearchcon Bound constrained optimization using fminsearch Author: John D'Errico

Congratulations John, thank you so much for such a good job!

Contact us