<font color='black' size='2' face='arial'>
<div> <font size="2"><font face="Arial, Helvetica, sans-serif">Dear all,<br>
<br>
</font></font>To try to limit the derive of the path, We can include a condition on
the potential value at the point which has been calculated. If V is
this value and V0 the initial value, We can, <span>arbitrarily, decide that if the relative variation </span> |(V-V0)/V0|>1e-4 then the path will end.<br>
I'm aware that all of this is tinkering, but i have good hope that a
friend very good at Postscript will think about this question in order
to help us.<font size="2"><font face="Arial, Helvetica, sans-serif"><br>
<br>
Example :<br>
<br>
%%%%%%%%%%%%%%%%%%%%%%%%<br>
\documentclass{article}<br>
\usepackage{pstricks,pst-plot}<br>
\SpecialCoor<br>
\def\FieldLines{%<br>
/r1 xP xA sub dup mul yP dup mul add sqrt def<br>
/r2 xP xA add dup mul yP dup mul add sqrt def<br>
/V q1 r1 div % potentiel<br>
q2 r2 div<br>
add def<br>
% Ex=-dV/dx<br>
/Ex q1 xP xA sub mul r1 3 exp div<br>
q2 xP xA add mul r2 3 exp div<br>
add def<br>
% Ey=-dV/dy<br>
/Ey yP<br>
q1 r1 3 exp div<br>
q2 r2 3 exp div<br>
add mul def<br>
/NormeE Ex dup mul Ey dup mul add sqrt def<br>
/dX Ex NormeE div pasX mul def<br>
/dY Ey NormeE div pasX mul def<br>
}<br>
\begin{document}<br>
\begin{center}<br>
\begin{pspicture*}(-6,-8)(6,8)<br>
% les limites INUTILES !!!<br>
\pstVerb{/xmin -5 def /xmax 5 def /ymin -5 def /ymax 5 def}%<br>
% le pas d'itération<br>
\pstVerb{/pasX 0.020 def}%<br>
\pstVerb{/q1 1 def % les charges<br>
/q2 -0.5 q1 mul def<br>
/xA -2.5 def}%<br>
% 15 degrés entre chaque ligne (24*15=360)<br>
\multido{\iA=0+24}{15}{% 15 lignes de champ<br>
\pstVerb{/xStart xA def<br>
/pasX q1 q1 abs div 0.02 mul def<br>
/xP xStart pasX \iA\space cos mul add def<br>
/yP 0 pasX \iA\space sin mul add def}%<br>
\parametricplot[plotpoints=2000,linecolor=blue]{xmin}{xmax}{%<br>
\FieldLines<br>
/xP xP dX add def<br>
/yP yP dY add def<br>
xP yP<br>
}<br>
\pstVerb{/xStart xA neg def<br>
/pasX q2 q2 abs div 0.02 mul def<br>
/xP xStart pasX \iA\space 180 add cos mul add def<br>
/yP 0 pasX \iA\space 180 add sin mul add def}%<br>
\parametricplot[plotpoints=2000,linecolor=blue]{xmin}{xmax}{%<br>
\FieldLines<br>
/xP xP dX add def<br>
/yP yP dY add def<br>
xP yP<br>
}}<br>
\pstVerb{/pasX 0.01 def}%<br>
\multido{\rX=-2+0.5}{9}{%<br>
\pstVerb{/xP \rX\space def<br>
\FieldLines<br>
/V0 V def}%<br>
\parametricplot[plotpoints=1000,linecolor=red]{0}{1}{%<br>
\FieldLines<br>
/dY Ex NormeE div pasX mul neg def<br>
/dX Ey NormeE div pasX mul def<br>
/xP xP dX add def<br>
/yP yP dY add def<br>
xP yP<br>
V V0 sub abs V0 div 1e-1 ge {/pasX 0 def} if<br>
}<br>
\parametricplot[plotpoints=1000,linecolor=red]{0}{1}{%<br>
\FieldLines<br>
% on part perpendiculairement aux lignes de champ<br>
/dY Ex NormeE div pasX mul neg def<br>
/dX Ey NormeE div pasX mul def<br>
/xP xP dX add def<br>
/yP yP dY add def<br>
xP yP neg<br>
V V0 sub abs V0 div 1e-1 ge {/pasX 0 def} if<br>
}}<br>
\multido{\iA=0+24}{15}{% 15 lignes de champ<br>
\pstVerb{/xStart xA def<br>
/pasX q1 q1 abs div 0.02 mul def<br>
/xP xStart pasX \iA\space cos mul add def<br>
/yP 0 pasX \iA\space sin mul add def<br>
0 1 100 {<br>
\FieldLines<br>
/xP xP dX add def<br>
/yP yP dY add def<br>
xP yP} for<br>
/xP1 xP def<br>
/yP1 yP def<br>
100 1 105 {<br>
\FieldLines<br>
/xP xP dX add def<br>
/yP yP dY add def<br>
xP yP} for<br>
/xP2 xP def<br>
/yP2 yP def<br>
}%<br>
\psline[arrowsize=5pt,linecolor=blue]{<-}(!xP1 yP1)(!xP2 yP2)<br>
\pstVerb{/xStart xA neg def<br>
/pasX q2 q2 abs div 0.02 mul def<br>
/xP xStart pasX \iA\space 180 add cos mul add def<br>
/yP 0 pasX \iA\space 180 add sin mul add def<br>
0 1 100 {<br>
\FieldLines<br>
/xP xP dX add def<br>
/yP yP dY add def<br>
xP yP} for<br>
/xP1 xP def<br>
/yP1 yP def<br>
100 1 105 {<br>
\FieldLines<br>
/xP xP dX add def<br>
/yP yP dY add def<br>
xP yP} for<br>
/xP2 xP def<br>
/yP2 yP def<br>
}%<br>
\psline[arrowsize=5pt,linecolor=blue]{<-}(!xP2 yP2)(!xP1 yP1)}<br>
\pscircle[fillstyle=solid](!xA 0){0.25}\pscircle[fillstyle=solid](!xA neg 0){0.25}<br>
\rput(!xA 0){-}\rput(!xA neg 0){+}<br>
\end{pspicture*}<br>
\end{center}<br>
\end{document}<br>
<br>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br>
<br>
</font></font></div>
<div> <font size="2"><font face="Arial, Helvetica, sans-serif"><br>
</font></font>Best Regards<br>
</div>
<div style="clear: both;"></div>
<div> <br>
</div>
<div> <font size="2"><font face="Arial, Helvetica, sans-serif">Manuel<br>
<br>
<br>
</font></font></div>
<div style="font-family: helvetica,arial; font-size: 10pt; color: black;">-----E-mail d'origine-----<br>
De : Herbert Voss <Herbert.Voss@FU-Berlin.DE><br>
A : Graphics with PSTricks <pstricks@tug.org><br>
Envoyé le : Mardi, 19 Janvier 2010 20:06<br>
Sujet : Re: [pstricks] Re : Elektrostatic Field and equipotentiallines<br>
<br>
<div id="AOLMsgPart_0_24174d75-7e87-471d-9d3d-72fb57d38318" style="margin: 0px; font-family: Tahoma,Verdana,Arial,Sans-Serif; font-size: 12px; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<pre style="font-size: 9pt;"><tt>Am 18.01.2010 21:32, schrieb Thomas Söll:<br>
<br>
> ist possible to draw an equipotentialline in your solution of the<br>
> fildlines through an given point?<br>
<br>
also with Manuels solution. But I do not understand<br>
why the V lines are far away from the charges?<br>
<br>
Herbert<br>
<br>
\documentclass{article}<br>
\usepackage{pstricks-add}<br>
\makeatletter<br>
\let\ScreenCoor\tx@ScreenCoor<br>
\makeatother<br>
\def\FieldLines{<br>
0 1 NoQ { /i ED xP i getX sub yP i getY sub Pyth } for<br>
NoQ 1 add array astore /Radius ED<br>
0 0<br>
0 1 NoQ { /i ED<br>
i getQ xP i getX sub mul i getR 3 exp Div add exch<br>
i getQ yP i getY sub mul i getR 3 exp Div add exch<br>
} for<br>
/Ex ED /Ey ED<br>
/NormeE Ex Ey Pyth def<br>
/dX Ex NormeE div pasX mul def<br>
/dY Ey NormeE div pasX mul def<br>
}<br>
<br>
\begin{document}<br>
<br>
\def\NoQ{4}<br>
\def\dAngle{18}<br>
\def\Qcharge{ 1 1 1 1}<br>
\def\Xcoor{ -2.5 2.5 2.5 -2.5}<br>
\def\Ycoor{ -2.5 -2.5 2.5 2.5}<br>
<br>
\pstVerb{<br>
/xmin -5 def /xmax 5 def /ymin -5 def /ymax 5 def<br>
/pasX xmax xmin sub 200 div def % 0.05<br>
/NoQ \NoQ\space 1 sub def<br>
/Qcharge [\Qcharge] def<br>
/Xcoor [\Xcoor] def<br>
/Ycoor [\Ycoor] def<br>
/getX { Xcoor exch get } def<br>
/getY { Ycoor exch get } def<br>
/getQ { Qcharge exch get } def<br>
/getR { Radius exch get } def<br>
}<br>
\begin{center}<br>
\begin{pspicture*}(-5,-5)(5,5)<br>
\multido{\iB=0+1}{\NoQ}{%<br>
\psforeach{\iA}{0,10,..,360}{%<br>
\psparametricplot[plotpoints=2000]{xmin}{xmax}[{<br>
/xStart \iB\space getX def<br>
/yStart \iB\space getY def<br>
/pasX \iB\space getQ dup abs Div 0.05 mul def<br>
/xP xStart pasX \iA\space cos mul add def<br>
/yP yStart pasX \iA\space sin mul add def<br>
}]{\FieldLines<br>
/xP xP dX add def /yP yP dY add def xP yP }%<br>
}<br>
\pscustom{<br>
\code{<br>
0 1 NoQ { /i exch def<br>
i getX i getY \ScreenCoor\space 10 i getQ abs mul 0 360 arc<br>
gsave i getQ 0 gt {1 0 0}{0 0 1}ifelse setrgbcolor fill grestore<br>
stroke<br>
} for<br>
}}<br>
}<br>
%<br>
\multido{\rX=-8.1+0.5}{32}{%<br>
\psparametricplot[plotpoints=1000,linecolor=blue]{0}{1}[{<br>
/xStart 0 getX def<br>
/yStart 0 getY def<br>
/pasX 0.017 def<br>
/xP \rX\space def<br>
/yP 0 def<br>
}]{\FieldLines<br>
/dY Ex NormeE div pasX mul neg def<br>
/dX Ey NormeE div pasX mul def<br>
/xP xP dX add def<br>
/yP yP dY add def<br>
xP yP }<br>
}<br>
\end{pspicture*}<br>
\end{center}<br>
\end{document}<br>
_______________________________________________<br>
PSTricks mailing list<br>
<a href="mailto:PSTricks@tug.org">PSTricks@tug.org</a><br>
<a href="http://tug.org/mailman/listinfo/pstricks" target="_blank">http://tug.org/mailman/listinfo/pstricks</a><br>
archive: <a href="http://www.tug.org/pipermail/pstricks/" target="_blank">http://www.tug.org/pipermail/pstricks/</a><br>
</tt></pre>
</div>
<!-- end of AOLMsgPart_0_24174d75-7e87-471d-9d3d-72fb57d38318 -->
</div>
</font>