Calculation of Point Charges

Load 'Charge' Package

Needs["Exam`Charge`"]

Quadropol

num = 4;

charge = Table[ (-1)^i, {i, num} ];

eps = Table[ 1, {i, num} ];

posit = {{-1, -1, 0}, {-1, 1, 0}, {1, 1, 0}, {1, -1, 0}};

rang = { {x, -2, 2}, {y, -2, 2}, {z, -2, 2} };

selectview = {{{z, 0}}, {{x, 1}}, {{y, 1}}};

lab = { "xy-plane", "yz-plane", "xz-plane"};

Distribution Quadropol

Distribution[posit];

Distribution Quadropol


Potential[ { charge, eps, posit, selectview, rang, lab }, ContourShading -> False, Contours -> 25, ContourSmoothing -> Automatic ];

Potential Quadropol

Potential Quadropol xy-plane
Potential Quadropol yz-plane
Potential Quadropol xz-plane


Electric Field Quadropol

EField[ { charge, eps, posit, selectview, rang, lab } ];

Electric Field Quadropol xy-plane
Electric Field Quadropol yz-plane



Coil

posit = Table[ { Sin[x], Cos[x], x/3 }, {x, 0, 10, 0.05}];

charge = Table[ 1, {i, Length[posit]} ];

eps = Table[ 1, {i, Length[posit]} ];

rang = { {x, -2, 2}, {y, -2, 2}, {z, -2, 2} };

selectview = {{{z, 0}}, {{x, 1}}};

lab = { "xy-plane", "yz-plane"};

Distribution Coil


Distribution Coil


Potential Coil

Potential Coil xy-plane
Potential Coil yz-plane


Electric Field Coil

Electric Field Coil xy-plane
Electric Field Coil yz-plane



Circle

posit = Table[ { Sin[x], Cos[x], 0 }, {x, 0, 2Pi, 0.01}];

charge = Table[ 1, {i, Length[posit]} ];

eps = Table[ 1, {i, Length[posit]} ];

rang = { {x, -2, 2}, {y, -2, 2}, {z, -2, 2} };

selectview = {{{z, 0}}, {{x, 1}}};

lab = { "xy-plane", "yz-plane"};

Distribution Ring


Potential Circle

Potential Circle xy-plane
Potential Circle yz-plane


Electric Field Circle

Electric Field Circle xy-plane
Electric Field Circle yz-plane




Line

posit = Table[ { x, x, 0 }, {x, 0, 10, 0.01}];

charge = Table[ 1, {i, Length[posit]} ];

eps = Table[ 1, {i, Length[posit]} ];

rang = { {x, -2, 2}, {y, -2, 2}, {z, -2, 2} };

selectview = {{{z, 0}}, {{x, 1}}};

lab = { "xy-plane", "yz-plane"};

Distribution Line


Potential Line

Potential Line xy-plane
Potential Line yz-plane


Electric Field Line

Electric Field Line xy-plane
Electric Field Line yz-plane




Ring

posit = Apply[Join, Table[Table[ { Sin[k], Cos[k], z }, {z, 0, 1, 0.1}], {k, 0, 2Pi, 0.1}] ];

charge = Table[ 1, {i, Length[posit]} ];

eps = Table[ 1, {i, Length[posit]} ];

rang = { {x, -2, 2}, {y, -2, 2}, {z, -2, 2} };

selectview = {{{z, 0}}, {{x, 1}}};

lab = { "xy-plane", "yz-plane"};

Distribution Ring


Potential Ring

Potential Ring xy-plane
Potential Ring yz-plane


Electric Field Ring

Electric Field Ring xy-plane
Electric Field Ring yz-plane




Point-Point

posit1 = Apply[Join, Table[Table[ { z Sin[x], z Cos[x], -z }, {x, 0, 2Pi, 0.1}], {z, 0, 2, 0.2}] ];

posit2 = Apply[Join, Table[Table[ { z Sin[x], z Cos[x], z+0.5 }, {x, 0, 2Pi, 0.1}], {z, 0, 2, 0.2}] ];

posit = posit1~Join~posit2;

charge = Table[ 1, {i, Length[posit]} ];

eps = Table[ 1, {i, Length[posit]} ];

rang = { {x, -2, 2}, {y, -2, 2}, {z, -2, 2} };

selectview = {{{z, 0}}, {{x, 1}}};

lab = { "xy-plane", "yz-plane"};

Distribution Point-Point


Potential Point-Point

Potential Point-Point xy-plane
Potential Point-Point yz-plane


Electric Field Point-Point

Electric Field Point-Point xy-plane
Electric Field Point-Point yz-plane




Point-Plane

posit1 = Apply[Join, Table[Table[ { z Sin[x], z Cos[x], -z }, {x, 0, 2Pi, 0.1}], {z, 0, 2, 0.2}] ];

posit2 = Apply[Join, Table[Table[ { x, y, 0.5 }, {x, -2, 2, 0.2}], {y, -2, 2, 0.2}] ];

posit = posit1~Join~posit2;

charge1 = Table[ 1, {i, Length[posit1]} ];

charge2 = Table[ -1, {i, Length[posit2]} ];

charge = charge1~Join~charge2;

eps = Table[ 1, {i, Length[posit]} ];

rang = { {x, -2, 2}, {y, -2, 2}, {z, -2, 2} };

selectview = {{{z, 0}}, {{x, 1}}};

lab = { "xy-plane", "yz-plane"};

Distribution Point-Plane


Potential Point-Plane

Potential Point-Plane xy-plane
Potential Point-Plane yz-plane


Electric Field Point-Plane

Electric Field Point-Plane xy-plane
Electric Field Point-Plane yz-plane