I am not a mathematician but I would appeciate some assistance in how to model the following geometrical problem.
We have a rectangle with rounded corners that must fit within a circle (Not necessarily tangent edges of circle).
W Width of rectangle H Height of rectangle R Radius of rectangles corner D Diameter of circle
Approximate domains: W [10..100] Continuous or discrete range H [10..100] Continuous or discrete range R [1..100] Continuous or discrete range (Deliberately too large) D [10,12,14,16,20,30] Discrete set
Constraints C1 R < 0.5 W C2 R < 0.5 H (C3 (W-2R)^2 + (H-2R)^2 <= (D-2R)^2)
Replacing C3 by substitution with the following Constraints C4 A=W-2R C5 B=H-2R C6 C=D-2R C7 A^2 + B^2 <= C^2
We want to maximize/minimize each variable (typically W, H, R) for each diameter D
If we have understood it correctly, this is a QCLP - a linear objective function (single variable) with a mix of linear/quadratic equality/inequality constraints.
Note: This is just an example and we do know how to solve it manually of course - however we are trying to understand how such a model can be setup and solved in Alglib.
|