2

A have the set consisting of the complex numbers $1+3r \cosθ−ir \sinθ$, where $r∈[0,1]$ and $θ$ may vary between $0$ and $2π$.

This is my first encounter with Mathematica, and am having difficulty discerning between the methods I have found online which would best suite my purpose (actually, I am not sure any of ones I have found would work). So, what would be the best way? Should I generate a list of all those complex numbers of the form mentioned above, and then plot the list? If so, would someone mind directing me to an online resource on how exactly to do this? Or is there some better method?

Also, I would like to plot the eigenvalues of the matrix $\begin{bmatrix} 1 & 2 \\ 1 & 1 \\ \end{bmatrix}$ So, how would I plot these simultaneously?

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
Mack
  • 123
  • 5
  • 1
    Table, Array, ListPlot, Re and Im. Look them up in the documentation -- should be good on your own after that. – Sektor Jun 28 '15 at 15:04

2 Answers2

4

Your plot will trace a series of concentric ellipses, with a point when $r=0$. The eigenvalues have imaginary part zero, and are symmetric about the point $(1,0)$.

Start by building a table of output values, here we span $0\leq r \leq 1$ in tenths, and $0 \leq t \leq 2 \pi$ in tenths as well (I am replacing your $\theta$ with $t$ for character simplicity). We can call this table fvals:

fvals = Flatten[
Table[{Re[1 + 3 r Cos[t] - I r Sin[t]], 
 Im[1 + 3 r Cos[t] - I r Sin[t]]}, {t, 0, 2 Pi, .1},
 {r, 0, 1, .1}], 1];

Next, we compute eigenvalues, and break them into their real and imaginary parts as ordered pairs.

m = {{1, 2}, {1, 1}};
eigenpoints = 
 Table[{Re[Eigenvalues[m]][[i]], Im[Eigenvalues[m]][[i]]},
 {i, 1, Length[Eigenvalues[m]]}];

Finally, we plot the function values in blue, and the eigenvalues in red with a bit larger point size.

ListPlot[{fvals, eigenpoints}, 
PlotStyle -> {{Blue, PointSize[.01]}, {Red, PointSize[.03]}}, 
Frame -> True, FrameLabel -> {Re, Im}]

Here is the result:

enter image description here

These elliptic arcs are actually a bit more elongated, you can see that by adding

AspectRatio->Automatic

to the plot.

J. W. Perry
  • 1,080
  • 1
  • 6
  • 11
3

Your question is both basic and broad which means it will probably end up closed unless you can edit it to be more specific. Nevertheless as you are new here is a start:

expr := 1 + 3*r*Cos[θ] - I*r*Sin[θ];

Table[
   DensityPlot[fn @ expr, {r, 0, 1}, {θ, 0, 2 Pi}],
   {fn, {Re, Im, Abs, Arg}}
] ~Partition~ 2 // GraphicsGrid

enter image description here

Note that capitalization is important. Use I not i for example.

Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371
  • I thank you for your response, but I was actually looking to get a plot of the points, rather than the plot of a function that maps the complex plane to another copy of the complex plane. – Mack Jun 28 '15 at 15:41
  • @Mack You should include an example of the kind of output you wish to achieve. If the system will not let you link or embed an image let me know. – Mr.Wizard Jun 28 '15 at 15:43
  • I would like to make a plot similar to the one given in Nasser's answer: http://mathematica.stackexchange.com/questions/16252/plotting-complex-numbers – Mack Jun 28 '15 at 15:45
  • @Mack What problem did you run into attempting to apply his code to your application? – Mr.Wizard Jun 28 '15 at 15:46
  • The problem was, that I didn't exactly know how to apply it to my situation. My plot should be the plot of a convex object in the complex plane. – Mack Jun 28 '15 at 15:48
  • @Mack You need to be more specific. You should edit your question to link to that answer, describe what you are attempting to achieve, and why you are having trouble applying it. – Mr.Wizard Jun 28 '15 at 15:50
  • @Mack, look up ParametricPlot[]. You should be able to use it along with Re[] and Im[]. – J. M.'s missing motivation Jun 28 '15 at 15:51
  • @Mr.Wizard I don't see how I am not being specific enough: I have a set of complex numbers of the form 1+3rcosθ−irsinθ, and I would like to plot each individual point, which should form some convex set in the complex plane. At Guess who it is: I tried ParametricPlot[1 + 2rCos[x] - IrSin[x], {r, 0, 1}, {x, 0, 2*Pi}], but it gave me a blank plot. – Mack Jun 28 '15 at 15:59
  • 1
    @Mack, try ListPlot@ReIm@list where list is your list of complex numbers. – Simon Woods Jun 28 '15 at 16:01
  • ReIm is a new function; if you are not using the latest release you may not have it. – Mr.Wizard Jun 28 '15 at 16:02
  • I have version 10.0. Is this the latest? – Mack Jun 28 '15 at 16:04
  • @Mack No, 10.1.0 is. try using myReIm = Thread@{Re@#, Im@#} & instead. – Mr.Wizard Jun 28 '15 at 16:13
  • @Mack: ParametricPlot[Through[{Re, Im}[1 + 2*r Cos[x] - I r*Sin[x]]], {r, 0, 1}, {x, 0, 2*Pi}]. – J. M.'s missing motivation Jun 28 '15 at 16:17