Your code can be made to work by modifying like so.
data =
Module[{sig = -15., tau, nu, pts = {}},
While[sig < 12.,
tau = Sqrt[sig + 4];
nu = Quiet @ Check[Tan[sig - (1/sig)*E^(sig)], Null];
pts = Join[pts, {{sig, tau, nu}}];
sig++];
pts]
{{-15., 0. + 3.31662 I, 0.855993}, {-14., 0. + 3.16228 I, -7.2446},
{-13., 0. + 3. I, -0.463021}, {-12., 0. + 2.82843 I, 0.635861},
{-11., 0. + 2.64575 I, 226.028}, {-10., 0. + 2.44949 I, -0.648354},
{-9., 0. + 2.23607 I, 0.452332}, {-8., 0. + 2. I, 6.80169},
{-7., 0. + 1.73205 I, -0.871219}, {-6., 0. + 1.41421 I, 0.291454},
{-5., 0. + 1. I, 3.39734}, {-4., 0., -1.14716},
{-3., 1., 0.159521}, {-2., 1.41421, 2.6444},
{-1., 1.73205, -0.732368}, {0., 2., Null},
{1., 2.23607, 6.73109}, {2., 2.44949, 8.04072},
{3., 2.64575, -0.618051}, {4., 2.82843, -0.228622},
{5., 3., 0.48319}, {6., 3.16228, -43.6138},
{7., 3.31662, 2.14509}, {8., 3.4641, -0.19751},
{9., 3.60555, 1.1845}, {10., 3.74166, 0.187236},
{11., 3.87298, -0.298515}}
Since the sig
values are in column 1 of data
and the nu
values are in column 3, nu
can be plotted against sig
with
ListPlot[data[[All, {1, 3}]]]
However, I would point out that you can build data
much more easily with Table
, Mathematica's basic tool for making lists.
data =
Table[
{sig, Sqrt[sig + 4], Quiet @ Check[Tan[sig - (1/sig)*E^(sig)], Null]},
{sig, -15., 11., 1.}]
sig=0
and you have1/sig
in there? Did you not hear a beep when you run theWhile
loop? may be the sound was off on your computer, but my PC beeped loud and then noticed you are dividing by zero. You are starting from-15
and end at12
so it will pass through0
$\endgroup$sig
to -15.01. $\endgroup$Plot[Tan[sig - (1/sig)*E^(sig)], {sig, -15, 12}]
$\endgroup$Plot
because I'm just searching for test points to use and then to useListPlot
in order to show each individual thing, not its own connection. $\endgroup$For
is of incorrect syntax. It needs at least 3 parameters; ideally 4. You only have 2 parameters. YourListPlot
is also of incorrect syntax. Check the documentation. $\endgroup$