Lab 203 codes

# Lab 203 codes - VECTOR FIELD clear all q = 1*10^-9 esp0 =...

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: VECTOR FIELD clear all q = 1*10^-9; esp0 = 8.85*10^-12; k = 1./(4*pi*esp0); x = -2.1:0.2:2.1; y = -2.1:0.2:2.1; [X, Y] = meshgrid(x,y); r2 = (X-1).^2 + (Y-1).^2; r = sqrt(r2); V = k*q./r; [c,h] = contour(x,y,V,10); clabel(c,h); xlabel 'x' ; ylabel 'y' surf(x, y, V) [px, py] = gradient (V, 0.1, 0.1); quiver(x, y,-px,-py,2) xlabel 'x' ; ylabel 'y' CONTOUR clear all q = 1*10^-9; esp0 = 8.85*10^-12; k = 1./(4*pi*esp0); x = -2.1:0.2:2.1; y = -2.1:0.2:2.1; [X, Y] = meshgrid(x,y); r2 = (X-1).^2 + (Y-1).^2; r = sqrt(r2); V = k*q./r; [c,h] = contour(x,y,V,10); clabel(c,h); xlabel 'x'; ylabel 'y' SURFACE clear all q = 1*10^-9; esp0 = 8.85*10^-12; k = 1./(4*pi*esp0); x = -2.1:0.2:2.1; y = -2.1:0.2:2.1; [X, Y] = meshgrid(x,y); r2 = (X-1).^2 + (Y-1).^2; r = sqrt(r2); V = k*q./r; [c,h] = contour(x,y,V,10); clabel(c,h); xlabel 'x' ; ylabel 'y' surf(x, y, V) [px, py] = gradient (V, 0.1, 0.1); Problem 1 clear all q = 1*10^-9; esp0 = 8.85*10^-12; k = 1./(4*pi*esp0); x = -2.1:0.2:2.1; y = -2.1:0.2:2.1; [X, Y] = meshgrid(x,y); r2 = (X-1).^2 + (Y-1).^2;r2 = (X-1)....
View Full Document

## This note was uploaded on 05/02/2011 for the course PHYSICS 121A taught by Professor Beidehe during the Spring '11 term at NJIT.

### Page1 / 7

Lab 203 codes - VECTOR FIELD clear all q = 1*10^-9 esp0 =...

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

View Full Document
Ask a homework question - tutors are online