Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!73g2000cwn.googlegroups.com!not-for-mail
From: strefli3@gmail.com
Newsgroups: comp.soft-sys.matlab
Subject: Re: Fmincon + Ansys, Looking for a global minimum
Date: 12 Dec 2006 08:02:08 -0800
Organization: http://groups.google.com
Lines: 103
Message-ID: <1165939328.273924.306090@73g2000cwn.googlegroups.com>
References: <1164841726.133763.24890@j72g2000cwa.googlegroups.com>
NNTP-Posting-Host: 35.9.40.36
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Trace: posting.google.com 1165939333 16958 127.0.0.1 (12 Dec 2006 16:02:13 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 12 Dec 2006 16:02:13 +0000 (UTC)
In-Reply-To: <el4205$7h4$1@fred.mathworks.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: 73g2000cwn.googlegroups.com; posting-host=35.9.40.36;
Xref: news.mathworks.com comp.soft-sys.matlab:383428



Thanks for all the help everyone. Using everyone suggestions I am still
arriving at local minimums though. However I decided to simply write my
own algorithm based on my knowlege of the optimim solution.

Knowing that at the optimum solution all of my constraints will be
active, unless of course the design varaible is at its lb, a very
simple algorithm can be implemented to solve the problem. Indeed it
found the local minimum,  and it only took 51s. Compared to GAs that
where taking 6+hours.

Thanks again,

Rakesh Kumar wrote:
> You can try using some evolutionary algorithms or even better some form of
> hybrid scheme (evolutionary & classical together) to maximize your chances
> of finding a global minimum. If you have access to Genetic Algorithm and
> Direct Search Toolbox, you may try one of two schemes:
>
> - Use PATTERNSEARCH function with a search step. here are the options I
> would use to find a global minimum.
>
> options =
> psoptimset('SearchMethod',{@searchlhs,10},'InitialMeshSize',10,'Display','iter')
>
> % Call patternsearch
> [R,weight,exit,output] =
>  patternsearch(@obj,R0,M,b,Meq,beq,lb,ub,@cons,options)
>
> You can play with options such as 'InitialPenalty' and 'PenaltyFactor' if
> nonlinear constraints are not easily satisfied.
>
>
> - Use GA with FMINCON as hybrid function
> options = gaoptimset('HybridFcn',@fmincon, 'PopulationSize',
> 200,'Generations',500,'MutationFcn',@mutationadaptfeasible,'Display','iter');
>
> % Call ga
> [R,weight,exit,output] =
>  ga(@obj,numel(R0),M,b,Meq,beq,lb,ub,@cons,options)
>
> Note that the second input argument to GA is numel(R0) i.e., number of
> variables.
>
> hth,
> Rakesh
>
> <strefli3@gmail.com> wrote in message
> news:1164921803.302933.143550@80g2000cwy.googlegroups.com...
> > Dmitrey,
> > I have downloaded OpenOpt and read all the documentation, but I can't
> > seem to implement it into my current situation. Let me exaplain how I
> > use fmincon
> >
> > [R,weight,exit,output] =
> > fmincon(@obj,R0,M,b,Meq,beq,lb,ub,@cons,options)
> >
> > Breaking it down:
> > @obj represents my objective function, this is simply the weight of the
> > truss which is then scalled to be a reasonable. In other words it is
> > each design variable, which is a the radius of the bar squared, *pi *
> > length.
> >
> > R0 is my initial guess to the problem
> >
> > M,b,Meq,beq are all empty
> >
> > lb and ub are my upper bounds and lower bounds of the design variables.
> >
> > @cons is a function that calls Ansys which the retuns stresses for each
> > bar and then @cons converts them to contraints based on the maximium
> > allowable stress.
> >
> > So my question is, How do I call OpenOPT with my in the way that I use
> > fmincon; using the @cons function to determine the contraints?
> >
> > Thanks for the tips thus far.
> >
> > Dmitrey wrote:
> >> Hi strefli3
> >> If you are interested in local-global solvers, I would propose you to
> >> try hPSO from OpenOpt
> >> It was written by Alexandros Leontitsis & we make some changes - for
> >> example, replaced inner solver from MATLAB fminsearch to Shor r-alg
> >> with AST. However, currently it can handle non-linear constraints via
> >> N*max(0, c(x)), where N is a big number; on the other hand, in a very
> >> sucsessful way.
> >> however, it's 1st-order optimizer & don't use user-supplied Hesse
> >> matrix (but can use (sub)gradient info)
> >> Lates Openopt version is available at
> >>  <http://www.box.net/public/6bsuq765t4>
> >> if you'll find the OpenOpt usefull please make a good review at
> >>
> >> <http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=13115&objectType=file>
> >> OpenOpt also includes GAConstrain solver, which can handle c(x)<=0
> >> & Ax<=b; also you must provide lb, ub. However, as all global
> >> solvers, it can handle only small-scaled problems with nvars ~1...15
> >>
> >> You can try non-smooth solver fminsearchOS (free, use web search) or
> >> snopt() from TOMLAB - they propose 21 evaluation ver, but their
> >> prices are not for everyone.
> >> best regards, Dmitrey
> >