gpt4 book ai didi

math - 超几何函数

转载 作者:行者123 更新时间:2023-12-05 00:56:00 26 4
gpt4 key购买 nike

有谁知道在 Julia 中计算超几何函数的包?

我一直在使用GSL.jl它是 GNU 科学库的包装器,但 GSL 仅支持 0F0、0F1、1F1、2F0 和 2F1。我需要计算 3F2。

最佳答案

您可以使用 PyCall要使用的模块mpmath来自 Python(以前是 SymPy sympy.mpmath 的一部分):

# import mpmath module 
@pyimport mpmath as mpmath

x = mpmath.hyp3f2(1,2,3,4,5, 0.5)

# then you will need to convert this to a float
Float64(x)

出去:
1.189874754256423
mpmath 的文档可用的超几何函数在这里: http://docs.sympy.org/0.7.1/modules/mpmath/functions/hypergeometric.html

(如果你没有安装 mpmath,你可以从 shell 用 pip 安装它:)
pip install mpmath

关于math - 超几何函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37064401/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com