洛伦茨曲线半高全宽_Python:找到曲线的半高宽

I'm trying to find the FWHM of this curve:

array([ 7.83891873e+10, 1.01884187e+11, 1.41597108e+11,

2.13425504e+11, 3.62335668e+11, 6.58172740e+11,

1.49147209e+12, 3.67126510e+12, 9.13961052e+12,

1.51912641e+13, 1.56449601e+13, 8.75926436e+12,

3.51770483e+12, 1.44762974e+12, 6.03263316e+11,

3.14433592e+11, 1.93097056e+11, 1.37103090e+11,

1.03367989e+11, 8.62706418e+10])

I've tried this, but it does not seem to work.

x = np.arange(20)

y = array

max_y = max(y) # Find the maximum y value

max_x = x[y.index(max_y/2)] # Find the x value corresponding to the maximum y value

print max_x, max_y

解决方案y=array([ 7.83891873e+10, 1.01884187e+11, 1.41597108e+11,

2.13425504e+11, 3.62335668e+11, 6.58172740e+11,

1.49147209e+12, 3.67126510e+12, 9.13961052e+12,

1.51912641e+13, 1.56449601e+13, 8.75926436e+12,

3.51770483e+12, 1.44762974e+12, 6.03263316e+11,

3.14433592e+11, 1.93097056e+11, 1.37103090e+11,

1.03367989e+11, 8.62706418e+10])

max_y = max(y) # Find the maximum y value

xs = [x for x in range(20) if y[x] > max_y/2.0]

print min(xs), max(xs) # Print the points at half-maximum

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值