Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Let $x_1$ and $x_2$ be two real numbers and define the column vector $\mathbf{x}=[x_1,x_2]$. Let $\mathbf{A}_1$ and $\mathbf{A}_2$ be two $2\times 2$ real symmetric matrices. Then I need to plot the surfaces \begin{align} \mathbf{x}^T\mathbf{A}_1\mathbf{x}+1 &\leq 0 \\ \mathbf{x}^T\mathbf{A}_2\mathbf{x}+1 &\leq 0 \end{align}

How do I do this in Mathematica?

share|improve this question
    
Please try to write some code. –  belisarius Aug 11 at 4:13
    
@belisarius I really want to and I understand it is inappropriate to ask without trying. I come from a matlab & engineering background and doing this in matlab is a pain. Just started with mathematica 2 hrs back. –  dineshdileep Aug 11 at 5:32
    
Well, you've a kickstart below –  belisarius Aug 11 at 16:51

2 Answers 2

up vote 4 down vote accepted
SeedRandom[84];
a = # + Transpose@# &@RandomReal[{0, 1}, {2, 2}];
RegionPlot[{x, y}.a.{x, y} > 0, {x, -2, 2}, {y, -2, 2}]

Mathematica graphics

share|improve this answer
    
+1, but the condition is $x^TAx+1\le0$, not $x^TAx>0$. –  Rahul Narain Aug 11 at 6:33
2  
@RahulNarain Nobody is perfect :) –  belisarius Aug 11 at 7:07

Using V10 functionality and borrowing from Belisarius:

SeedRandom[84]
a = # + Transpose@# &@RandomReal[{0, 1}, {2, 2}];

We create an ImplicitRegion

region = ImplicitRegion[First[{x, y}.a.{{x}, {y}}] > 0, {x, y}];

And discretize it:

DiscretizeRegion[region, {{-2, 2}, {-2, 2}}]

Mathematica graphics

If you want Frame:

Show[%, PlotRange -> {{-2, 2}, {-2, 2}}, Frame -> True]

Mathematica graphics

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.