-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchargedist.mp
More file actions
118 lines (105 loc) · 3.04 KB
/
chargedist.mp
File metadata and controls
118 lines (105 loc) · 3.04 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
%
% MetaPost drawing of the classical electric charge distribution used when
% analyzing multipole expansion of the potential.
%
% Copyright (C) 2022, Fredrik Jonsson
%
u := 1mm;
picture dv;
dv := image(
draw (-3,-3)--(1,-3)--(1,1)--(-3,1)--(-3,-3);
draw (-3,1)--(-1,3)--(3,3)--(1,1);
draw (3,3)--(3,-1)--(1,-3);
draw (-3,-3)--(-1,-1)--(-1,3);
draw (-1,-1)--(3,-1);
);
beginfig(1);
pickup pencircle scaled 1pt;
label.ulft(btex Volym $\Omega$ etex,(-10u,18u));
%
% Draw the blob of the electric charge distribution.
%
path p;
pair qo,qa,qb,qc,qd,qe,qf;
qo := (0u,0u);
qa := (0u,14u);
qb := (20u,4u);
qc := (30u,-14u);
qd := (0u,-14u);
qe := (-20u,-4u);
qf := (-20u,10u);
p := qa..{dir 0}qb..qc..qd..qe..qf..qa..cycle;
fill p withcolor .95[black,white];
draw p;
% dotlabel.top(btex $$ etex,qo);
% dotlabel.top(btex $a$ etex,qa);
% dotlabel.top(btex $b$ etex,qb);
% dotlabel.top(btex $c$ etex,qc);
% dotlabel.top(btex $d$ etex,qd);
% dotlabel.top(btex $e$ etex,qe);
% dotlabel.top(btex $f$ etex,qf);
%
% Draw the x-axis
%
draw (1.4[qo,qb])--qb;
draw qb--(.8[qo,qe]) dashed evenly;
drawarrow (.8[qo,qe])--(1.6[qo,qe]);
label.ulft(btex $x$ etex,(1.6[qo,qe]));
%
% Draw the y-axis
%
draw (1.4[qo,qf])--qf;
draw qf--(.8[qo,qc]) dashed evenly;
drawarrow (.8[qo,qc])--(1.6[qo,qc]);
label.urt(btex $y$ etex,(1.6[qo,qc]));
%
% Draw the z-axis
%
draw (1.6[qo,qd])--qd;
draw qd--(0.8[qo,qa]) dashed evenly;
drawarrow (0.8[qo,qa])--(2.0[qo,qa]);
label.ulft(btex $z$ etex,(2.0[qo,qa]));
%
% Draw the volume element dV and the vector r' to its location.
%
pair qg;
qg := (22u,-6u);
drawarrow qo--qg;
draw dv scaled .7u shifted (qg);
label.rt(btex $dV'$ etex,qg+(2u,0u));
label.top(btex ${\bf x'}$ etex,.7[qo,qg]);
%
% Draw the vector r to the point of observation.
%
pair qh;
qh := (60u,60u);
drawarrow qo--qh;
label.ulft(btex ${\bf x}$ etex,.3[qo,qh]);
dotlabel.top(btex $\phi({\bf x},t),\ {\bf A}({\bf x},t)$ etex,qh);
%
% Draw the vector r-r' between the point of observation and source element.
%
drawarrow qg--qh;
label.rt(btex ${\bf x}-{\bf x}'$ etex,.3[qg,qh]);
%
% Indications of charge and current densities.
%
label.rt(btex $\rho({\bf x}',t')$, ${\bf J}_{\bf f}({\bf x}',t')$ etex,(2u,-12u));
label.rt(btex \vbox{
\hbox{Tiden det tar f{\"o}r potentialen (f{\"o}r det}
\hbox{elektromagnetiska f{\"a}ltet) att f{\"a}rdas}
\hbox{fr{\aa}n ${\bf x}'$ till ${\bf x}$ {\"a}r
$\Delta t = |{\bf x}-{\bf x}'|/c$}}
etex, (56u,0u));
draw (56u,0u){dir 160}..{dir 150}(44u,30u);
label.urt(btex Bidrag fr{\aa}n volymselementet $dV'$: etex,(56u,42u));
label.urt(btex $\displaystyle d\phi({\bf x},t)=
{{1}\over{4\pi\varepsilon_0}}
{{\rho({\bf x}',t-|{\bf x}-{\bf x}'|/c)}\over{|{\bf x}-{\bf x}'|}}dV'$
etex,(56u,32u));
label.urt(btex $\displaystyle d{\bf A}({\bf x},t)=
{{\mu_0}\over{4\pi}}
{{{\bf J}_{\rm f}({\bf x}',t-|{\bf x}-{\bf x}'|/c)}\over{|{\bf x}-{\bf x}'|}}dV'$
etex,(56u,20u));
endfig;
end