lab 202 codes incomplete

# lab 202 codes incomplete - clear all diary'Lab202 diary on...

This preview shows pages 1–3. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 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)^2)^(3/2)*[x,y,z-2]; 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) 3) >> 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-.5)^2 + (z)^2)^(3/2)*[x,y-.5,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);...
View Full Document

{[ snackBarMessage ]}

### Page1 / 10

lab 202 codes incomplete - clear all diary'Lab202 diary on...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online