summaryrefslogtreecommitdiff
path: root/854/CH4/EX4.2/Example4_2.sce
blob: 4c60ee76bc9daf6ec1a6a39cb3884809be492245 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//clear//
//Caption: Program to find the work involved 'W' in moving a charge 'Q' along straight line
//Example4.2
//page 84
clc;
x = sym('x');
y = sym('y');
z = sym('z');
y1 = sym('y1');
y = -3*(x-1);
Q = 2; //charge in coulombs
Edot_dL1 = integ(y,x);
disp(Edot_dL1,'E.dx*ax =')
Edot_dL1 = limit(Edot_dL1,x,0.8)-limit(Edot_dL1,x,1);
disp(Edot_dL1,'Value of E.dx*ax =')
Edot_dL2 = 0;
disp(Edot_dL2,'Value of E.dz*az=')
x = (1-y1/3);
Edot_dL3 = integ(x,y1)
disp(Edot_dL3,'E.dy*ay=')
Edot_dL3 = limit(Edot_dL3,y1,0.6)-limit(Edot_dL3,y1,0);
disp(Edot_dL3,'Value of E.dy*ay =')
W = -Q*(Edot_dL1+Edot_dL2+Edot_dL3);
disp(W,'Work done in moving a point charge along shorter arc of circle in Joules, W=')
//Result
//E.dx*ax = -3*(x^2/2-x)   
//Value of E.dx*ax = -3/50   
//Value of E.dz*az =   0.  
//E.dy*ay =  y1-y1^2/6   
//Value of E.dy*ay =   27/50   
//Work done in moving a point charge along shorter arc of circle in Joules, W = -24/25  = -0.96 Joules