[pstricks] drawing implicit (polar) plot

Manfred Braun m.braun at uni-duisburg.de
Thu Oct 7 10:15:54 CEST 2004


Arnaud Schmittbuhl wrote:
> I don't know how to draw an implicit polar plot. I am interested in
> plotting this one, useful in fluid mechanics,
>
> (r^2 -1/r)sin^2\theta = 1

It would really be a good idea to develop a tool for plotting implicit
functions, in general.

Arnaud's special problem can be solved in a different manner without
recourse to implicit functions.  The potential flow around a cylinder has
the complex potential
  f(z) = u_\infty (z + a^2/z),
where $u_\infty$ denotes the velocity at infinity and $a$ is the radius of
the cylinder.

The real and imaginary parts of $f$ are the velocity potential $\varphi$ and
the stream function $\psi$, respectively.  The streamlines are obtained by
keeping $\psi$ fixed and varying $\varphi$.  They can be generated in the
following way:
1. Solve the equation above for z = x + iy (simple quadratic equation).
2. Keep $\psi = \Im f$ at a fixed value and use $\varphi = Re f$ as the
parameter t in \parametricplot.  To this end the basic arithmetic operations
for complex numbers, including the square root, have to be implemented.

The attached file generates a figure of the streamlines and equipotential
lines around a cylinder.  I have used my "personal" complex arithmetic
PostScript command.  (It would be more elegant to include them in a special
style for complex calculations.)  Is this, what you need?

Manfred
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cyl.tex
Type: application/octet-stream
Size: 2395 bytes
Desc: not available
Url : http://tug.org/pipermail/pstricks/attachments/20041007/a210c0ab/attachment.obj 


More information about the PSTricks mailing list