Mathematica’s ToNumberField function doesn’t always work.

September 24, 2009

I’m seeing a problem with ToNumberField sometimes claiming that a
number isn’t in a number field, when it actually is.

In particular, try

d=Root[-5+17 #1^2-8 #1^4+#1^6&,6];
z=Sqrt[2-d^2];
f=Root[-5+413 #1-2156 #1^2+#1^3&,2,0];

now ToNumberField[f, z] fails, but ToNumberField[d^2 f,z]/ToNumberField[d^2,z] (which gives the same answer) succeeds.

tikz and gnuplot on OS X

September 24, 2009

TikZ is a great LaTeX package for graphics. Its plot directive gives an easy way to plot functions, but this relies on gnuplot being available. On OS X this is a little tricky. Assuming you use MacPorts, try this:

sudo port install gnuplot
sudo ln -s `which gnuplot` /usr/local/bin/gnuplot

Now here’s a minimal example, with a function, axes, and tick marks.

\documentclass{amsart}

\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
% the plot
\draw[smooth,domain=0:6.5] plot function{sin(2*x)*exp(-x/4)};

% axes
 \draw[->] (-0.2,0) -- (7,0) node[right] {$x$};
 \draw[->] (0,-1.2) -- (0,1.2) node[above] {$f(x)$};

% tick marks
  \foreach \x/\xtext in {1/1, 2/2, 3/3, 4/4, 5/5, 6/6}
   \draw[shift={(\x,0)}] (0pt,2pt) -- (0pt,-2pt) node[below] {$\xtext$};

 \foreach \y/\ytext in {-1/-1, 1/1}
   \draw[shift={(0,\y)}] (2pt,0pt) -- (-2pt,0pt) node[left] {$\ytext$};
\end{tikzpicture}

\end{document}

Installing wine on Snow Leopard

September 24, 2009

Unfortunately wine isn’t quite ready for the 64 bit world of Snow Leopard, and the default port of wine in MacPorts won’t install at all (it says: please wait for Wine 1.2). Worse, installing wine-devel (the bleeding-edge alternative) crashes with obscure error messages.

Here’s the trick:

sudo port install wine-devel
sudo port upgrade --enforce-variants \
    expat fontconfig freetype jpeg libiconv \
    libxml2 libxslt ncurses openssl zlib \
    mesa +universal
sudo port install wine-devel

(Of course, this assumes you’ve reinstalled MacPorts. It’s just not a good idea to try to upgrade your installation from before Snow Leopard. Read this.)

This space left intentionally blank

March 26, 2009

Please go to http://tqft.net/ for my homepage.