2
$\begingroup$

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?

$\endgroup$
1
  • 1
    $\begingroup$ Table, Array, ListPlot, Re and Im. Look them up in the documentation -- should be good on your own after that. $\endgroup$
    – Sektor
    Jun 28, 2015 at 15:04

2 Answers 2

4
$\begingroup$

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.

$\endgroup$
3
$\begingroup$

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.

$\endgroup$
13
  • $\begingroup$ 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. $\endgroup$
    – Mack
    Jun 28, 2015 at 15:41
  • $\begingroup$ @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. $\endgroup$
    – Mr.Wizard
    Jun 28, 2015 at 15:43
  • $\begingroup$ I would like to make a plot similar to the one given in Nasser's answer: mathematica.stackexchange.com/questions/16252/… $\endgroup$
    – Mack
    Jun 28, 2015 at 15:45
  • $\begingroup$ @Mack What problem did you run into attempting to apply his code to your application? $\endgroup$
    – Mr.Wizard
    Jun 28, 2015 at 15:46
  • 1
    $\begingroup$ @Mack, try ListPlot@ReIm@list where list is your list of complex numbers. $\endgroup$ Jun 28, 2015 at 16:01

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