Lapsem 2.docx

  • Uploaded by: Tria Nanda
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Lapsem 2.docx as PDF for free.

More details

  • Words: 624
  • Pages: 8
LAMPIRAN

1. Efield1_5_Rabu_130319 Program : clear all; close all; clc; %parameter yang diketahui epsilon0 = 1e-9/(36*pi); Q1=3e-9; Q2=-3e-9; p1 = [-1 0 0]; p2 = [1 0 0]; %daerah pengamatan x=(-2:0.2:2); y = 0; z=(-2:0.2:2); [Px,Pz]=meshgrid(x,z); %matrik medan E = zeros(length(x),length(z)); %menghitung medan for m=1:length(x); for n = 1:length(z); xp = Px(m,n); xy = y; zp = Pz(m,n); %medan karena q1 vektorR1x = xp-p1(1); vektorR1z = zp-p1(3); R1 = sqrt(vektorR1x^2+vektorR1z^2);

aR1x = vektorR1x/R1; aR1z = vektorR1z/R1; E1x=Q1*aR1x/(4*pi*epsilon0*R1^2); E1z=Q1*aR1z/(4*pi*epsilon0*R1^2);

%medan karena q2 vektorR2x = xp-p2(1); vektorR2z = zp-p2(3); R2 = sqrt(vektorR2x^2+vektorR2z^2); aR2x = vektorR2x/R2; aR2z = vektorR2z/R2; E2x=Q2*aR2x/(4*pi*epsilon0*R2^2); E2z=Q2*aR2z/(4*pi*epsilon0*R2^2); %medan total Ex(m,n)= E1x+E2x; Ez(m,n)= E1z+E2z; end end quiver(Px,Pz, Ex,Ez) xlim([0-2 2]); ylim([0-2 2]); xlabel('sumbu x','FontSize',14); ylabel('sumbu z','FontSize',14); hold on; plot(-1, 0, 'o','color','red','linewidth',2); plot(1, 0, 'o','color','magenta','linewidth',2); title('E Field of Two Charges') str1 = {'Q1'}; text(-1.1,0.1,str1); str1 = {'Q2'}; text(1.1,0.1,str1);

Hasil Eksekusi :

2. Efield2_5_Rabu_130319 Program: clear all; close all; clc; %parameter yang diketahui epsilon0 = 1e-9/(36*pi); Q1=2*3e-9; Q2=-3e-9; p1 = [-1 0 0]; p2 = [1 0 0]; %daerah pengamatan x=(-2:0.2:2); y = 0; z=(-2:0.2:2); [Px,Pz]=meshgrid(x,z); %matrik medan E = zeros(length(x),length(z)); %menghitung medan for m=1:length(x); for n = 1:length(z); xp = Px(m,n); xy = y; zp = Pz(m,n); end quiver(Px,Pz, Ex,Ez)

%medan karena q1 vektorR1x = xp-p1(1); vektorR1z = zp-p1(3); R1 = sqrt(vektorR1x^2+vektorR1z^2); aR1x = vektorR1x/R1; aR1z = vektorR1z/R1; E1x=Q1*aR1x/(4*pi*epsilon0*R1^2); E1z=Q1*aR1z/(4*pi*epsilon0*R1^2); %medan karena q2 vektorR2x = xp-p2(1); vektorR2z = zp-p2(3); R2 = sqrt(vektorR2x^2+vektorR2z^2); aR2x = vektorR2x/R2; aR2z = vektorR2z/R2; E2x=Q2*aR2x/(4*pi*epsilon0*R2^2); E2z=Q2*aR2z/(4*pi*epsilon0*R2^2); %medan total Ex(m,n)= E1x+E2x; plot(-1, 0, 'o','color','red','linewidth',2); plot(1, 0, 'o','color','magenta','linewidth',2); title('E Field of Two Charges') str1 = {'Q1'};

xlim([0-2 2]); ylim([0-2 2]); xlabel('sumbu x','FontSize',14); ylabel('sumbu z','FontSize',14); hold on;

text(-1.1,0.1,str1); str1 = {'Q2'}; text(1.1,0.1,str1); Ez(m,n)= E1z+E2z; end

Hasil Eksekusi Q1 diperbesar 3 kali :

3. Efield3_5_Rabu_130319 Program : clear all; close all; clc; %parameter yang diketahui epsilon0 = 2.1*1e-9/(36*pi); Q1=3e-9; Q2=-3e-9; p1 = [-1 0 0]; p2 = [1 0 0]; %daerah pengamatan x=(-2:0.2:2); y = 0; z=(-2:0.2:2); [Px,Pz]=meshgrid(x,z); %matrik medan E = zeros(length(x),length(z)); %menghitung medan

zp = Pz(m,n); %medan karena q1 vektorR1x = xp-p1(1); vektorR1z = zp-p1(3); R1 = sqrt(vektorR1x^2+vektorR1z^2); aR1x = vektorR1x/R1; aR1z = vektorR1z/R1; E1x=Q1*aR1x/(4*pi*epsilon0*R1^2); E1z=Q1*aR1z/(4*pi*epsilon0*R1^2); %medan karena q2 vektorR2x = xp-p2(1); vektorR2z = zp-p2(3); R2 = sqrt(vektorR2x^2+vektorR2z^2); aR2x = vektorR2x/R2; aR2z = vektorR2z/R2; E2x=Q2*aR2x/(4*pi*epsilon0*R2^2); E2z=Q2*aR2z/(4*pi*epsilon0*R2^2);

for m=1:length(x); for n = 1:length(z); xp = Px(m,n); xy = y; end quiver(Px,Pz, Ex,Ez) xlim([0-2 2]); ylim([0-2 2]); xlabel('sumbu x','FontSize',14); ylabel('sumbu z','FontSize',14); hold on; plot(-1, 0, 'o','color','red','linewidth',2);

Hasil Eksekusi :

%medan total Ex(m,n)= E1x+E2x; Ez(m,n)= E1z+E2z; end plot(1, 0, 'o','color','magenta','linewidth',2); title('E Field of Two Charges') str1 = {'Q1'}; text(-1.1,0.1,str1); str1 = {'Q2'}; text(1.1,0.1,str1);

Hasil Eksekusi Permitivitas Relative dikali 4.2

Nilai Ex dan Ez pada titik (0,0,1)

Pada Ex nilainya 4.5457 Pada Ez nilainya 0

4. Efield3_5_Rabu_130319 Program : clear all; close all; clc; %parameter yang diketahui epsilon0 = 1e-9/(36*pi); Q1=9e-9; Q2=-3e-9; Q3=2e-9; p1 = [-1 0 0]; p2 = [1 0 0]; p3 = [0 0 1]; %daerah pengamatan x=(-2:0.2:2); y = 0; z=(-2:0.2:2); [Px,Pz]=meshgrid(x,z); %matrik medan E = zeros(length(x),length(z)); %menghitung medan for m=1:length(x); for n = 1:length(z); xp = Px(m,n); xy = y; zp = Pz(m,n); %medan karena q1 vektorR1x = xp-p1(1); vektorR1z = zp-p1(3); R1 = sqrt(vektorR1x^2+vektorR1z^2); aR1x = vektorR1x/R1; aR1z = vektorR1z/R1; E1x=Q1*aR1x/(4*pi*epsilon0*R1^2); E1z=Q1*aR1z/(4*pi*epsilon0*R1^2); %medan karena q2 vektorR2x = xp-p2(1); vektorR2z = zp-p2(3); R2 = sqrt(vektorR2x^2+vektorR2z^2); aR2x = vektorR2x/R2; aR2z = vektorR2z/R2; E2x=Q2*aR2x/(4*pi*epsilon0*R2^2); E2z=Q2*aR2z/(4*pi*epsilon0*R2^2);

%medan karena q3 vektorR3x = xp-p3(1); vektorR3z = zp-p3(3); R3 = sqrt(vektorR3x^2+vektorR3z^2); aR3x = vektorR3x/R3; aR3z = vektorR3z/R3; E3x=Q3*aR3x/(4*pi*epsilon0*R3^2); E3z=Q3*aR3z/(4*pi*epsilon0*R3^2); %medan total Ex(m,n)= E1x+E2x+E3x; Ez(m,n)= E1z+E2z+E3z; end end quiver(Px,Pz, Ex,Ez) xlim([0-2 2]); ylim([0-2 2]); xlabel('sumbu x','FontSize',14); ylabel('sumbu z','FontSize',14); hold on; plot(-1, 0, 'o','color','red','linewidth',2); plot(1, 0, 'o','color','magenta','linewidth',2); plot(0, 1, 'o','color','green','linewidth',2); title('E Field of Two Charges') str1 = {'Q1'}; text(-1.1,0.1,str1); str1 = {'Q2'}; text(1.1,0.1,str1); str1 = {'F'}; text(0.1,1.1,str1);

Hasil Eksekusi :

Nilai Ex dan Ez pada muatan +2nC di titik (0,0,1)

Related Documents

Lapsem Iik.docx
June 2020 20
Lapsem Bd.docx
April 2020 20
Lapsem Fiswan.docx
July 2020 34
Lapsem Sph.docx
May 2020 23
Lapsem 2.docx
May 2020 19

More Documents from "Husna Nur Wanah"

Lapsem 2.docx
May 2020 19
Readme.txt
December 2019 24
Ppt Endo.pptx
December 2019 34
Laporan 2018.docx
December 2019 29