nolta / elliptic.jl Goto Github PK
View Code? Open in Web Editor NEWElliptic integral and Jacobi elliptic special functions
License: MIT License
Elliptic integral and Jacobi elliptic special functions
License: MIT License
Since Jacobi.cd
conflicts with Base.cd
, it cannot be imported directly into scope:
julia> using Elliptic
julia> using Elliptic.Jacobi
julia> sd(0,0)
0.0
julia> cd(0,0)
WARNING: both Jacobi and Base export "cd"; uses of it in module Main must be qualified
ERROR: UndefVarError: cd not defined
Stacktrace:
[1] top-level scope at none:0
julia> Jacobi.cd(0,0)
1.0
One solution would be to import Base.cd
and extend it, but since they provide unrelated functionality, I am not sure people's appetites for that
From @TSGut (CC @MikaelSlevinsky):
julia> α = 4.453667231591123
4.453667231591123
julia> K = Elliptic.K(1-1/α^2)
2.9043516240612575
julia> K2f1 = convert(eltype(α),π)/2*HypergeometricFunctions._₂F₁(one(eltype(α))/2,one(eltype(α))/2,1,1-1/α^2)
2.904351624061259
julia> @test K ≈ K2f1
Test Passed
Running
julia> Elliptic.E(NaN)
just hangs (well, at least 10 seconds). Same goes for K
, maybe others?
Changing symbol()
to Symbol()
last October 20 was sufficient to keep Julia 0.6 happy, but no METADATA.jl updates have been tagged to reflect the change.
PackageEvaluator.jl is a script that runs nightly.
It attempts to load all Julia packages and run their tests (if available) on both the stable
version of Julia (0.3) and the nightly build of the unstable version (0.4).
The results of this script are used to generate a package listing
enhanced with testing results. This service also benefits package developers by notifying them if
their package breaks for some reason (caused by e.g. changes in Julia, changes in dependencies,
or broken binary dependencies.)
Currently PackageEvaluator attempts to find your test scripts using a heuristic, preferring the
standarized test/runtests.jl
whenever present. Using test/runtests.jl
allows people to test
your package using simply Pkg.test("Elliptic")
, with any testing-only dependencies being
installed by looking at test/REQUIRE
.
Your package doesn't appear to have a test/runtests.jl
file. PackageEvaluator is going to move
away from auto-detecting tests and will instead only test packages with a test/runtests.jl
file. This change will take place in about a month.
You can:
If you'd like help or more information, please just reply to this issue.
I have seen that the complete elliptic integrals were extended for negative range which is great. Can the non complete elliptic integral be extended as well?
In page 593, in the book by Abramowitz and Stegun equations 17.4.15 and on give the formulas.
I did not see there a formula for the Jacobi amplitude, but it can be derived from the relations 17.4.15 and on.
Elliptic.K(x)
currently raises a DomainError
for negative x
.
However, K(x) can be calculated for negative arguments with the existing routine using the identity given in Eq. (11) of this text.
Ideally, Elliptic.K(x)
would just check for negative x
and map it to a positive x
automatically.
Would be nice to have a catch-all SpecialFunctions package to put (ideally pure Julia) special functions in, maybe this package could be a start? Just noticed that https://github.com/nolta/SpecialFunctions.jl already exists, maybe this could be merged?
The file "Elliptic.jl" contains a lot of throw(DomainError())
statements in the checks of parameter m
. If m is outside the region [0.0,1.0], instead of producing DomainError exception, the code gives
MethodError: no method matching DomainError()
Closest candidates are:
DomainError(!Matched::Any) at boot.jl:258
DomainError(!Matched::Any, !Matched::Any) at boot.jl:259
I do not know what the situation was in earlier versions of Julia, but, apparently, the constructor of DomainError requires at least one argument to be passed now.
The issue is easily fixed by replacing all throw(DomainError())
statements with something like throw(DomainError(m, "Argument m ∉[0, 1]"))
.
I could make a pull request for this, however, I have a question about the status of extend domain to negative m #19. If that gets merged, the domain checks and error messages should be changed accordingly.
Is there a reason all the function parameters are strictly typed to Float64
? This causes issues when using auto-diff tools (which need a more general type: T<:Real
).
Hi! I was trying to use Elliptic.jl in order to evaluate K(k) to high accuracy using BigFloats, but noticed that if given a BigFloat as an input, Elliptic.K
returns a Float64
:
julia> using Elliptic
julia> Elliptic.K(big"0.512341234")
1.8646739600308775
@oxinabox explained to me that, by construction, Elliptic.jl functions explicitly cast all Reals down to Float64, and was wondering if the code may be adapted for other types such as BigFloat
, perhaps adapting the constants such as D1MACH1
with something like const D1MACH1 = realmin(T)
with T<:AbstractFloat
, etc., for these types?
It seems that F is only defined on the real line. It would be nice if it was also defined on the complex domain, i.e. if it could take a complex argument phi. Actually it would be nice to have complex version of all the elliptic integrals and functions.
Surprisingly, few libraries/CAS provide such a feature. I rely on maxima at the moment for this kind of computation but it is slow.
As far as I understand, the elliptic functions in this package are defined only for real values of the first argument u
.
At the same time, it is good to be able to calculate them across the whole complex plane (all in all, the defining property of elliptic functions as doubly periodic meromorphic functions is intimately linked with the complex plane).
As a consequence, I have the following question: are there any plans to add the support of complex arguments?
If not, could you advise some packages where such functionality is already implemented?
while loading /home/travis/.julia/v0.6/Elliptic/src/jacobi.jl, in expression starting on line 6
WARNING: `@vectorize_2arg` is deprecated in favor of compact broadcast syntax. Instead of `@vectorize_2arg`'ing function `f` and calling `f(arg1, arg2)`, call `f.(arg1,arg2)`.
Stacktrace:
[1] depwarn(::String, ::Symbol) at ./deprecated.jl:70
[2] @vectorize_2arg(::ANY, ::ANY) at ./deprecated.jl:330
[3] include_from_node1(::String) at ./loading.jl:569
[4] include(::String) at ./sysimg.jl:14
[5] include_from_node1(::String) at ./loading.jl:569
[6] include(::String) at ./sysimg.jl:14
[7] anonymous at ./<missing>:2
[8] eval(::Module, ::Any) at ./boot.jl:235
[9] process_options(::Base.JLOptions) at ./client.jl:286
[10] _start() at ./client.jl:371
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.