From f35ea80659b6a49d1bb2ce1d7d002583f3f40947 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 10 Oct 2017 12:38:01 +0530 Subject: updated the code --- 854/CH2/EX2.1/Example2_1.sce | 54 +++++++++++++------------- 854/CH2/EX2.2/Example2_2.sce | 92 ++++++++++++++++++++++---------------------- 2 files changed, 73 insertions(+), 73 deletions(-) (limited to '854/CH2') diff --git a/854/CH2/EX2.1/Example2_1.sce b/854/CH2/EX2.1/Example2_1.sce index cb73e86e4..895c5274a 100755 --- a/854/CH2/EX2.1/Example2_1.sce +++ b/854/CH2/EX2.1/Example2_1.sce @@ -1,27 +1,27 @@ -//clear// -//Caption:Program to Caculate force exerted on Q2 by Q1 -//Example2.1 -//page 29 -clc; -r2 = [2,0,5]; -r1 = [1,2,3]; -R12 = norm(r2-r1); -aR12 = UnitVector(r2-r1); -disp(R12,'R12=') -disp(aR12,'aR12=') -Q1 = 3e-04; //charge 1 in Coulombs -Q2 = -1e-04; //charge 2 in Coulombs -Eps = 8.854e-12; //free space permittivity -F2 = ((Q1*Q2)/(4*%pi*Eps*R12^2))*aR12; -F1 = -F2; -disp(F2,'Force exerted on Q2 by Q1 in N/m F2 =') -disp(F1,'Force exerted on Q1 by Q2 in N/m F1 =') -//Result -//R12= -// 3. -//aR12= -// 0.3333333 - 0.6666667 0.6666667 -//Force exerted on Q2 by Q1 in N/m F2 = -// - 9.9863805 19.972761 - 19.972761 -//Force exerted on Q1 by Q2 in N/m F1 = -// 9.9863805 - 19.972761 19.972761 +clear +//Caption:Program to Caculate force exerted on Q2 by Q1 +//Example2.1 +//page 29 +clc; +r2 = [2,0,5]; +r1 = [1,2,3]; +R12 = norm(r2-r1); +aR12 = (r2-r1)/R12; +disp(R12,'R12=') +disp(aR12,'aR12=') +Q1 = 3e-04; //charge 1 in Coulombs +Q2 = -1e-04; //charge 2 in Coulombs +Eps = 8.854e-12; //free space permittivity +F2 = ((Q1*Q2)/(4*%pi*Eps*R12^2))*aR12; +F1 = -F2; +disp(F2,'Force exerted on Q2 by Q1 in N/m F2 =') +disp(F1,'Force exerted on Q1 by Q2 in N/m F1 =') +//Result +//R12= +// 3. +//aR12= +// 0.3333333 - 0.6666667 0.6666667 +//Force exerted on Q2 by Q1 in N/m F2 = +// - 9.9863805 19.972761 - 19.972761 +//Force exerted on Q1 by Q2 in N/m F1 = +// 9.9863805 - 19.972761 19.972761 \ No newline at end of file diff --git a/854/CH2/EX2.2/Example2_2.sce b/854/CH2/EX2.2/Example2_2.sce index 38968b0f2..fa2f12650 100755 --- a/854/CH2/EX2.2/Example2_2.sce +++ b/854/CH2/EX2.2/Example2_2.sce @@ -1,46 +1,46 @@ -//clear// -//Caption:Program to Caculate Electric Field E at P due to 4 identical charges -//Example2.2 -//page 33 -clc; -P = [1,1,1]; -P1 = [1,1,0]; -P2 = [-1,1,0]; -P3 = [-1,-1,0]; -P4 = [1,-1,0]; -R1 = norm(P-P1); -aR1 = UnitVector(P-P1); -R2 = norm(P-P2); -aR2 = UnitVector(P-P2); -R3 = norm(P-P3); -aR3 = UnitVector(P-P3); -R4 = norm(P-P4); -aR4 = UnitVector(P-P4); -disp(R1,'R1=') -disp(aR1,'aR1=') -disp(R2,'R2=') -disp(aR2,'aR2=') -disp(R3,'R3=') -disp(aR3,'aR3=') -disp(R4,'R4=') -disp(aR4,'aR4=') -Q = 3e-09; //charge in Coulombs -Eps = 8.854e-12; //free space permittivity -E1 = (Q/(4*%pi*Eps*R1^2))*aR1; -E2 = (Q/(4*%pi*Eps*R2^2))*aR2; -E3 = (Q/(4*%pi*Eps*R3^2))*aR3; -E4 = (Q/(4*%pi*Eps*R4^2))*aR4; -E = E1+E2+E3+E4; -disp(E,'Electric Field Intesnity at any point P due to four identical Charges in V/m=') -//Result -//R1= 1. -//aR1= 0. 0. 1. -//R2= 2.236068 -//aR2= 0.8944272 0. 0.4472136 -//R3= 3. -//aR3= 0.6666667 0.6666667 0.3333333 -//R4= 2.236068 -//aR4= 0. 0.8944272 0.4472136 -//Electric Field Intesnity at any point P due to four identical Charges in V/m= -// 6.8206048 6.8206048 32.785194 -// +clear// +//Caption:Program to Caculate Electric Field E at P due to 4 identical charges +//Example2.2 +//page 33 +clc; +P = [1,1,1]; +P1 = [1,1,0]; +P2 = [-1,1,0]; +P3 = [-1,-1,0]; +P4 = [1,-1,0]; +R1 = norm(P-P1); +aR1 = (P-P1)/R1; +R2 = norm(P-P2); +aR2 = (P-P2)/R2; +R3 = norm(P-P3); +aR3 = (P-P3)/R3; +R4 = norm(P-P4); +aR4 = (P-P4)/R4; +disp(R1,'R1=') +disp(aR1,'aR1=') +disp(R2,'R2=') +disp(aR2,'aR2=') +disp(R3,'R3=') +disp(aR3,'aR3=') +disp(R4,'R4=') +disp(aR4,'aR4=') +Q = 3e-09; //charge in Coulombs +Eps = 8.854e-12; //free space permittivity +E1 = (Q/(4*%pi*Eps*R1^2))*aR1; +E2 = (Q/(4*%pi*Eps*R2^2))*aR2; +E3 = (Q/(4*%pi*Eps*R3^2))*aR3; +E4 = (Q/(4*%pi*Eps*R4^2))*aR4; +E = E1+E2+E3+E4; +disp(E,'Electric Field Intesnity at any point P due to four identical Charges in V/m=') +//Result +//R1= 1. +//aR1= 0. 0. 1. +//R2= 2.236068 +//aR2= 0.8944272 0. 0.4472136 +//R3= 3. +//aR3= 0.6666667 0.6666667 0.3333333 +//R4= 2.236068 +//aR4= 0. 0.8944272 0.4472136 +//Electric Field Intesnity at any point P due to four identical Charges in V/m= +// 6.8206048 6.8206048 32.785194 +// \ No newline at end of file -- cgit