Lab 202 Numerical Verification of Gauss Law

Lab 202 Numerical Verification of Gauss Law - All_PI = PIup...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Lab 202: Numerical Verification of Gauss law Name : William Savastano Object : Evaluating Gaussing Law numerically using Matlab. Theory : Electric flux is a dot production of electric field vector E and area vector A. Calculation Result : clear all diary ('Lab202') diary on eps0 = 8.85*10^-12; k = 1/(4*pi*eps0); q1 = 9*10^-9; a=1; syms x y z; E = @(x,y,z) k*q1/((x-0.1)^2 + (y-0.2)^2 + (z-0.3)^2)^(3/2)*[x-0.1,y- 0.2,z-0.3]; I = [a, 0, 0]; J = [0, a, 0]; K = [0, 0, a]; Eup = dot(K, E(x,y,a)); Elow = dot(-K, E(x,y,-a)); Eleft = dot(-J, E(x,-a,z)); Eright = dot(J, E(x,a,z)); Efront = dot(I, E(a,y,z)); Eback = dot(-I, E(-a,y,z)); PIup = int(int(Eup,x,-a,a),y,-a,a); PIlow = int(int(Elow,x,-a,a),y,-a,a); PIleft = int(int(Eleft,x,-a,a),z,-a,a); PIright = int(int(Eright,x,-a,a),z,-a,a); PIfront = int(int(Efront,y,-a,a),z,-a,a); PIback = int(int(Eback,y,-a,a),z,-a,a);
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

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

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: All_PI = PIup + PIlow + PIleft + PIright + PIfront + PIback; vpa(All_PI, 10) vpa(eps0*All_PI, 5) Discussion and analysis : 1) E = @(x,y,z) k*q1/((x-0)^2 + (y-0)^2 + (z-0)^2)^(3/2)*[x-0,y-0,z-0]; >> vpa(eps0*All_PI, 5) ans = 0.000000009 2) X=.5A ans = 854.2572998 ans = 0.0000000075602 3) Y = .5A ans = 848.7555278 ans = 0.0000000075115 4) q1 = -9*10^-9; ans =-1016.9491530000000000244497755375 ans =-0.0000000089999999999999999999255876592753 5) q1 = 2*(9*10^-9); ans = 2033.898305 ans = 0.000000018 6) A = 2 ans = 2033.898305 ans = 0.000000018 A = 10 ans = 10169.49153 >> vpa(eps0*All_PI, 5) ans = .90002e-7 A = 100 ans = 101694.9153 >> vpa(eps0*All_PI, 5) ans = .90000e-6 7) ans = 1372.127351 >> vpa(eps0*All_PI, 5) ans = .12142e-7...
View Full Document

Page1 / 4

Lab 202 Numerical Verification of Gauss Law - All_PI = PIup...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online