Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Geometric Optimization (edge length) Problem

Please login with a confirmed email address before reporting spam

Hi all,

So I am trying to use COMSOL with Matlab to find the optimum geometric parameters for a PEM fuel cell catalyst layer. My model is very simple, consisting of two adjoining rectangles of height H and widths epsilon and (1-epsilon) respectively.

The geometry is defined as follows:

g1=rect2(epsilon,H,'base','corner','pos',{'0','0'},'rot','0');
g1=rect2((1-epsilon),H,'base','corner','pos',{epsilon,'0'},'rot','0');

The design parameters that I wish to optimize are epsilon and H. Using the fmincon function in Matlab I constrain epsilon to be between 0.1 and 0.9, and H to be greater than 0.

When I attempt to run the simulation the solver will go though one or two iterations (changing the system geometry) and then the following error arises:

Exception:
com.femlab.util.FLException: Edge length has to be greater than zero
Messages:
Edge length has to be greater than zero
Error in ==>
g1=react2(....

I have narrowed the problem down to something with the epsilon value, somehow this parameter is becoming either negative or zero.

Has anyone seen an issue like this before or have any ideas on what might be going wrong?

Thanks you,
Jeff

2 Replies Last Post 17 juil. 2015, 06:25 UTC−4
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 31 juil. 2010, 06:24 UTC−4
Hi

if you epsilon goes outside bounds you hacnge thetopology (or you ask for a rectangle with zero length edges) this is not allowed, then COMSOl looses it counts on boundary ID etc.

You should ensure for all optimisation that epsilon (or whatever variables you use) are defined within bounds that do not alter the topology or ask for non-physical solutions. There are different ways to achieve this, normally the optimisation module has boundary limits, but you can also make them with boleans, or bettr smoother functions (i.e heaviside steps) for hopefully better convergence

--
Good luck
Ivar
Hi if you epsilon goes outside bounds you hacnge thetopology (or you ask for a rectangle with zero length edges) this is not allowed, then COMSOl looses it counts on boundary ID etc. You should ensure for all optimisation that epsilon (or whatever variables you use) are defined within bounds that do not alter the topology or ask for non-physical solutions. There are different ways to achieve this, normally the optimisation module has boundary limits, but you can also make them with boleans, or bettr smoother functions (i.e heaviside steps) for hopefully better convergence -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 17 juil. 2015, 06:25 UTC−4
Hi,

I'm new to both COMSOL and MATLAB and I'm developing a master thesis with a similar model that couples to matlab running a genetic algorithm for the geometry optimization, being the objective funtion the maximization of the fill factor of the fuel cell polarization curve ( f(x) = min(-FF)).
Did you acomplished the geometry optimization with Matlab? And if yes, could you help me with the first steps? I already defined the model and I need to know how to interface it with matlab and produce the desired optimization.

Kind Reagards,

Diogo Soares
Hi, I'm new to both COMSOL and MATLAB and I'm developing a master thesis with a similar model that couples to matlab running a genetic algorithm for the geometry optimization, being the objective funtion the maximization of the fill factor of the fuel cell polarization curve ( f(x) = min(-FF)). Did you acomplished the geometry optimization with Matlab? And if yes, could you help me with the first steps? I already defined the model and I need to know how to interface it with matlab and produce the desired optimization. Kind Reagards, Diogo Soares

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.