Group Abstract Group Abstract

Message Boards Message Boards

0
|
2.9K Views
|
6 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Indirect constraint on a variable in RegionPlot?

Posted 10 years ago

I am trying to first define a matrix variable X symbolically as follows: $X=x*x^T$, where X is a matrix and x is a vector in $R^2$ and defined as $x=[x_1\ \ x_2]^T$. Then, I want to impose constraints on X but use RegionPlot to plot $x_1$ and $x_2$. Below is a code that I am using now but whenever I run it, I don't get any plot. What am I doing wrong and could anyone help me with this? Please note that I am trying to plot the feasible region of the SDP relaxation of a QCQP.

    X == Transpose[{{x1, x2}}].{{x1, x2}};

    regiondescriptor = Tr[{{0.09, 0}, {0, 7}}.X] >= 1 && Tr[{{7, 0}, {0, 0.09}}.X] >= 1 && Tr[{{1.05, -0.95}, {-0.95, 1.05}}.X] >= 1 && Tr[{{1.05, 0.95}, {0.95, 1.05}}.X] >= 1  ;

    RegionPlot[regiondescriptor, {x1, -10, 10}, {x2, -10, 10}, BoundaryStyle -> Black]
6 Replies
POSTED BY: Henrik Schachner

Thanks a lot for your follow up on this. I tried it and it is working perfectly and now it makes sense why when the Rank is added, there is nothing to be plot since the intersection between the rank and the the other constraints is empty set.

I was also working on other solution that could enable me to project a 4D region onto a 3D region and so enable me to change all 4 variables. This is the code:

    X = {{x, y}, {z, w}};
    \[ScriptCapitalR] = ImplicitRegion[
    Tr[{{0.09, 0}, {0, 7}}.X] >= 1 && Tr[{{7, 0}, {0, 0.09}}.X] >= 1 && 
    Tr[{{1.05, -0.95}, {-0.95, 1.05}}.X] >= 1 && 
    Tr[{{1.05, 0.95}, {0.95, 1.05}}.X] >= 1  &&  
    Min[Eigenvalues[X]] >= 0  , {x, y, z, w}];

    RegionPlot3D[Resolve[\!\(\*SubscriptBox[\(\[Exists]\), \(x\)]\({x, y, z, w} \[Element] \[ScriptCapitalR]\)\), Reals], {y, -10, 10}, {z, -10, 10}, {w, -10, 10}];

The code is working but I was trying to combine your method with this so I could also plot the region for the Rank constraint also but it is not working. This is the code which I am trying to combine your method with Resolve but it is not working:

    ClearAll["Global`*"]

    regiondescriptor[x11_, x12_, x21_, x22_] := 
    Tr[{{0.09`, 0}, {0, 7}}.{{x11, x12}, {x21, x22}}] >= 1 && 
    Tr[{{7, 0}, {0, 0.09`}}.{{x11, x12}, {x21, x22}}] >= 1 && 
    Tr[{{1.05`, -0.95`}, {-0.95`, 1.05`}}.{{x11, x12}, {x21, x22}}] >= 1 &&
    Tr[{{1.05`, 0.95`}, {0.95`, 1.05`}}.{{x11, x12}, {x21, x22}}] >= 1 && Min[Eigenvalues[{{x11, x12}, {x21, x22}}]] >= 0;

    RegionPlot3D[Resolve[\!\(\*SubscriptBox[\(\[Exists]\), \(x12\)]\({x11, x12, x21, x22} \[Element] regiondescriptor[x11, x12, x21,x22]\)\), Reals], {x11, -10, 10}, {x21, -10, 10}, {x22, -10, 10}]

Any idea if this possible? I am sorry for asking a lot but I really want to plot this.

Hi Abdulrahman,

first thing I am noticing: You cannot ask whether {x11, x12, x21, x22} is an element of regiondescriptor, because this is not a region but a function which gives True or False. I think you rather mean "Is there an x12 for which regiondescriptor evaluates to True":

RegionPlot3D[Resolve[Exists[x12, regiondescriptor[x11, x12, x21, x22]], Reals], {x11, -10, 10}, {x21, -10, 10}, {x22, -10, 10}]

The syntax now seems to be correct, but the plot will not show anything. Whenever this happens it is a good idea to take an explicit look at the values. For doing so one simply replaces RegionPlot3D with Table:

enter image description here

Here we see: Some points evaluate to True, some to False, and some cannot be decided - I guess because of the roots which can be imaginary. So - again - I am afraid the problem needs to be reformulated ...

Regards -- Henrik

POSTED BY: Henrik Schachner

Thanks Henrik. I realized that there is something wrong with the formulation and the correct way is the following code:

    regiondescriptor = Tr[{{0.09, 0}, {0, 7}}.X] >= 1 && Tr[{{7, 0}, {0, 0.09}}.X] >= 1 && Tr[{{1.05, -0.95}, {-0.95, 1.05}}.X] >= 1 && Tr[{{1.05, 0.95}, {0.95, 1.05}}.X] >= 1   && MatrixRank[X, Tolerance -> 0] == 1 && Min[Eigenvalues[X]] >= 0  ;

    RegionPlot[regiondescriptor, {X[[1, 1]], -4, 4}, {X[[2, 2]], -4, 4}, BoundaryStyle -> Black]

I removed the vectors completely and I am just considering now the matrix variable X. I want to plot the entries X(1,1) and X(2,2) but I am getting the following error:

     RegionPlot::write: "Tag Part in X[[1,1]] is Protected."

Do you know why is this happening? Can't I change the values of the entries of the matrices and plot them?

POSTED BY: Henrik Schachner
POSTED BY: Henrik Schachner
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard