hofmannmartin / sphericalharmonicexpansions.jl Goto Github PK
View Code? Open in Web Editor NEWA Julia package to handle spherical harmonic functions
License: Other
A Julia package to handle spherical harmonic functions
License: Other
julia> Pkg.add("SphericalHarmonics")
ERROR: unknown package SphericalHarmonics
macro expansion at .\pkg\entry.jl:53 [inlined]
(::Base.Pkg.Entry.##1#3{String,Base.Pkg.Types.VersionSet})() at .\task.jl:335
Stacktrace:
[1] sync_end() at .\task.jl:287
[2] macro expansion at .\task.jl:303 [inlined]
[3] add(::String, ::Base.Pkg.Types.VersionSet) at .\pkg\entry.jl:51
[4] (::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#add,Tuple{String}})() at .\pkg\dir.jl:36
[5] cd(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#add,Tuple{String}}, ::String) at .\file.jl:59
[6] #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{String,N} where N) at .\pkg\dir.jl:36
[7] add(::String) at .\pkg\pkg.jl:117
Is it possible to calculate the acceleration due to the Earth spherical harmonics (J2
,J22
,..)?
As I know, the acceleration is the derivative from the Earth gravity potential.
I noticed that the Polyvar expression of Spherical Harmonics generated from rlylm
uses float numbers as coefficients.
Is there possible to add support for using rational number as expression coeffient to get accurate symbolic result?
3//5 # Rational
0.6 # Float64
Describe the bug
The @fastfunc macro can not be used inside the scope of a function.
The environment (please complete the following information):
To Reproduce
Steps to reproduce the behavior:
function useFastFuncInsideFunction()
polynomial = 3*z^2 + 2*y*x
g = @fastfunc polynomial
t1,t2,t3 = randn(3)
return g(t1,t2,t3)
end
useFastFuncInsideFunction()
throws Error
Expression: g(t1, t2, t3)
MethodError: no method matching (::SphericalHarmonics.var"#34#35")(::Float64, ::Float64, ::Float64)
The applicable method may be too new: running in world age 27832, while current world is 27833.
Closest candidates are:
#34(::Any, ::Any, ::Any) at none:1 (method too new to be called from this world context.)
Stacktrace:
[1] (::var"#useInsideFunction1#4"{Float64,var"#f#3",Variable{:x},Variable{:y},Variable{:z}})() at /home/moeddel/.julia/dev/SphericalHarmonics/test/fastfunc.jl:14
[2] top-level scope at /home/moeddel/.julia/dev/SphericalHarmonics/test/fastfunc.jl:17
[3] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Test/src/Test.jl:1115
[4] top-level scope at /home/moeddel/.julia/dev/SphericalHarmonics/test/fastfunc.jl:2
Expected behavior
The method should work within function scope.
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
Thank you for developing such a useful library.
Currently, I am using @fastfunc to calculate spherical harmonics.
ylm(0, 0, x, y, z)
and pass it to @fastfunc
, it is converted to a function whose args are (::Any)
like below.ylm(2,1, x, y, z)
and do the same, it will be a function whose args are (::Any, ::Any, ::Any)
.However, I believe that in both cases it would be better to be able to call functions with the same # of args,
say, pp(1.0, 1.0, 1.0)
.
What do you think about this?
Thanks.
Hi Martin,
I have worked with a previous version of your package and extended it a bit (different norms possible, arbitrary datatypes) during my PhD thesis. It's now in a separate repository: CartesianSphericalHarmonics.jl, as I had no need for the expansion and evaluation of the polynomials. It's not documented nor tested properly. I'd be happy to make this eventually merge with your package or to make the two packages built on each other, any thoughts on this?
Cheers,
Felix
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.