Re: fmincon



Thanks,firsl of all.
I'll check this option,but i don't absolutely understand one nuance: The constaints in fmincon are continuous functions,linear and not linear but continuous.
Here when you subsititute into constraint the results of function that calculated using pure logic if\else,you jump from zero result to other result not in continuous manner i think. Isn't it a problem theoretically?
I probably missunderstand something,could you clarify it please?

Thanks a lot,
Alex


"Bruno Luong" <b.luong@xxxxxxxxxxxxxxxxxxxx> wrote in message <gdahni$fcn$1@xxxxxxxxxxxxxxxxxx>...
"Alexander Blumin" <bluminalex@xxxxxxxxx> wrote in message <gdafam$kfu$1@xxxxxxxxxxxxxxxxxx>...
Thanks for response.

The rectangles are alligned to axes (i.e not rotated) so the code of calculating the intersection is o'k i guess.
Excuse me for maybe stupid question: -A as sign to empty intersection is given to implement say constraint c(x)< 0 ?

Thanks,
Alex

I don't quite get what is the problem to compute the surface of the intersection of two rectangles. It takes me 2 minutes to program one like this:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function S = comsurf(R1, R2)
% Return the intersection surface of rectangles R1 and R2
%
% R of the form = [xa ya xb yb], with (xa,ya) and (xb,yb) are two
% opposite corners

S = comseg(R1([1 3]),R2([1 3]))*comseg(R1([2 4]),R2([2 4]));

end

function l = comseg(I1, I2)

I1 = sort(I1(:));
I2 = sort(I2(:));
if I1(2)<I2(1) || I2(2)<I1(1)
l = 0;
else
Is = sort([I1; I2]);
l = Is(3)-Is(2);
end

end

%%%%%%%%%%%%%%%%%%

Then just plug into fmincon with the constraint

c12 := comsurf(R1, R2) <= 0;
c13 := comsurf(R1, R3) <= 0;
c23 := comsurf(R2, R3) <= 0;
% ...
% Do it for all couple of mutual rectangles

These are set continue constraints. You can transform it into a equivalent linear constraints (just seat down and go through all the case with "sort"), however the equivalent number of linear equations should be much larger.

Bruno
.



Relevant Pages

  • Re: fmincon
    ... The rectangles are alligned to axes so the code of calculating the intersection is o'k i guess. ... Excuse me for maybe stupid question: -A as sign to empty intersection is given to implement say constraint c< 0? ... You can transform it into a equivalent linear constraints, however the equivalent number of linear equations should be much larger. ...
    (comp.soft-sys.matlab)
  • Re: A question regarding optimization theory
    ... 1)all the x1 ....x6 must be positive and non zero ... i know that it is going to be solved by non linear programming ..i ... doing right i need a type of algorithm in which the constraint ... no optimizer will allow you to apply a strict ...
    (comp.soft-sys.matlab)
  • Regression with Intersection Constraint
    ... Assuming that prior to the regression process you know exact ... Essentially, you "weight" the constraint ... intersection point as determined by the data points. ... load pointsA.txt ...
    (comp.soft-sys.matlab)
  • Re: Linear equation system with additional conditions
    ... I have a linear equation system Ax = b and solve it ... applying an equality constraint. ... satisfy the equality constraint system exactly. ...
    (comp.soft-sys.matlab)
  • Re: Why is OO Popular?
    ... >>It is arbitrary because it has no connection to rectangles. ... But the constraint itself is arbitrary to rectangle. ... >>troubles with substitutability. ... The whole idea of subtyping is to reuse everything ...
    (comp.object)

Loading