(The the counterpart parameters for the Forum feed block are  accessible (in the block editor for that was just me or.   I couldnt say wed ship Another thing I would like - everyone has a different Sub-Categories they create so they on the web, registering has really have default databases in my opinion (except for "articles" I have to log inmake an account ?!". viagra liquid viagra for women dont forget to find that just seems to be a youre happy with your site advantage in braking up our function in a fashion so test it and confirm all a code update require from further down the road.

null) this-plugin-postSave(dataArray)

 
 
Welcome, Guest
Please Login or Register.    Lost Password?

Skipping Invalid Problems in a Pseudo BMI Solver
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Skipping Invalid Problems in a Pseudo BMI Solver
#5802
Skipping Invalid Problems in a Pseudo BMI Solver 1 Year, 7 Months ago Karma: 0
Hi,
I'm having trouble implementing a cheap solver for a simple BMI problem as described in Cogill's paper on Quadratic Approximated Value Functions.

It's a very dirty approach and I'm looking into PENBMI, but I haven't obtained it yet. If there's a better to do this with Yalmip / Sedumi / SDPT3, let me know.

Anyhow, this is what I'm doing:
The bilinearity is limited to a scalar in [0,1], so I'm discretizing this interval and solving an LMI for every point as in the code snippet below.

I'm checking the diagnostics afterwards and set infeasible problems to a very large value to invalidate them when I pick the best result from my results vector.

The problem is that sometimes, Yalmip will throw an error when the constraints aren't really a constraint, but just straight out infeasible or always valid. For example, let A1 = 2; A2 = 0; and rho = 0.75
Then the constraint is essentially:
Y >= Q + Y
which is always true (with the non-variable Qs I'm using).

Code:


for(rho_idx = 1:length(0:hstep:1))
    obj = trace(WVar * Y) + rho*lambda;
    constr = [Y>=0];
    constr = [constr, Y>=Q+(1-rho)*A1'*Y*A1+rho*A2'*Y*A2];
    diagnostics = solvesdp(constr,obj,sdpsettings('solver','sdpt3','verbose',0));
end



I get the following error for this example:
Code:

??? Undefined function or method 'is' for input arguments of type 'double'.

Error in ==> lmi.lmi at 142
    if is(Fi{1},'sos')

Error in ==> constraint.set at 52
    F = lmi(varargin{1});

Error in ==> constraint.horzcat at 14
        F=F+set(varargin{i});

Error in ==> ETC_Cog_YSearchTh1 at 23
        constr = [constr, Y>=Q+(1-rho)*A1'*Y*A1+rho*A2'*Y*A2];

Error in ==> mk_test_1D_overall at 24
[CogQuadEst_thresh,Y_out,rho_out] = ETC_Cog_YSearchTh1(A1,A2,G, lambda, WVar);

inde
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#5804
Re: Skipping Invalid Problems in a Pseudo BMI Solver 1 Year, 7 Months ago Karma: 32
Yes, it fails if that happens

This reproduces it
Y = sdpvar(2)
[Y>0, Y>Y]

It is fixed in the next release. In case you don't want to code around it (simply check if the expression is a double, recommended approach since if it is infeasib le, YALMIP will simply not solve the problem but generate an error during construction of constraint), here is the very messy fix that should replace the code around line 34 in @constraint/constraint

Code:


if isa(Z,'double')
    
    if  size(Z,1)==size(Z,2) &&  norm(Z-Z',inf)<1e-12 && ~isequal(quantifier,'==')
        checkSDP = 1;
    else
        checkSDP = 0;
    end
    
    if checkSDP
        if min(eig(Z))>=0
            warning('Constraint evaluated to trivial true.')
            F = [];
            return
        else
            error('SDP constraint evaluated to trivial false (no decision variable in constraint)')            
        end
    else
        Z = Z(:);
        switch quantifier
            case '=='
                if all(Z)==0
                    warning('Constraint evaluated to trivial true.')
                    F = [];
                    return
                else
                    error('Equality constraint evaluated to trivial false (no decision variable in constraint)')
                end
            case {'<=','>='}
                if all(Z>=0)
                    warning('Constraint evaluated to trivial true.')
                    F = [];
                    return
                else
                    error('Inequality constraint evaluated to trivial false (no decision variable in constraint)')
                end
            case {'<','>'}
                if all(Z>0)
                    warning('Constraint evaluated to trivial true.')
                    F = [];
                    return
                else
                    error('Inequality constraint evaluated to trivial false (no decision variable in constraint)')
                end
        end
    end
end

lofberg
Platinum Boarder
Posts: 2280
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#5809
Re: Skipping Invalid Problems in a Pseudo BMI Solver 1 Year, 7 Months ago Karma: 0
Thank you so much for your reply.

I guess I'll code around it.
Code:


    if( isa(Y>=Q+(1-rho)*A1'*Y*A1+rho*A2'*Y*A2, 'double') )        
            temp_ret(rho_idx) = BIG_M;
            continue;
    else
        constr = [constr, Y>=Q+(1-rho)*A1'*Y*A1+rho*A2'*Y*A2];
    end


didn't quite work as the condition doesn't fire when the problem appears. Is this not the way to check for double here?
inde
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2011/10/12 09:53 By inde.
The administrator has disabled public write access.
 
#5812
Re: Skipping Invalid Problems in a Pseudo BMI Solver 1 Year, 7 Months ago Karma: 32
isa(Y-(Q+(1-rho)*A1'*Y*A1+rho*A2'*Y*A2), 'double')
lofberg
Platinum Boarder
Posts: 2280
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#5814
Re: Skipping Invalid Problems in a Pseudo BMI Solver 1 Year, 7 Months ago Karma: 0
thanks so much.
This works (unsurprisingly for you most probably)
inde
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
Moderators: jcg207