fmincon satisfying constraints

9 views (last 30 days)
Ben
Ben on 23 Mar 2012
Hello, So i have a problem where i am trying to optimize a channel (looks kind of like a sin wave) that runs through a plate. The design parameters are x and y locations of various points along the channel edge.
Running fmincon, i have a set of nonlinear constraints that define the x and y locations so that the two edges of the channel cannot overlap or cause the channel to get too thin. If they overlap, the model cannot be generated and the whole thing fails.
I am trying to set it up, so that my bounds allow for a variety of shapes for the channel to be in, while my constraints ensure that the channel does not cross itself or get too thin. However when running fmincon, during intermediate steps it will allow the design variables to go outside the constraints (while staying in the bounds).
Is there a way that i can get it to satisfy the bounds and the constraints during intermediate steps?
Thanks,

Answers (2)

Sean de Wolski
Sean de Wolski on 23 Mar 2012
You say that there are intermediate steps that violate the bounds. But does the solution lie with in them? If so, I would hazard a guess that this is expected behavior.
  1 Comment
Ben
Ben on 23 Mar 2012
The solution cannot finish, because as it changes the design variables during the steps between optimization iterations, one of the variables goes outside of the constraints (but stays within the bounds) and thus crashes.
I need it to stay within the constraints and bounds at all times, is there a way to do this?

Sign in to comment.


Matt Kindig
Matt Kindig on 23 Mar 2012
I've had this problem before with fmincon. Unfortunately, I could not figure out a way to force MATLAB to ensure that the intermediate iterations satisfy the constraints. I ended up calling the constraint function within my objective function, and testing whether the constraints were satisfied (to within some acceptable tolerance). If the constraints failed, I had the objective function return some really large value (to prevent fmincon from converging to this solution).

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!