lab201 - Lab 201: Electric Field by Point Charges Name:...

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

View Full Document Right Arrow Icon
Lab 201: Electric Field by Point Charges Name : William Savastano, Pierre Damis Objective : To Compute electric field caused by point charge using Matlab. Theoretical Background : Charges can generate Electric field around them. Calculation Result : >> clear >> eps0=8.854*10^-12; k=1/(4*pi*eps0); >> x=[-2.1:0.2:2.1]; >> y=[-2.1:0.2:2.1]; >> [x,y]=meshgrid(x,y); >> q=1*10^-9; >> E=k*q./(x.^2+y.^2); >> [px]=cos(atan2(y,x)); >> [py]=sin(atan2(y,x)); >> xcomp=E.*px; ycomp=E.*py; >> quiver(x,y,xcomp,ycomp) hold on >> x=0;y=0;plot(x,y,'+') >> xlabel 'x', ylabel 'y'
Background image of page 1

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

View Full DocumentRight Arrow Icon
-2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 x y >> clear >> eps0=8.854*10^-12; k=1/(4*pi*eps0); >> x=[-2.1:0.2:2.1]; >> q=1*10^-9; >> q2=1*10^-9;a=1; >> E1=q*k*(x+a)./abs(x+a).^3; >> E2=q*k*(x-a)./abs(x-a).^3; >> Etotal=E1+E2 >> plot(x,Etotal) >> xlabel 'x';ylabel 'Etotal' >> grid >> title 'Total Electric fields vs. x'
Background image of page 2
-2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 -1000 -800 -600 -400 -200 0 200 400 600 800 1000 x Etotal Total Electric fields vs. x
Background image of page 3

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

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

This note was uploaded on 03/11/2010 for the course PHYS 121 taught by Professor Opyrchal during the Spring '08 term at NJIT.

Page1 / 6

lab201 - Lab 201: Electric Field by Point Charges Name:...

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