matlab erf erfi,Faddeeva包装:复杂的错误功能

Faddeeva Package: complex error functions

C++ source code for compiled plugins (MEX files) to compute various error functions for complex arguments:

** Faddeeva_erf(z) -- the error function

** Faddeeva_erfc(z) = 1 - erf(z) -- complementary error function

** Faddeeva_erfi(z) = -i erf(iz) -- imaginary error function

** Faddeeva_erfcx(z) = exp(z^2) erfc(z) -- scaled complementary error function

** Faddeeva_w(z) = exp(-z^2) erfc(-iz) -- Faddeeva function

** Faddeeva_Dawson(z) = 0.5 sqrt(pi) exp(-z^2) erfi(z) -- Dawson function

From e.g. the Faddeeva function, one can also obtain the Voigt functions and other related functions.

Assuming you have a C++ compiler (and have configured it in MATLAB with mex -setup), compile by running the included Faddeeva_build.m script in MATLAB:

Faddeeva_build

All of the functions have usage of the form:

w = Faddeeva_w(z)

or optionally Faddeeva_w(z, relerr), where relerr is a desired relative error (default: machine precision). z may be an array or matrix of complex or real numbers.

This code may also be downloaded from

http://ab-initio.mit.edu/Faddeeva

along with documentation and other versions. As described in the source code, this implementation uses a combination of algorithms for the Faddeeva function: a continued-fraction expansion for large |z| [similar to G. P. M. Poppe and C. M. J. Wijers, "More efficient computation of the complex error function," ACM Trans. Math. Soft. 16 (1), pp. 38–46 (1990)], and a completely different algorithm for smaller |z| [Mofreh R. Zaghloul and Ahmed N. Ali, "Algorithm 916: Computing the Faddeyeva and Voigt Functions," ACM Trans. Math. Soft. 38 (2), 15 (2011).]. Given the Faddeeva function, we can then compute the other error functions, although we must switch to Taylor expansions and use other tricks in certain regions of the complex plane to avoid cancellation errors or other floating-point problems.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值