pan class="string">ha</span> <span class="string">hb</span> <span class="string">hc</span> <span class="string">hd</span>
    <span class="comment">% objective function is the area of the bounding box</span>
    minimize( max(wa+wb,wc+wd)*(max(ha,hb)+max(hc,hd)) )
    subject <span class="string">to</span>
      <span class="comment">% constraints (now impose the non-changing constraints)</span>
      ha*wa == a; hb*wb == b; hc*wc == c; hd*wd == d;
      1/alpha(n) &lt;= ha/wa &lt;= alpha(n);
      1/alpha(