-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathclifford_potential.dem
66 lines (46 loc) · 1.58 KB
/
clifford_potential.dem
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
/* Copyright (C) 2016 Dimiter Prodanov
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* Potential problems demo
*/
if get('clifford,'version)=false then load("clifford")$
if get('cliffordan,'version)=false then load("cliffordan")$
"Clifford implements Clifford algebra for Maxima."$
"Potential problems in G(3)"$
clifford(e,3);
"initialize variables"$
r:cvect([x,y,z]);
"Green's function"$
G:r/sqrt(-cnorm(r))^3;
"differentiation of Green's function"$
mvectdiff(G,r);
"Potential function"$
P:-1/sqrt(-cnorm(r));
"differentiation of potential function"$
D1:mvectdiff(P,r);
"checking for equality"$
equal(GG_c, D2),pred;
mvectdiff(P,r,2);
"define cyclindrical coordinates"$
declare( [rho, phi], scalar);
cyl_eq:[x=rho*cos(phi), y=rho*sin(phi)];
"coordinate substitution"$
rc:coordsubst(r, cyl_eq);
GG_c:coordsubst(G, cyl_eq),factor;
V:coordsubst(P,cyl_eq);
"differentiation of Green's function"$
mvectdiff(GG_c,rc);
"differentiation of potential function"$
D2:mvectdiff(V,rc);
"checking for equality"$
equal(GG_c, D2),pred;
/* End of demo -- comment line needed by MAXIMA to resume demo menu */