在Julia中,特殊功能也可以輕鬆處理。 您可以設置Julia,將其設置為Pkg模組,設置Pkg.add("specialFunctions") ,處理特殊功能。
例如Bessel函數
=======程式=======
import Pkg
Pkg.add("SpecialFunctions")
using SpecialFunctions
z = 0.2
a = besselj0(z) #ν=0 Bessel函數
println(a)
z = 0.1
for ν=0:10 #J_{ν}(z=0.1)的値
Jν = besselj(ν,z)
println("J_{$ν}(0.1) = $Jν")
end
輸出結果
Resolving package versions...
Updating `~/.julia/Project.toml`
[no changes]
Updating `~/.julia/Manifest.toml`
[no changes]
0.9900249722395764
J_{0}(0.1) = 0.99750156206604
J_{1}(0.1) = 0.049937526036242
J_{2}(0.1) = 0.001248958658799919
J_{3}(0.1) = 2.0820315754756265e-5
J_{4}(0.1) = 2.6028648545684036e-7
J_{5}(0.1) = 2.6030817909644413e-9
J_{6}(0.1) = 2.1693639603760032e-11
J_{7}(0.1) = 1.5496148676202282e-13
J_{8}(0.1) = 9.685429231594653e-16
J_{9}(0.1) = 5.380943491602329e-18
J_{10}(0.1) = 2.6905328954342175e-20
沒有留言:
張貼留言