This may not be the most elegant solution, but you can take equality constraints into account by adding a penalty to your cost function if they are not met (e.g. cost = “real cost” + 1e6*(1000-x*y*z)^2). In this particular case, I would suggest a simpler way which is to let x and y be the parameters that vary (independent variables) and define z as a derived (dependent) variable with z = 1000/(x*y). I hope this helps. Michaël Kummert, Polytechnique Montréal From: trnsys-users-bounces@cae.wisc.edu [mailto:trnsys-users-bounces@cae.wisc.edu] On Behalf Of Safizadeh Mohammadreza Dear Trnsys users, For running my optimization (GenOpt + Trnsys), I need to define two types of following constraints for independent variables to be optimized: Variables to be optimized are: x, y and z Constraints: 1- Boundary constraints: 0<x<20, 0<y<20, 0<z<20 2- Equality constraints: x*y*z=1000 To this end, I could make the boundary constraints in command file but I could not find a solution to define equality constraints. I would appreciate if you could let me know how I can define equality constraints within GenOpt or Trnsys. Best regards, Reza Safi _____________________________________________ Division Thermal Systems and Buildings Fraunhofer-Institut für Solare Energiesysteme ISE |