1

Try to plot a simplified plot of the magnetic field.

The results are as follows:

Looks flawed (looks like T_T)

enter image description here

code:

\documentclass{article}
\usepackage{amsmath}
\usepackage{pst-plot, pst-math}
\usepackage{pst-ode}

\begin{document}
\psset{unit=3cm}
\begin{pspicture}(-2.2,-1.2)(2.1,1.1)
\psaxes[ticksize=0 4pt,axesstyle=frame,tickstyle=inner,subticks=20,
        Ox=-2,Oy=-1](-2,-1)(2,1)
\psset{arrows=->, algebraic}
\psVectorfield[linecolor=black!60](-1.9,-0.9)(1.9,0.9){%
(y*(  sqrt(((x-1.3)^2+y^2)^3) - sqrt(((x+1.3)^2+y^2)^3)  )
)/(
(x+1.3)*sqrt(((x-1.3)^2+y^2)^3) - (x-1.3)*sqrt(((x+1.3)^2+y^2)^3)
)}
\end{pspicture}
\end{document}

So, I hope to be able to fix the length of the vector, but I only know the options like 'linewidth' ...

  • The tags tikz-pgf and tikz-arrows are wrong. You are using pstricks and not tikz. – Ulrike Fischer Sep 11 '17 at 16:16
1

There are some singularities. Use three intervals:

\documentclass{article}
\usepackage{pst-plot,pst-ode}

\begin{document}
    \psset{unit=3}
    \begin{pspicture}(-2.2,-1.2)(-0.5,1.1)
    \psset{arrows=->, algebraic}
    \psclip{\psframe[linestyle=none](-2,-1)(2,1)}
    \psVectorfield[linecolor=black!60](-1.9,-0.9)(-1.405,0.9){%
        (y*(  sqrt(((x-1.3)^2+y^2)^3) - sqrt(((x+1.3)^2+y^2)^3)))
        /
        ((x+1.3)*sqrt(((x-1.3)^2+y^2)^3)-(x-1.3)*sqrt(((x+1.3)^2+y^2)^3))}
    \psVectorfield[linecolor=black!60](-1.25,-0.9)(1.3,0.9){%
        (y*(sqrt(((x-1.3)^2+y^2)^3) - sqrt(((x+1.3)^2+y^2)^3)))
        /
        ((x+1.3)*sqrt(((x-1.3)^2+y^2)^3)-(x-1.3)*sqrt(((x+1.3)^2+y^2)^3))}
    \psVectorfield[linecolor=black!60](1.43,-0.9)(2,0.9){%
        (y*(sqrt(((x-1.3)^2+y^2)^3) - sqrt(((x+1.3)^2+y^2)^3)))
        /
        ((x+1.3)*sqrt(((x-1.3)^2+y^2)^3)-(x-1.3)*sqrt(((x+1.3)^2+y^2)^3))}
    \endpsclip
    \psaxes[ticksize=0 4pt,axesstyle=frame,tickstyle=inner,
    subticks=20, Ox=-2,Oy=-1](-2,-1)(2,1)
    \end{pspicture}
\end{document}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.