反正切线1D#
- class astropy.modeling.functional_models.ArcTangent1D(*args, meta=None, name=None, **kwargs)[源代码]#
基类:
_InverseTrigonometric1D
一维ArcTanGent模型仅返回-pi/2和pi/2之间的值。
- 参数:
- 其他参数:
- fixed :
dict
,可选Python:Dict,可选 字典
{{parameter_name: boolean}}
在拟合过程中不能改变的参数。True表示参数保持不变。或者fixed
可以使用参数的属性。- tied :
dict
,可选Python:Dict,可选 字典
{{parameter_name: callable}}
链接到其他参数的参数。字典值是提供链接关系的可调用项。或者tied
可以使用参数的属性。- bounds :
dict
,可选Python:Dict,可选 字典
{{parameter_name: value}}
参数的上下界。键是参数名。值是一个长度为2的列表或元组,为参数提供所需的范围。或者min
和max
可以使用参数的属性。- eqcons :
list
,可选Python:列表,可选 长度函数列表
n
这样的话eqcons[j](x0,*args) == 0.0
在一个成功优化的问题中。- ineqcons :
list
,可选Python:列表,可选 长度函数列表
n
这样的话ieqcons[j](x0,*args) >= 0.0
是一个成功优化的问题。
- fixed :
笔记
模型公式:
\[F(X)=((arctan(x/A)/2pi)-p)/f\]实例
import numpy as np import matplotlib.pyplot as plt from astropy.modeling.models import ArcTangent1D plt.figure() s1 = ArcTangent1D(amplitude=1, frequency=.25) r=np.arange(-10, 10, .01) for amplitude in range(1,4): s1.amplitude = amplitude plt.plot(r, s1(r), color=str(0.25 * amplitude), lw=2) plt.axis([-10, 10, -np.pi/2, np.pi/2]) plt.show()
方法总结
evaluate
(x, amplitude, frequency, phase)一维反正切函数模型函数。
fit_deriv
(x, amplitude, frequency, phase)一维ArcTanGent模型导数
方法文件