# [pstricks] Elektrostatic Field

Patrice Mégret Patrice.Megret at umons.ac.be
Mon Jan 18 11:28:02 CET 2010

Thomas,

A quite simple way to solve your problem is to use \psplotImp from pst-func which plot implicit functions f(x,y)=0

For the iso-potential , the law is

Q1/(sqrt(x^2+(y-a)^2) + Q2/(sqrt(x^2+(y+a)^2) =cte

and for the electric field
Q1(y-a)/(sqrt(x^2+(y-a)^2) + Q2 (y+a)/(sqrt(x^2+(y+a)^2) =cte

Below is an example with Q1=Q2=1, Q1=-Q2=1, Q1=1=-2Q2.

Quite slow in ps but convert ps to pdf.

Best regards,

Patrice

\documentclass{article}

\begin{document}

%%% Q1=Q1=1, a=1
% Les équipotentielles ont pour équation:
%
% 1/(sqrt(x^2+(y-a)^2) +  1/(sqrt(x^2+(y+a)^2) =cte
%
%
% Les ligne de champ ont pour équation:
%
% (y-a)/(sqrt(x^2+(y-a)^2) +  (y+a)/(sqrt(x^2+(y+a)^2) =cte

\begin{pspicture}(-5.5,-5.5)(5.5,5.5)
%\psgrid
\begin{psclip}{\psframe[linestyle=none](-5.2,-5.2)(5.2,5.2)}
\multido{\r=0.4+0.2}{3}{%
\psplotImp[linestyle=dotted,linecolor=red](-6,-6)(6,6){%
x 2 exp y 1 sub 2 exp add sqrt 1 exch div x 2 exp y 1 add 2 exp add sqrt 1 exch div add \r\space sub}}
\multido{\r=1.0+1.0}{3}{%
\psplotImp[linestyle=dashed,linecolor=red](-6,-6)(6,6){%
x 2 exp y 1 sub 2 exp add sqrt 1 exch div x 2 exp y 1 add 2 exp add sqrt 1 exch div add \r\space sub}}
\multido{\r=0.2+0.4}{5}{%
\psplotImp[linestyle=solid,linecolor=blue](-6,-6)(6,6){%
\multido{\r=-0.2+-0.4}{5}{%
\psplotImp[linestyle=solid,linecolor=blue](-6,-6)(6,6){%
\psdots(0,1)(0,-1)
\end{psclip}
\psaxes{->}(0,0)(-5.5,-5.5)(5.5,5.5)[$y$,-90][$z$,0]
\end{pspicture}

%%% Q1=-Q2=1, a=1
% Les équipotentielles ont pour équation:
%
% 1/(sqrt(x^2+(y-a)^2) -  1/(sqrt(x^2+(y+a)^2) =cte
%
%
% Les ligne de champ ont pour équation:
%
% (y-a)/(sqrt(x^2+(y-a)^2) -  (y+a)/(sqrt(x^2+(y+a)^2) =cte

\begin{pspicture}(-5.5,-5.5)(5.5,5.5)
%\psgrid
\begin{psclip}{\psframe[linestyle=none](-5.2,-5.2)(5.2,5.2)}
\multido{\r=0.4+0.2}{3}{%
\psplotImp[linestyle=dashed,linecolor=red](-6,-6)(6,6){%
x 2 exp y 1 sub 2 exp add sqrt 1 exch div x 2 exp y 1 add 2 exp add sqrt 1 exch div sub \r\space sub}}
\multido{\r=0.04+0.04}{3}{%
\psplotImp[linestyle=dashed,linecolor=red](-6,-6)(6,6){%
x 2 exp y 1 sub 2 exp add sqrt 1 exch div x 2 exp y 1 add 2 exp add sqrt 1 exch div sub \r\space sub}}
\multido{\r=-0.4+-0.2}{3}{%
\psplotImp[linestyle=dashed,linecolor=orange](-6,-6)(6,6){
x 2 exp y 1 sub 2 exp add sqrt 1 exch div x 2 exp y 1 add 2 exp add sqrt 1 exch div sub \r\space sub}}
\multido{\r=-0.04+-0.04}{3}{%
\psplotImp[linestyle=dashed,linecolor=orange](-6,-6)(6,6){
x 2 exp y 1 sub 2 exp add sqrt 1 exch div x 2 exp y 1 add 2 exp add sqrt 1 exch div sub \r\space sub}}
\multido{\r=0.1+0.2}{8}{%
\psplotImp[linestyle=solid,linecolor=blue](-6,-6)(6,6){
y 1 sub x 2 exp y 1 sub 2 exp add sqrt div y 1 add x 2 exp y 1 add 2 exp add sqrt div sub \r\space add}}
\psdots(0,1)(0,-1)
\end{psclip}
\psaxes{->}(0,0)(-5.5,-5.5)(5.5,5.5)[$y$,-90][$z$,0]
\end{pspicture}

%%% Q1=1, Q2=-0.5
% Les équipotentielles ont pour équation:
%
% 1/(sqrt(x^2+(y-a)^2) -  0.5/(sqrt(x^2+(y+a)^2) =cte
%
%
% Les ligne de champ ont pour équation:
%
% (y-a)/(sqrt(x^2+(y-a)^2) - 0.5(y+a)/(sqrt(x^2+(y+a)^2) =cte

\begin{pspicture}(-5.5,-5.5)(5.5,5.5)
%\psgrid
\begin{psclip}{\psframe[linestyle=none](-5.2,-5.2)(5.2,5.2)}
\multido{\r=0.4+0.2}{3}{%
\psplotImp[linestyle=dashed,linecolor=red](-6,-6)(6,6){%
x 2 exp y 1 sub 2 exp add sqrt 1 exch div x 2 exp y 1 add 2 exp add sqrt 0.5 exch div sub \r\space sub}}
\multido{\r=0.04+0.04}{3}{%
\psplotImp[linestyle=dashed,linecolor=red](-6,-6)(6,6){%
x 2 exp y 1 sub 2 exp add sqrt 1 exch div x 2 exp y 1 add 2 exp add sqrt 0.5 exch div sub \r\space sub}}
\multido{\r=-0.4+-0.2}{3}{%
\psplotImp[linestyle=dashed,linecolor=orange](-6,-6)(6,6){
x 2 exp y 1 sub 2 exp add sqrt 1 exch div x 2 exp y 1 add 2 exp add sqrt 0.5 exch div sub \r\space sub}}
\multido{\r=-0.04+-0.04}{3}{%
\psplotImp[linestyle=dashed,linecolor=orange](-6,-6)(6,6){
x 2 exp y 1 sub 2 exp add sqrt 1 exch div x 2 exp y 1 add 2 exp add sqrt 0.5 exch div sub \r\space sub}}
\multido{\r=0.1+0.2}{8}{%
\psplotImp[linestyle=solid,linecolor=blue](-6,-6)(6,6){
y 1 sub x 2 exp y 1 sub 2 exp add sqrt div y 1 add x 2 exp y 1 add 2 exp add sqrt div 0.5 mul sub \r\space add}}
\psdots(0,1)(0,-1)
\end{psclip}
\psaxes{->}(0,0)(-5.5,-5.5)(5.5,5.5)[$y$,-90][$z$,0]
\end{pspicture}

\end{document}

De : pstricks-bounces at tug.org [mailto:pstricks-bounces at tug.org] De la part de Thomas Söll 1und1
Envoyé : samedi 16 janvier 2010 15:03
À : pstricks at tug.org
Objet : [pstricks] Elektrostatic Field

Hallo,

is it possible to draw the the lines of an E-Field from the superposition of two radialsymmetric Charges, as in the picture drawn.
There is one +Q1, the other -0,5*Q1.

Has anyone an idea?

Thanks for helping.

Thomas Söll[cid:image001.jpg at 01CA9831.4BD88160]

________________________________
Important notification: In the context of the creation of the University of Mons, FPMs email address policy is changing from '@fpms.ac.be' to '@umons.ac.be' (or @student.fpms.ac.be to @student.umons.ac.be), please update your contact list accordingly.

Note importante: Dans le cadre de la création de l'Université de Mons, la stratégie d'adresse de courrier électronique de la FPMs change de '@fpms.ac.be' à '@umons.ac.be' (ou @student.fpms.ac.be to @student.umons.ac.be), merci de mettre à jour votre liste d'adresses en conséquence.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20100118/0f713769/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 112294 bytes
Desc: image001.jpg
URL: <http://tug.org/pipermail/pstricks/attachments/20100118/0f713769/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Document-TeX 51.pdf
Type: application/pdf
Size: 1731385 bytes
Desc: Document-TeX 51.pdf
URL: <http://tug.org/pipermail/pstricks/attachments/20100118/0f713769/attachment-0001.pdf>