Git Product home page Git Product logo

elliptic.jl's Introduction

Elliptic Special Functions for Julia

Build Status

This julia package implements elliptic integrals and (in the Jacobi sub-module) the Jacobi elliptic functions.

Elliptic Integrals

Function Definition
F(phi, m) Incomplete elliptic integral of the first kind, F(φ | m)
K(m) Complete elliptic integral of the first kind, the quarter period, F(π/2 | m)
E(phi, m) Incomplete elliptic integral of the second kind, E(φ | m)
E(m) Complete elliptic integral of the second kind, E(π/2 | m)
Pi(n, phi, m)
Π(n, phi, m)
Incomplete elliptic integral of the third kind, Π(n; φ | m)

Where the parameter m = k^2 = sin(α)^2, α is the modular angle, k is the modulus, and

F(\phi|m) = \int_0^\phi d\theta (1 - m\sin^2\theta)^{-1/2}

E(\phi|m) = \int_0^\phi d\theta (1 - m\sin^2\theta)^{1/2}

\Pi(n;\varphi|m) = \int_0^\varphi d\theta, (1-n\sin^2\theta)^{-1}(1 - m\sin^2\theta)^{-1/2}

julia> import Elliptic

julia> Elliptic.K(0.5)
1.854074677301372

Jacobi Elliptic Functions

Function Definition
am(u, m) Solution to u = F(am(u | m) | m)
sn(u, m) sn(u | m) = sin(am(u | m))
cn(u, m) cn(u | m) = cos(am(u | m))
dn(u, m) dn(u | m) = sqrt(1 - m sn(u | m)^2)
sd(u, m) sd(u | m) = sn(u | m) / dn(u | m)
cd(u, m) cd(u | m) = cn(u | m) / dn(u | m)
nd(u, m) nd(u | m) = 1 / dn(u | m)
dc(u, m) dc(u | m) = 1 / cd(u | n)
nc(u, m) nc(u | m) = 1 / cn(u | m)
sc(u, m) sc(u | m) = sn(u | m) / cn(u | m)
ns(u, m) ns(u | m) = 1 / sn(u | m)
ds(u, m) ds(u | m) = 1 / sd(u | m)
cs(u, m) cs(u | m) = 1 / sc(u | m)
julia> import Elliptic.Jacobi

julia> Jacobi.sn(2, 9)
-0.15028246569211734

Matlab Compatibility

Function Definition
ellipj(u, m) returns (sn(u,m), cn(u,m), dn(u,m))
ellipke(m) returns (K(m), E(m))

For convenience, the matlab compatible ellipj and ellipke routines are also provided. ellipj(u,m) is equivalent to sn(u,m), cn(u,m), dn(u,m), but faster if you want all three. Likewise, ellipke(m) is equivalent to K(m), E(m), but faster if you want both.

julia> import Elliptic

julia> k,e = Elliptic.ellipke(0.5)
(1.854074677301372,1.3506438810476757)

julia> sn,cn,dn = Elliptic.ellipj(0.672, 0.36)
(0.6095196917919022,0.792770928653356,0.9307281387786907)

Installation

julia> Pkg.add("Elliptic")

elliptic.jl's People

Contributors

nolta avatar hamzaelsaawy avatar jefffessler avatar juliatagbot avatar mauro3 avatar femtocleaner[bot] avatar giovact avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.