Thread Subject: Fmincon + Ansys, Looking for a global minimum

Subject: Fmincon + Ansys, Looking for a global minimum

From: strefli3@gmail.com

Date: 29 Nov, 2006 15:08:46

Message: 1 of 14

Hello,

I am attempting to use fmincon to optimize the cross sectional areas of
a 12 member 3-d truss. My design varaibles are the 12 radii and they
are subject to a lower and upper bound as well as a stress constraint
which happnes to be von-mises supplied my Ansys.

At the moment I can get the program to converge to a solution, but it
is a local minima, infact I can find several different local minima by
adjusting the initial guess; It is clear that this problem is not a
smooth one.

The program makes around 60 iterations with around 1600 function
evaluations before it convereges, updating the hessian almost every
time, if not twice. However, depending on the start location, the
convergance can be found in less iterations.

So my question is, if I know that all my constraints should be 0 (or
near 0) unless a variable is at it's lower bound, then shouldn't there
be some possibility to find the optimum solution based on the present
knowlege of the constraints?

I am open to try any global optimizers. If anyone knows an optimizer
that has the ability to take the contraints in as a seperate function,
please share.

Subject: Fmincon + Ansys, Looking for a global minimum

From: Dmitrey

Date: 30 Nov, 2006 10:08:13

Message: 2 of 14

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

Subject: Fmincon + Ansys, Looking for a global minimum

From: strefli3@gmail.com

Date: 30 Nov, 2006 13:23:23

Message: 3 of 14

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

Subject: Fmincon + Ansys, Looking for a global minimum

From: Dmitrey

Date: 1 Dec, 2006 03:21:03

Message: 4 of 14

Hi strefli3,
first of all you should specify
1) how many variables has your task (just dimension of R0)
2) are your @cons include equality constraints, inequality or both
3) do you supply any (sub)gradients of your objective func (@obj) and
your non-linear constraints (@cons)
4) what time is allowed for program to obtain solution?
5) are your task smooth, non-smooth or discontinious?

 strefli3 wrote:
>
>
> 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
>
>

Subject: Fmincon + Ansys, Looking for a global minimum

From: strefli3@gmail.com

Date: 1 Dec, 2006 10:35:50

Message: 5 of 14

Dmitrey,
I will answer each of your questions.

1) There are 12 design variables. They all have the same upper and
lower bounds.

2) the @cons function returns only inequality constraint. 12 of them to
be exact. For example, the first constraint, G(1) would be defined as:
G(1)=Stress(1)/Stress_Max-1

Where Stress(1) is the stress in the first design variable and
Stress_Max is the yeild strength of the specific material.

It is clear that an active constraint will have a value of 0 while
inactive constraint will be less then 0.

3) I do not supply any gradients to the objective function nor any
non-linear constraints to the @cons. The only constraints on the system
are the 12 developed in question (2), as well as the bounds of course.

4) I would be happy with anything under 12 hours. I belive it can be
solved much faster though.

5) Considering the objective function is simply the sum of the volume
of each member of the truss i.e. R(1)^2*pi*lenght(1) ..... Where the
length is always a fixed number I would belive that the task is
continious, however, judging by the amount of local minima that fmincon
finds I imagine that it is non-smooth.


Dmitrey wrote:
> Hi strefli3,
> first of all you should specify
> 1) how many variables has your task (just dimension of R0)
> 2) are your @cons include equality constraints, inequality or both
> 3) do you supply any (sub)gradients of your objective func (@obj) and
> your non-linear constraints (@cons)
> 4) what time is allowed for program to obtain solution?
> 5) are your task smooth, non-smooth or discontinious?
>
> strefli3 wrote:
> >
> >
> > 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
> >
> >

Subject: Fmincon + Ansys, Looking for a global minimum

From: Dmitrey

Date: 1 Dec, 2006 14:35:07

Message: 6 of 14

Hi strefli3,
very well.
First of all, non-smooth doesn't means having lots of local minima, &
lots of local minima doesn't mean function is smooth (even without
taking into account any constraints).
Our department of optimization researches non-smooth optimization
since 1964 or so (as a rule, local solvers).
The fact of stopping fmincon in different points from different x0
doesn't mean anything, for example try that one with function
Lemarechal from the OpenOpt & you will see, that fmincon & even
MATLAB fminsearch fails to solve the one, despite it is convex and
has only 1 local=global minimum.
So, I recomend you 2 ways.
1st is like that:
prob = ooAssign(@objFun, x0);
prob.lb = LB;
prob.ub = UB; (BTW you can use it all in one ooAssign line)
prob.c =@cons; % note, that cons should take 2 params: x & prob.
Ignore prob inside, but describe it as input param in 1st line of
cons. The same with objFun. I intend to simplify it later, but now
it's not implemented.
of course, you can use 1-line assignment as in ooexample.m
So, run
r = ooRun(prob, @GAConstrain);
I hope this will help.
Also, try to modify stop criteria that will stop the calculations
(see r.msg for more info), for example it will be TolX -> try to
reduce this one and see, will your FvalOptim better or not.
nVars = 12 is sensible number for global solvers (however, I don't
know how many time is consumed by you objfun& cons), however I would
recommend you to try ralg (treating lb-ub constraints via LbUbWrapper
& non-lin constraints via ObjFun2(x,prob) = @(x,prob)
ObjFun(x,prob)+N*sum(max(0, cons(x,prob)))) and/or use hPSO (handling
of non-lin constraints must be the same, LbUbWrapper is called from
hPSO automatically). N must be a great number, try 10, 100, 1000,
5000 untill max(c)>TolCon (if solving will take lots of time, use
x0 = x_solution_with_previous_N). I intend to make it running
automatically in nearest future.
If you'll find it more convinient, you may contact me via email or
icq 275976670 (as for me it's hard to observ this forum often)
WBR, D.

Subject: Fmincon + Ansys, Looking for a global minimum

From: Dmitrey

Date: 1 Dec, 2006 14:38:01

Message: 7 of 14

Sorry, I meant
& lots of local minima doesn't mean function is smooth

Subject: Fmincon + Ansys, Looking for a global minimum

From: Marcus M. Edvall

Date: 5 Dec, 2006 01:03:11

Message: 8 of 14

Hello,

glcCluster is likely to be optimal for your situation. It builds a
number of clusters with glcDirect (general global solver supporting
all types of constraints).

A local solver can then be used on any number of these clusters.

Best wishes, Marcus
 <http://tomopt.com/tomlab/>

Subject: Fmincon + Ansys, Looking for a global minimum

From: Rakesh Kumar

Date: 5 Dec, 2006 10:07:47

Message: 9 of 14

 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
>


Subject: Fmincon + Ansys, Looking for a global minimum

From: strefli3@gmail.com

Date: 12 Dec, 2006 08:02:08

Message: 10 of 14

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
> >

Subject: Fmincon + Ansys, Looking for a global minimum

From: Marcus M. Edvall

Date: 12 Dec, 2006 11:32:04

Message: 11 of 14

Hello,

If you got only local solutions with TOMLAB, you must have done
something wrong. The defaults are not always ideal for your
situation.

If you can obtain local solutions in 51s, then glcCluster should be
ideal.

Best wishes, Marcus
 <http://tomopt.com/tomlab/>

 strefli3 wrote:
>
>
> 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,'Disp
> lay','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
>> >
>
>

Subject: Fmincon + Ansys, Looking for a global minimum

From: strefli3@gmail.com

Date: 12 Dec, 2006 10:56:12

Message: 12 of 14

Unfortunatly I do not have a sponsorship with TOMLAB, thus I did not
persue that possibility.

However, now that we are on the topic, how will glcCluster perform when
my function is very costly?

Marcus M. Edvall wrote:
> Hello,
>
> If you got only local solutions with TOMLAB, you must have done
> something wrong. The defaults are not always ideal for your
> situation.
>
> If you can obtain local solutions in 51s, then glcCluster should be
> ideal.
>
> Best wishes, Marcus
> <http://tomopt.com/tomlab/>
>
> strefli3 wrote:
> >
> >
> > 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,'Disp
> > lay','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
> >> >
> >
> >

Subject: Fmincon + Ansys, Looking for a global minimum

From: Marcus M. Edvall

Date: 13 Dec, 2006 01:02:23

Message: 13 of 14

Hello,

For costly problems you should use rbfSolve or EGO:
 <http://tomopt.com/tomlab/products/cgo/>

glcCluster might perform well for these cases as well. You can easily
limit the number of clusters that are used for local optimization
(with snopt, npsol or knitro).

Prob.GO.maxLocalTry = 3; for example.

You might also find LGO or OQNLP suitable.

Observe, you only need to setup the problem once, then it just a
matter of printing the results and analyze for all options. A few
parameters to tweak here and there.

You can use it for free over 3-4 weeks.

Best wishes, Marcus
 <http://tomopt.com/tomlab/>

 strefli3 wrote:
>
>
> Unfortunatly I do not have a sponsorship with TOMLAB, thus I did
> not
> persue that possibility.
>
> However, now that we are on the topic, how will glcCluster perform
> when
> my function is very costly?

Subject: Fmincon + Ansys, Looking for a global minimum

From: PB

Date: 13 Dec, 2006 18:13:50

Message: 14 of 14

On 2006-11-30 00:08 strefli3@gmail.com said the following:
> Hello,
>
> I am attempting to use fmincon to optimize the cross sectional areas of
> a 12 member 3-d truss. My design varaibles are the 12 radii and they
> are subject to a lower and upper bound as well as a stress constraint
> which happnes to be von-mises supplied my Ansys.
>
> At the moment I can get the program to converge to a solution, but it
> is a local minima, infact I can find several different local minima by
> adjusting the initial guess; It is clear that this problem is not a
> smooth one.
>
> The program makes around 60 iterations with around 1600 function
> evaluations before it convereges, updating the hessian almost every
> time, if not twice. However, depending on the start location, the
> convergance can be found in less iterations.
>
> So my question is, if I know that all my constraints should be 0 (or
> near 0) unless a variable is at it's lower bound, then shouldn't there
> be some possibility to find the optimum solution based on the present
> knowlege of the constraints?
>
> I am open to try any global optimizers. If anyone knows an optimizer
> that has the ability to take the contraints in as a seperate function,
> please share.
>

Hi!

Ansys has some built-in topological optimization routines, have you
tried them? I have found them pretty useful.

/PB

--
"Never attribute to malice that which can be adequately explained by
stupidity."

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com