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
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?

Hi Abdulrahman,

there are a few issues here:

  • according to my understanding one cannot invoke X[[n,m]] without having defined X as a matrix before;
  • after having defined e.g.: X = {{x11, x21}, {x12, x22}} then MatrixRank[X, Tolerance -> 0] == 1 and consequently the whole regiondescriptor evaluates to False;
  • without that condition the expression Min[Eigenvalues[X]] >= 0 depends on all four elements of X and therefore the same holds for regiondescriptor, which then again gives an expression which cannot be plottet as such.

So I think the whole problem needs to be reformulated.

Regards -- Henrik

POSTED BY: Henrik Schachner

In your first line there is simply a typo. Write

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

instead of

X == Transpose[{{x1, x2}}].{{x1, x2}};
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