{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lab201

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

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

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'

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

View Full Document
-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'
-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

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.

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online