弧余弦1D#
- class astropy.modeling.functional_models.ArcCosine1D(*args, meta=None, name=None, **kwargs)[源代码]#
基类:
_InverseTrigonometric1D
一维反正余弦仅返回0到pi之间的值。
- 参数:
- 其他参数:
- 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)=((ArccOS(x/A)/2pi)-p)/f\]此模型使用的ArccOS函数将仅接受 [-A, A] ;否则抛出运行时警告,结果为NaN。为了避免这种情况,已经正确地设置了burding_box以适应这种情况;因此,建议始终使用
with_bounding_box=True
选择。实例
import numpy as np import matplotlib.pyplot as plt from astropy.modeling.models import ArcCosine1D plt.figure() s1 = ArcCosine1D(amplitude=1, frequency=.25) r=np.arange(-1, 1, .01) for amplitude in range(1,4): s1.amplitude = amplitude plt.plot(r, s1(r), color=str(0.25 * amplitude), lw=2) plt.axis([-1, 1, 0, np.pi]) plt.show()
方法总结
evaluate
(x, amplitude, frequency, phase)一维反正余弦模型函数。
fit_deriv
(x, amplitude, frequency, phase)一维反余弦模型导数。
方法文件