moiseevigor / elliptic

Elliptic functions for Matlab and Octave
http://moiseevigor.github.io/elliptic
15 stars 5 forks source link

Enhancement: complete elliptic integral of the third kind #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When computing the complete third elliptic integral, the algorithm listed here 
will be much more efficient: http://dlmf.nist.gov/19.8

Original issue reported on code.google.com by wsp...@gmail.com on 9 Nov 2010 at 4:59

GoogleCodeExporter commented 9 years ago
Here's some code to do this; it only works for the other argument being less 
than one; a small addition required for argument greater than unity as well. 
I'd still like to help with this code, sorry I haven't actually managed to do 
anything yet. Very busy!

(At least this code is vectorised properly this time.)

Original comment by wsp...@gmail.com on 22 Nov 2010 at 12:34

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you Will for the submission! I've added you to the committers group at 
elliptic home.

Original comment by moiseev....@gmail.com on 20 Dec 2010 at 7:00

GoogleCodeExporter commented 9 years ago
close by wspr81 with ELLIPTIC123

http://code.google.com/p/elliptic/wiki/elliptic#ELLIPTIC123:_Complete_and_Incomp
lete_Elliptic_Integrals_of_the_F

Original comment by moiseev....@gmail.com on 1 Nov 2011 at 6:44

GoogleCodeExporter commented 9 years ago
Refs on Complete Elliptic Integrals with Complex Modulus and Convergence of the 
Arithmetic-Geometric Mean Procedure for the Complex Variables 

http://www.springerlink.com/content/t082167467134761/
http://www.springerlink.com/content/l6j5066247p18600/

Original comment by moiseev....@gmail.com on 1 Nov 2011 at 6:51

GoogleCodeExporter commented 9 years ago
There is one trick. We can rely on the Matlab because in the approximations 
we're use the usual trigonometric functions and matlab posses the complex 
version of those. So we could put in remark the error in the file 
elliptic12:line:51 (se the diff below)

http://code.google.com/p/elliptic/source/browse/trunk/elliptic12.m

igor@igor-laptop:~/Work/elliptic$ svn diff
Index: elliptic12.m
===================================================================
--- elliptic12.m    (revision 113)
+++ elliptic12.m    (working copy)
@@ -48,7 +48,7 @@
 if nargin<2, error('Not enough input arguments.'); end

 if ~isreal(u) || ~isreal(m)
-    error('Input arguments must be real. Use ELLIPTIC12i for complex 
arguments.');
+    %error('Input arguments must be real. Use ELLIPTIC12i for complex 
arguments.');
 end

 if length(m)==1, m = m(ones(size(u))); end

Save it and GO! It produces the result which coincide with Mathematica

Mathematica:
In[6]:= EllipticF[4 Pi/3, 0.5 + 0.5 I]
Out[6]= 4.50523 + 0.754163 I

Matlab:
>> elliptic12(4*pi/3, 0.5+0.5*sqrt(-1))
ans =
   4.5052 + 0.7542i

ATTENTION! For abs(m)>1 elliptc12 does not produce the same result as 
mathematica.

Original comment by moiseev....@gmail.com on 1 Nov 2011 at 7:29