1out "sfellip.rlg";
2
3load_package specfn;
4
5% test of facilities sfellip.red and sfellipi.red
6% Author: Alan Barnes   (Alan.Barnes45678@gmail.com) July 2019
7% Modified August 2019. Tests of theta functions moved to sftheta.tst -- 2021
8
9% periodic properties and quarter period shifts
10
11jacobisn(u+2*elliptick(k),k);
12jacobisn(u+2*i*elliptick!'(k),k);
13jacobisn(u+elliptick(k),k);
14jacobisn(u+i*elliptick!'(k),k);
15
16jacobizeta(u+2*elliptick(k),k);
17jacobie(u+14*elliptick(k),k);
18
19% derivatives and consistency checks
20
21df(jacobicn(u,k),u);
22df(jacobisn(u,k)^2+jacobicn(u,k)^2,u);
23
24df(jacobidn(u,k),k);
25df(k^2*jacobisn(u,k)^2+jacobidn(u,k)^2,k);
26% vanishes by Pythagorean identity for dn and cn
27
28df(jacobie(u,k),u);
29df(jacobie(u,k),k);
30
31df(elliptick(k),k);
32df(elliptice(k),k);
33
34% check a well-known identity
35df(elliptice(k)*elliptick!'(k)+elliptice!'(k)*elliptick(k)-elliptick(k)*elliptick!'(k),k);
36
37df(jacobizeta(u,k),u);
38df(elliptice(u,k),u);
39df(elliptice(u,k),k);
40
41% quasi-periodicity
42elliptice(u+pi/2,k);
43ellipticf(u-5*pi/2,k);
44elliptice(u+11*pi/3,k);
45
46% numerical evaluation and consistency checks
47on rounded;
48
49% complete elliptic integrals of 1st kind
50K := elliptick(0.4);
51K!' := elliptick!'(0.4);
52
53% complete elliptic integrals of 2nd kind
54EE := elliptice(0.4);
55EE!' := elliptice!'(0.4);
56
57% Jacobi Zeta function
58u := 0.6;
59Z:= jacobizeta(u, 0.4);
60E2 := jacobie(u, 0.4);
61
62% checks
63EE - jacobie(K, 0.4);
64
65EE * K!' + EE!' * K - K * K!' - pi/2;
66
67Z - E2 + EE*u/K;
68
69% Jacobi functions
70m := 0.8;
71
72s := jacobisn(u,m);
73c :=  jacobicn(u,m);
74d :=  jacobidn(u,m);
75s^2+c^2;
76d^2+m^2*s^2;
77
78
79u := 1/2+i/3;
80s := jacobisn(u,m);
81c :=  jacobicn(u,m);
82d :=  jacobidn(u,m);
83s^2+c^2;
84d^2+m^2*s^2;
85
86% Nome and related utilities
87a:=nome(0.4);
88nome2mod(a);
89nome(0.99);
90
91elliptick(0.4);
92nome2!K(a);
93elliptick!'(0.4);
94nome2!K!'(a);
95
96shut "sfellip.rlg";
97
98;end;
99
100