<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<title>[pstricks] drawing implicit (polar) plot</title>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.E-MailFormatvorlage18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
        {page:Section1;}
/* List Definitions */
@list l0
        {mso-list-id:2069647234;
        mso-list-type:hybrid;
        mso-list-template-ids:1093592554 655897994 67567619 67567621 67567617 67567619 67567621 67567617 67567619 67567621;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:\F0D8;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;
        mso-fareast-font-family:"Times New Roman";
        mso-bidi-font-family:Arial;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</style>
</head>
<body lang=DE link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Wim Neimeijer wrote:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p style='margin:0cm;margin-bottom:.0001pt'><font size=2 color=navy face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial;color:navy'>> </span></font><font
size=2 face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>I
have a question concerning the implicit polar plot algorithm proposed by <st1:PersonName
w:st="on">Manfred Braun</st1:PersonName></span></font><span lang=EN-GB> <br>
</span><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial;color:navy'>> </span></font><font size=2
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>and
which is used as an example of </span></font><a href="http://www.pstricks.de"><font
size=2 face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>http:/www.pstricks.de</span></font></a><font
size=2 face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>
(polar2.tex)</span></font><span lang=EN-GB> <o:p></o:p></span></p>
<p><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'>> </span></font><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>In the postscript code
where the streamlines and equipotential <font color=navy><span
style='color:navy'>lines</span></font> are plotted</span></font><span
lang=EN-GB> <br>
</span><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial;color:navy'>> </span></font><font size=2
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>via a
call to parametricplot, I am trying to figure out the mapping between the
complex function</span></font><span lang=EN-GB> <br>
</span><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial;color:navy'>> </span></font><font size=2
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>$\Psi$
and the parameter $t$, excerpt of the code attached below.</span></font><span
lang=EN-GB> <o:p></o:p></span></p>
<p><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'>> </span></font><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Question : To be more
specific, in the notes from polar2.tex it says, solve the equation $f(z) = z +
a^2/z$</span></font><span lang=EN-GB> <br>
</span><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial;color:navy'>> </span></font><font size=2
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>using $z
= x + i y$, which would give a quadratic equation ?</span></font><span
lang=EN-GB> <o:p></o:p></span></p>
<p><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'>> </span></font><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>My maths gives me : $f(z)
= \phi(x,y) + i \Psi(x,y) = $ where $Re f(z) = ( r + \frac{a^2}{r} ) \cos \phi
$</span></font><span lang=EN-GB> <br>
</span><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial;color:navy'>> </span></font><font size=2
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>and $Im
f(z) = ( r - \frac{a^2}{r} ) \sin \phi$ </span></font><span lang=EN-GB><o:p></o:p></span></p>
<p><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'>> </span></font><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Question : How does this
lead to a quadratic equation under which assumption ? </span></font><span
lang=EN-GB><br>
<br>
<o:p></o:p></span></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
lang=EN-GB style='font-size:12.0pt;color:navy'>The equation f = z + a^2/z
is converted into the quadratic equation<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'> z^2 – f z +
a^2 z = 0<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>which can be solved
for z by the standard formula. The unknown z and the coefficient
f, however, are complex numbers. Having solved the equation, just
set z = x + iy and f = phi + i psi. Thus the solution z
= … provides the points (x, y) corresponding to the pair of
potential and stream function (phi, psi). This is just inverting the original setting
f = f(z), where you obtain the complex potential f corresponding to
a given point z. <o:p></o:p></span></font></p>
<p><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'>> </span></font><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Question : How is the
quadratic equation mapped to the variable $t$ in the parametricplot ?</span></font><span
lang=EN-GB> <o:p></o:p></span></p>
<p><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'>If you fix the potential phi and let the
stream function psi run over a certain interval, you get an
equipotential line. If you fix the stream function psi and allow
the potential phi to vary, you get a streamline. Therefore
the two commands intended to draw equipotential and stream lines differ only in
what is fixed and what is the running curve parameter t. In the case
of streamlines, for instance, the curve parameter t is the
potential phi, while the stream function psi is kept at the fixed
value #1. <o:p></o:p></span></font></p>
<p><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'>> </span></font><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>I want to understand the
lines of code which I indented with HOW </span></font><span lang=EN-GB><br>
</span><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial;color:navy'>> </span></font><font size=2
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>to plot
an other function to make the code a bit more generic.<font color=navy><span
style='color:navy'><o:p></o:p></span></font></span></font></p>
<p><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'>The code starting with { t #1 … } puts
the potential phi = t and the stream function psi = #1 on
the stack. These two values are regarded as the real and imaginary parts
of one complex number f. What follows relies on the operations performed
with complex numbers. For instance, if a complex number is on the stack
and you write “ 2 copy cmul “, the complex number will be
duplicated and then multiplied with itself. As a result the complex
number z^2 is on the stack. The operations for complex addition,
multiplication, square root, etc. are provided by the command \complex,
which simply writes the definitions of these operations using \pstVerb{ …
}. <o:p></o:p></span></font></p>
<p><font size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'>I have used these complex operations only in some
personal applications. Therefore they are not documented. If there is a general
need for complex arithmetic, the operations could be included in some add-on
package. <o:p></o:p></span></font></p>
<p><font size=3 color=navy face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt;color:navy'>Hopefully these explanations help understanding
the basic idea.<o:p></o:p></span></font></p>
<p><st1:PersonName w:st="on"><font size=2 color=navy face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial;color:navy'>Manfred Braun</span></font></st1:PersonName><font
size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'><o:p></o:p></span></font></p>
</div>
</body>
</html>