Question-and-Answer Resource for the Building Energy Modeling Community
Get s tarted with the Help page
Ask Your Question
1

More complex constraints in genOp

asked 2016-04-05 09:36:49 -0500

updated 2016-04-07 06:51:42 -0500

Dear everyone,

I am using genOpt to perform an optimization of a shading device. This device has been parametrized, and 5 parameters have been found.

Even though all these parameters are independent of each other (they are a base), one of them is constrained to be half of another. Otherwise, the geometry does not make sense.

Accordingly, what I need to achieve is something like:

Parameter{ 
    Name    = spacing;
    Min     = 0.01;
    Ini     =  0.25;
    Max     =  2 * radius;
    Step    =  0.1;
}

Parameter{
    Name    =  radius;
    Min     =  -3;
    Ini     =  0;
    Max     =  3;
    Step    =  0.5;
}

I have not been able to get a clear understanding of constraints by reading the genOpt manual, so I have not been able to implement this.

I think I can create some auxiliary variables for solving this, but the results will be somehow complex and "unnatural", since this new variables will not really mean much in the visual part of the geometry... thus, I want to avoid this.

Thanks in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-04-06 19:37:38 -0500

You could use function objects to implement

Parameter{ 
Name    = normalizedSpacing;
Min     = 0;
Ini     =  0.5;
Max     =  1;
Step    =  0.1;
}
Parameter{
Name    =  radius;
Min     =  -3;
Ini     =  0;
Max     =  3;
Step    =  0.5;
}
Function{
  Name = spacing;
  Function = add(0.01, multiply( %normalizedSpacing%, subtract(multiply(2, %radius%), 0.01)));
}
edit flag offensive delete link more

Comments

Very cool, that was exactly what I was looking for! thanks very much.

gmolina gravatar image gmolina  ( 2016-04-07 11:33:02 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

 

Question Tools

1 follower

Stats

Asked: 2016-04-05 09:36:49 -0500

Seen: 182 times

Last updated: Apr 06 '16