QUESTION 1
>> clear all
diary ('Lab202');
diary on
esp0 = 8.85*10^-12; k= 1/(4*pi*esp0);
a=1;
q1= 9*10^-9;
syms x y z;
E = @(x,y,z) k*q1/((x)^2 + (y)^2 + (z)^2)^(3/2)*[x,y,z];
I = [1,0,0]; J = [0,1,0]; K = [0,0,1];
Eup = dot(K, E(x,y,1));
Elow = dot(-K, E(x,y,-1));
Eleft = dot(-J, E(x,-1, z));
Eright = dot(J, E(x,1,z));
Efront = dot(I, E(1,y,z));
Eback = dot (-I, E(-1,y,z));
PIup = int(int (Eup, x, -1,1),y,-1,1);
PIlow = int(int (Elow, x, -1,1),y,-1,1);
PIleft = int(int (Eleft, x, -1,1),z,-1,1);
PIright = int(int (Eright, x, -1,1),z,-1,1);
PIfront = int(int (Efront, y, -1,1),z,-1,1);
PIback = int(int (Eback, y, -1,1),z,-1,1);
vpa(PIup, 10)
vpa(PIlow, 10)
vpa(PIleft, 10)
vpa(PIright, 10)
vpa(PIfront, 10)
vpa(PIback, 10)
All_PI = PIup + PIlow + PIleft + PIright + PIfront + PIback;
vpa(All_PI, 10)
vpa(esp0*All_PI, 5)
Warning: Explicit integral could not be found.
Warning: Explicit integral could not be found.
Warning: Explicit integral could not be found.
Warning: Explicit integral could not be found.
Warning: Explicit integral could not be found.
Warning: Explicit integral could not be found.
ans =