~ubuntu-branches/ubuntu/karmic/maxima/karmic

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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
@menu
* Introduction to Elliptic Functions and Integrals::
* Definitions for Elliptic Functions::
* Definitions for Elliptic Integrals::
@end menu



@node Introduction to Elliptic Functions and Integrals, Definitions for Elliptic Functions, , top
@comment  node-name,  next,  previous,  up

@section Introduction to Elliptic Functions and Integrals

Maxima includes support for Jacobian elliptic functions and for
complete and incomplete elliptic integrals.  This includes symbolic
manipulation of these functions and numerical evaluation as well.
Definitions of these functions and many of their properties can by
found in Abramowitz and Stegun, Chapter 16--17.  As much as possible,
we use the definitions and relationships given there.

In particular, all elliptic functions and integrals use the parameter
@math{m} instead of the modulus @math{k} or the modular angle
@math{\alpha}.  This is one area where we differ from Abramowitz and
Stegun who use the modular angle for the elliptic functions.  The
following relationships are true:
@ifinfo
@math{m = k^2} and @math{k = \sin(\alpha)}
@end ifinfo
@tex
$$m = k^2$$ and $$k = \sin\alpha $$
@end tex

The elliptic functions and integrals are primarily intended to support
symbolic computation.  Therefore, most of derivatives of the functions
and integrals are known.  However, if floating-point values are given,
a floating-point result is returned.

Support for most of the other properties of elliptic functions and
integrals other than derivatives has not yet been written.

Some examples of elliptic functions:
@example
(%i1) jacobi_sn(u,m);
(%o1)                            JACOBI_SN(u, m)
(%i2) jacobi_sn(u,1);
(%o2)                                TANH(u)
(%i3) jacobi_sn(u,0);
(%o3)                                SIN(u)
(%i4) diff(jacobi_sn(u,m),u);
(%o4)                    JACOBI_CN(u, m) JACOBI_DN(u, m)
(%i5) diff(jacobi_sn(u,m),m);
(%o5) JACOBI_CN(u, m) JACOBI_DN(u, m)

      ELLIPTIC_E(ASIN(JACOBI_SN(u, m)), m)
 (u - ------------------------------------)/(2 m)
                     1 - m

            2
   JACOBI_CN (u, m) JACOBI_SN(u, m)
 + --------------------------------
              2 (1 - m)
@end example

Some examples of elliptic integrals:
@example
(%i1) elliptic_f(phi,m);
(%o1)                          ELLIPTIC_F(PHI, m)
(%i2) elliptic_f(phi,0);
(%o2)                                  PHI
(%i3) elliptic_f(phi,1);
                                      PHI   %PI
(%o3)                          LOG(TAN(--- + ---))
                                       2     4
(%i4) elliptic_e(phi,1);
(%o4)                               SIN(PHI)
(%i5) elliptic_e(phi,0);
(%o5)                                  PHI
(%i6) elliptic_kc(1/2);
                                            1
(%o6)                            ELLIPTIC_KC(-)
                                            2
(%i7) makegamma(%);
                                        2 1
                                   GAMMA (-)
                                          4
(%o7)                              -----------
                                  4 SQRT(%PI)
(%i8) diff(elliptic_f(phi,m),phi);
                                       1
(%o8)                         ---------------------
                                           2
                             SQRT(1 - m SIN (PHI))
(%i9) diff(elliptic_f(phi,m),m);
      ELLIPTIC_E(PHI, m) - (1 - m) ELLIPTIC_F(PHI, m)
(%o9) (-----------------------------------------------
                             m

                            COS(PHI) SIN(PHI)
                        - ---------------------)/(2 (1 - m))
                                        2
                          SQRT(1 - m SIN (PHI))
@end example

Support for elliptic functions and integrals was written by Raymond
Toy.  It is placed under the terms of the General Public License (GPL)
that governs the distribution of Maxima.

@node Definitions for Elliptic Functions, Definitions for Elliptic Integrals, Introduction to Elliptic Functions and Integrals, top
@comment  node-name,  next,  previous,  up

@section Definitions for Elliptic Functions

@defun JACOBI_SN (u, m)
The Jacobian elliptic function @math{sn(u,m)}.
@end defun

@defun JACOBI_CN (u, m)
The Jacobian elliptic function @math{cn(u,m)}.
@end defun

@defun JACOBI_DN (u, m)
The Jacobian elliptic function @math{dn(u,m)}.
@end defun

@defun JACOBI_NS (u, m)
The Jacobian elliptic function @math{ns(u,m) = 1/sn(u,m)}.
@end defun

@defun JACOBI_SC (u, m)
The Jacobian elliptic function @math{sc(u,m) = sn(u,m)/cn(u,m)}.
@end defun

@defun JACOBI_SD (u, m)
The Jacobian elliptic function @math{sd(u,m) = sn(u,m)/dn(u,m)}.
@end defun

@defun JACOBI_NC (u, m)
The Jacobian elliptic function @math{nc(u,m) = 1/cn(u,m)}.
@end defun

@defun JACOBI_CS (u, m)
The Jacobian elliptic function @math{cs(u,m) = cn(u,m)/sn(u,m)}.
@end defun

@defun JACOBI_CD (u, m)
The Jacobian elliptic function @math{cd(u,m) = cn(u,m)/dn(u,m)}.
@end defun

@defun JACOBI_ND (u, m)
The Jacobian elliptic function @math{nc(u,m) = 1/cn(u,m)}.
@end defun

@defun JACOBI_DS (u, m)
The Jacobian elliptic function @math{ds(u,m) = dn(u,m)/sn(u,m)}.
@end defun

@defun JACOBI_DC (u, m)
The Jacobian elliptic function @math{dc(u,m) = dn(u,m)/cn(u,m)}.
@end defun

@defun INVERSE_JACOBI_SN (u, m)
The inverse of the Jacobian elliptic function @math{sn(u,m)}.
@end defun

@defun INVERSE_JACOBI_CN (u, m)
The inverse of the Jacobian elliptic function @math{cn(u,m)}.
@end defun

@defun INVERSE_JACOBI_DN (u, m)
The inverse of the Jacobian elliptic function @math{dn(u,m)}.
@end defun

@defun INVERSE_JACOBI_NS (u, m)
The inverse of the Jacobian elliptic function @math{ns(u,m)}.
@end defun

@defun INVERSE_JACOBI_SC (u, m)
The inverse of the Jacobian elliptic function @math{sc(u,m)}.
@end defun

@defun INVERSE_JACOBI_SD (u, m)
The inverse of the Jacobian elliptic function @math{sd(u,m)}.
@end defun

@defun INVERSE_JACOBI_NC (u, m)
The inverse of the Jacobian elliptic function @math{nc(u,m)}.
@end defun

@defun INVERSE_JACOBI_CS (u, m)
The inverse of the Jacobian elliptic function @math{cs(u,m)}.
@end defun

@defun INVERSE_JACOBI_CD (u, m)
The inverse of the Jacobian elliptic function @math{cd(u,m)}.
@end defun

@defun INVERSE_JACOBI_ND (u, m)
The inverse of the Jacobian elliptic function @math{nc(u,m)}.
@end defun

@defun INVERSE_JACOBI_DS (u, m)
The inverse of the Jacobian elliptic function @math{ds(u,m)}.
@end defun

@defun INVERSE_JACOBI_DC (u, m)
The inverse of the Jacobian elliptic function @math{dc(u,m)}.
@end defun


@node Definitions for Elliptic Integrals, , Definitions for Elliptic Functions, top
@comment  node-name,  next,  previous,  up

@section Definitions for Elliptic Integrals

@anchor{ELLIPTIC_F}
@defun ELLIPTIC_F (phi, m)
The incomplete elliptic integral of the first kind, defined as

@ifinfo
@math{integrate(1/sqrt(1 - m*sin(x)^2), x, 0, phi)}
@end ifinfo

@tex
$$\int_0^\phi {{d\theta}\over{\sqrt{1 - m\sin^2\theta}}}$$
@end tex

See also @ref{ELLIPTIC_E}, @ref{ELLIPTIC_KC}
@end defun

@anchor{ELLIPTIC_E}
@defun ELLIPTIC_E (phi, m)
The incomplete elliptic integral of the second kind, defined as
@ifinfo
@math{ELLIPTIC_E(u, m) = integrate(sqrt(1 - m*sin(x)^2), x, 0, phi)}
@end ifinfo
See also @ref{ELLIPTIC_E}, @ref{ELLIPTIC_EC}
@end defun

@anchor{ELLIPTIC_EU}
@defun ELLIPTIC_EU (u, m)
The incomplete elliptic integral of the second kind, defined as
@ifinfo
@math{integrate(dn(v,m)^2,v,0,u) = integrate(sqrt(1-m*t^2)/sqrt(1-t^2), t, 0, tau)}

where @math{tau = sn(u,m)} 
@end ifinfo
@tex
$$\int_0^u {\rm dn}(v, m) dv  = \int_0^\tau \sqrt{{1-m t^2}\over{1-t^2}} dt$$

where $\tau = {\rm sn}(u, m)$
@end tex


This is related to @math{ELLIPTIC_E} by
@ifinfo
@math{ELLIPTIC_EU(u, m) = ELLIPTIC_E(asin(sn(u,m)),m)}
@end ifinfo
@tex
$$E(u,m) = E(\phi, m)$$

where $\phi = \sin^{-1} {\rm sn}(u, m),m)$
@end tex
See also @ref{ELLIPTIC_E}.
@end defun

@defun ELLIPTIC_PI (n, phi, m)
The incomplete elliptic integral of the third kind, defined as
@ifinfo
@math{integrate(1/(1-n*sin(x)^2)/sqrt(1 - m*sin(x)^2), x, 0, phi)}
@end ifinfo
@tex
$$\int_0^\phi {{d\theta}\over{(1-n\sin^2 \theta)\sqrt{1 - m\sin^2\theta}}}$$
@end tex

Only the derivative with respect to @math{phi} is known by MAXIMA.
@end defun

@anchor{ELLIPTIC_KC}
@defun ELLIPTIC_KC (m)
The complete elliptic integral of the first kind, defined as

@ifinfo
@math{integrate(1/sqrt(1 - m*sin(x)^2), x, 0, %pi/2)}
@end ifinfo

@tex
$$\int_0^{{\pi}\over{2}} {{d\theta}\over{\sqrt{1 - m\sin^2\theta}}}$$
@end tex
For certain values of @math{m}, the value of the integral is known in
terms of @math{Gamma} functions.  Use MAKEGAMMA to evaluate them.
@end defun

@anchor{ELLIPTIC_EC}
@defun ELLIPTIC_EC (m)
The complete elliptic integral of the second kind, defined as

@ifinfo
@math{integrate(sqrt(1 - m*sin(x)^2), x, 0, %pi/2)}
@end ifinfo

@tex
$$\int_0^{{\pi}\over{2}} \sqrt{1 - m\sin^2\theta} d\theta$$
@end tex
For certain values of @math{m}, the value of the integral is known in
terms of @math{Gamma} functions.  Use MAKEGAMMA to evaluate them.
@end defun