[pstricks] Re : Elektrostatic Field

Thomas Söll Thomas.Soell at lehrer.uka.de
Sun Jan 17 16:01:22 CET 2010


Hallo Manuel,

thank you for your solution. 

Now I have to understand your way to find the lines of the field.

With best regards,

Thomas Söll
  ----- Original Message ----- 
  From: mluque5130 at aol.com 
  To: pstricks at tug.org 
  Sent: Sunday, January 17, 2010 10:31 AM
  Subject: [pstricks] Re : Elektrostatic Field


  This example draws only the vectors at selected points.
  If nobody gives a complete solution to trace the lines of electric field, I think I can do it in 2 or 3 weeks...


  %%%%%%%%%%%%%%%%%%%%%%

  \documentclass{article}
  \usepackage{pstricks,multido}
  \SpecialCoor
  \def\fieldlines{% 
           /xP \nx\space def
           /yP \ny\space def
           /r1 xP xA sub dup mul yP dup mul add sqrt def
           /r2 xP xA add dup mul yP dup mul add sqrt def
  %        /V q1 r1 div
  %           q2 r2 div
  %           add def
  %        Ex=-dV/dx
           /Ex q1 xP xA sub mul r1 3 exp div
                q2 xP xA add mul r2 3 exp div
                add def
  %        Ey=-dV/dy
           /Ey yP 
               q1 r1 3 exp div
               q2 r2 3 exp div
               add mul def
           /NormeE Ex dup mul Ey dup mul add sqrt def
           /uEx Ex NormeE div K mul def
           /uEy Ey NormeE div K mul def
  }
  \begin{document}

  \begin{pspicture}(-5,-5)(5,6)
  \multido{\nx=-5+0.5}{22}{%
  \multido{\ny=-5+0.5}{22}{%
  \pstVerb{/q1 1 def
           /q2 -0.5 q1 mul def
           /K 1 def
           /xA 1.8 def
           \fieldlines}
  \rput(\nx,\ny){\psline{->}(0,0)(!uEx uEy)\psdot(0,0)}
  }}
  \pscircle*(!xA 0){0.25}\pscircle*(!xA neg 0){0.25}
  \end{pspicture}

  \begin{pspicture}(-5,-5)(5,6)
  \multido{\nx=-5+0.5}{22}{%
  \multido{\ny=-5+0.5}{22}{%
  \pstVerb{/q1 -1 def
           /q2 2 q1 mul def
           /K 1 def
           /xA 2.2 def
           \fieldlines}
  \rput(\nx,\ny){\psline{->}(0,0)(!uEx uEy)\psdot(0,0)}
  }}
  \pscircle*(!xA 0){0.25}\pscircle*(!xA neg 0){0.25}
  \end{pspicture}
  \end{document}

  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%


  Yours sincerely 

  Manuel



  -----E-mail d'origine-----
  De : Thomas Söll 1und1 <Thomas.Soell at onlinehome.de>
  A : pstricks at tug.org
  Envoyé le : Samedi, 16 Janvier 2010 15:02
  Sujet : [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
_______________________________________________
PSTricks mailing list
PSTricks at tug.org
http://tug.org/mailman/listinfo/pstricks
archive: http://www.tug.org/pipermail/pstricks/


------------------------------------------------------------------------------


  _______________________________________________
  PSTricks mailing list
  PSTricks at tug.org
  http://tug.org/mailman/listinfo/pstricks
  archive: http://www.tug.org/pipermail/pstricks/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20100117/7fec4824/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 215877 bytes
Desc: not available
URL: <http://tug.org/pipermail/pstricks/attachments/20100117/7fec4824/attachment-0001.jpe>


More information about the PSTricks mailing list