Plotting SDP formulation -- Incorrect plot

4 views (last 30 days)
Richard Nai
Richard Nai on 24 Sep 2021
Edited: Richard Nai on 24 Sep 2021
I'm using the MPT library to compute the intersection of 2 polyhedrons (red and blue) in R^5. The polyhedrons are defined by Ax <= b, where A is a matrix and b is a vector. In the plot below, I am plotting the 2d cross section where the first 3 dimensions are fixed to 0. The green polyhedron is calculated to be the intersection of the red and blue polyhedrons. In the plot, it is the cross section where the first 3 dimesions are fixed to 0.
Thus, we can see that the green polyhedron is too small, it should cover the entire intersection of the red and blue. However, if I check points that should be included in green polyhedron such as x= (-0.5, 10), I see that the geen polyhedron does include them (Agreen * x <= bgreen).
Thus, there must be something wrong with the sdp plot function.I see that the plot takes an sdp options argument, I was wondering if perhaps there was a setting I could change to get the plotting to probe more points and correctly plot the green polyhedron?
I have attached the 2d cross section A matrix (intPoly2A.mat) and b vector (intPoly2b.mat) for the green polyhedron, and I plot them like so:
s2 = sdpvar(2, 1)
plot(intPoly2A * s2 <= intPoly2b, s2, 'g')
You can see that it is a simple rectangle, but a point outside the rectangle also satisfies the equation like so:
>> x = [-0.5; 10]
x =
-0.5
10
>> intPoly2A * x <= intPoly2b
ans =
42×1 logical array
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Thanks!

Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!