-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCAL_A2.m
More file actions
27 lines (23 loc) · 1.55 KB
/
CAL_A2.m
File metadata and controls
27 lines (23 loc) · 1.55 KB
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
function A2= CAL_A2( x0, y0, z0, x, y, z, a, b, c, u0,L0, M0, N0)
d1=x0-a/2-x;
d2=x0+a/2-x;
e1=y0-b/2-y;
e2=y0+b/2-y;
f1=z0-c/2-z;
f2=z0+c/2-z;
R222=( d2^2+e2^2+f2^2 )^(1/2);
R221=( d2^2+e2^2+f1^2 )^(1/2);
R212=( d2^2+e1^2+f2^2 )^(1/2);
R211=( d2^2+e1^2+f1^2 )^(1/2);
R122=( d1^2+e2^2+f2^2 )^(1/2);
R121=( d1^2+e2^2+f1^2 )^(1/2);
R112=( d1^2+e1^2+f2^2 )^(1/2);
R111=( d1^2+e1^2+f1^2 )^(1/2);
A2=-u0/4/pi*( (2*M0*( e2^2-R222*(d2+f2+R222) )/( R222*(d2+f2+R222)^2+e2^2*R222 )+L0*e2/R222/(f2+R222)+N0*e2/R222/(d2+R222) )...
-(2*M0*( e2^2-R221*(d2+f1+R221) )/( R221*(d2+f1+R221)^2+e2^2*R221 )+L0*e2/R221/(f1+R221)+N0*e2/R221/(d2+R221) )...
-(2*M0*( e1^2-R212*(d2+f2+R212) )/( R212*(d2+f2+R212)^2+e1^2*R212 )+L0*e1/R212/(f2+R212)+N0*e1/R212/(d2+R212) )...
+(2*M0*( e1^2-R211*(d2+f1+R211) )/( R211*(d2+f1+R211)^2+e1^2*R211 )+L0*e1/R211/(f1+R211)+N0*e1/R211/(d2+R211) )...
-(2*M0*( e2^2-R122*(d1+f2+R122) )/( R122*(d1+f2+R122)^2+e2^2*R122 )+L0*e2/R122/(f2+R122)+N0*e2/R122/(d1+R122) )...
+(2*M0*( e2^2-R121*(d1+f1+R121) )/( R121*(d1+f1+R121)^2+e2^2*R121 )+L0*e2/R121/(f1+R121)+N0*e2/R121/(d1+R121) )...
+(2*M0*( e1^2-R112*(d1+f2+R112) )/( R112*(d1+f2+R112)^2+e1^2*R112 )+L0*e1/R112/(f2+R112)+N0*e1/R112/(d1+R112) )...
-(2*M0*( e1^2-R111*(d1+f1+R111) )/( R111*(d1+f1+R111)^2+e1^2*R111 )+L0*e1/R111/(f1+R111)+N0*e1/R111/(d1+R111) ) );