3
$\begingroup$

my name is Michael and im new to this Forum, so sorry for any misbehavior (also english is not my native language).

My Question:

I have a given (quite difficult) electrical field and i want to make a Streamplot.

This are my Functions:

Ey1 := -\[Sigma] (Log[
  a - x + Sqrt[(-a + x)^2 + (a - y)^2 + (z - d)^2]] + 
 Log[-a + x + 
   Sqrt[(-a + x)^2 + (a + y)^2 + (z - d)^2]]) + \[Sigma] (Log[-a -
    x + Sqrt[(a + x)^2 + (a - y)^2 + (z - d)^2]] + 
 Log[a + x + Sqrt[(a + x)^2 + (a + y)^2 + (z - d)^2]])

Ey2 := \[Sigma] (Log[
      a - x + Sqrt[(-a + x)^2 + (a - y)^2 + (z + d)^2]] + 
     Log[-a + x + 
       Sqrt[(-a + x)^2 + (a + y)^2 + (z + d)^2]]) - \[Sigma] (Log[-a -
        x + Sqrt[(a + x)^2 + (a - y)^2 + (z + d)^2]] + 
     Log[a + x + Sqrt[(a + x)^2 + (a + y)^2 + (z + d)^2]])

Ez1 := \[Sigma] (ArcTan[((a - x) (-a + y))/((z - 
         d) Sqrt[(a - x)^2 + (-a + y)^2 + (z - d)^2])] + 
     ArcTan[((a + x) (-a + y))/((z - 
         d) Sqrt[(a + x)^2 + (-a + y)^2 + (z - 
          d)^2])]) - \[Sigma] (ArcTan[((a - x) (a + y))/((z - 
         d) Sqrt[(a - x)^2 + (a + y)^2 + (z - d)^2])] + 
     ArcTan[((a + x) (a + y))/((z - 
         d) Sqrt[(a + x)^2 + (a + y)^2 + (z - d)^2])])

Ez2 := -\[Sigma] (ArcTan[((a - x) (-a + y))/((z + 
         d) Sqrt[(a - x)^2 + (-a + y)^2 + (z + d)^2])] + 
     ArcTan[((a + x) (-a + y))/((z + 
         d) Sqrt[(a + x)^2 + (-a + y)^2 + (z + 
          d)^2])]) + \[Sigma] (ArcTan[((a - x) (a + y))/((z + 
         d) Sqrt[(a - x)^2 + (a + y)^2 + (z + d)^2])] + 
     ArcTan[((a + x) (a + y))/((z + 
         d) Sqrt[(a + x)^2 + (a + y)^2 + (z + d)^2])])

This is my Plot so far:

Show[StreamPlot[{Ez1 + Ez2, Ey1 + Ey2} /. {a -> 10, 
x -> 0, \[Sigma] -> 1, d -> 2}, {z, -15, 15}, {y, -15, 15}],Graphics[{Red, Line[{{-2, -10}, {-2, 10}}], Red, Line[{{2, -10}, {2, 10}}]}]]

Streamplot

As you can see i have highlightet some lines, that does not start on the plate.

Is there any way to get rid of this lines ?

I tried to work with DeleteCase, but it was not successful.

Thx, Michael

$\endgroup$
3
$\begingroup$

When such things matter it might be easier to specify the "stream points," instead of fixing what the default setting does:

sp = Join[
   Table[{-3, y}, {y, -10, 9, 1}],
   Table[{3, y}, {y, -10, 9, 1}],
   Table[{0, y}, {y, -10, 9, 1}]
   ];

Show[
 StreamPlot[
  {Ez1 + Ez2, Ey1 + Ey2} /. {a -> 10, x -> 0, \[Sigma] -> 1, d -> 2},
  {z, -15, 15}, {y, -15, 15}, StreamPoints -> sp
  ],
 Graphics[{Red, Line[{{-2, -10}, {-2, 10}}], Red, Line[{{2, -10}, {2, 10}}]}]
 ]

Mathematica graphics

$\endgroup$

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.