From: Liam Healy <Liam.Healy@nrl.navy.mil>
To: gsl-discuss@sources.redhat.com
Subject: Elliptic integral and function
Date: Sat, 08 Dec 2001 10:51:00 -0000 [thread overview]
Message-ID: <15390.8891.712402.651008@shadow.nrl.navy.mil> (raw)
Message-ID: <20011208105100.TfjXfPoGi4ccoEOYtLyIbk8vX4xTBlPsWEI-fMJpFSE@z> (raw)
[-- Attachment #1: message body text --]
[-- Type: text/plain, Size: 524 bytes --]
My understanding is that the Jacobi elliptic function is the inverse
of the elliptic function. That is,
sn(K(k),k) = 1
cn(K(k),k) = 0
dn(K(k),k) = sqrt(1-k^2)
see http://mathworld.wolfram.com/JacobiEllipticFunctions.html
but when I try this I get e.g.
gsltest 0.5
k= 0.50000000000000 K(k)= 1.68575035481260
sn= 0.99289175131682 cn= 0.11902088122262 dn= 0.71209759519570
all three of these seem wrong. My driver program is attached.
What is wrong here? Thank you for any light you can shed on this.
Liam
[-- Attachment #2: C source code to drive elliptic integrals and functions. --]
[-- Type: text/plain, Size: 962 bytes --]
/* ******************************************************** */
/* file: gsltest.c */
/* description: Test the GSL */
/* date: Mon Dec 17 2001 - 10:09 */
/* author: Liam Healy <Liam.Healy@nrl.navy.mil> */
/* modified: Mon Dec 17 2001 - 11:45 */
/* ******************************************************** */
/* Compile with:
gcc gsltest.c -lgslcblas -lgsl -o gsltest
Run:
source ~/bin/libpath /usr/local/lib/
gsltest
*/
#include <stdio.h>
#include <stdlib.h>
#include <gsl/gsl_sf_ellint.h>
#include <gsl/gsl_sf_elljac.h>
int main(int argc, char *argv[]) {
double k, kk;
double sn, cn, dn;
int ret;
k = atof(argv[1]);
kk = gsl_sf_ellint_Kcomp (k, GSL_PREC_DOUBLE);
ret = gsl_sf_elljac_e (kk, k, &sn, &cn, &dn);
printf("k=%18.14f K(k)=%18.14f\n",k,kk);
printf("sn=%18.14f cn=%18.14f dn=%18.14f\n",sn,cn,dn);
}
next reply other threads:[~2001-12-17 16:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-19 13:20 Liam Healy [this message]
2001-12-08 10:51 ` Liam Healy
2001-12-17 8:52 ` Liam Healy
2001-12-19 13:20 ` Brian Gough
2001-12-12 16:16 ` Brian Gough
2001-12-19 6:18 ` Brian Gough
2001-12-19 13:20 ` Liam Healy
2001-12-13 1:01 ` Liam Healy
2001-12-19 12:12 ` Liam Healy
2001-12-19 13:20 ` Liam Healy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15390.8891.712402.651008@shadow.nrl.navy.mil \
--to=liam.healy@nrl.navy.mil \
--cc=gsl-discuss@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).