I'm using Mathematica for the first time and I believe I am having trouble with the syntax.
I'm trying to plot a two point electric field and the first step in getting an electric field plot would be to write the equation. In this case I have the following equations(these equations aren't written in mathematica code, just text):
Ex=(k*q1(x+1))/(((x+1)^2+y^2)^(3/2))+(k*q2(x-1))/(((x-1)^2+(y-2)^2)^(3/2))
Ey=(k*q1*y)/(((x+1)^2+y^2)^(3/2))+(k*q2*y)/(((x-1)^2+(y-2)^2)^(3/2))
I want to end up with the following:
Efield= {Ex,Ey}
To do this I have tried the following:
r1 = (x - x1)^2 + (y - y1)^2;
r2 = (x - x2)^2 + (y - y2)^2;
Efieldx = (q1 (x - x1))/r1^(3/2) + (q2 (x - x2))/r2^(3/2)
Efieldy = (q1 (y - y1))/r1^(3/2) + (q2 (y - y2))/r2^(3/2)
Efield = {Efieldx , Efieldy}