如何使用最小二乘曲线拟合来猜测没有松弛行为的实际洛伦兹函数 [英] How to guess the actual lorentzian function without relaxation behavior with Least square curve fitting

查看:168
本文介绍了如何使用最小二乘曲线拟合来猜测没有松弛行为的实际洛伦兹函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问你是否有可能实现这个想法:

I wanted to ask you if it would be possible to implement this idea:

总而言之,我测量一个信号(蓝色曲线,查看测量数据的图和洛伦兹函数的初始猜测),该信号是洛伦兹函数和一定的松弛核。我对洛伦兹函数有一个初步的猜测(请参见绿色曲线),但是正如您所注意到的,绿色曲线并不是真正的完美洛伦兹函数,因为它在底部仍然不对称。我从未使用过这种曲线拟合的方法,如果有人可以给我看一个代码示例来找到所需的洛伦兹函数或实际的松弛核exp(-t / tau),我将不胜感激。

So all in all, I measure a signal (blue curve, See plot of the measured data and the initial guess for the lorentzian function), this signal is a convolution of a lorentzian function and a certain relaxation kernel. I have an initial guess of the lorentzian function (see green curve), but as you notice, the green curve is not really aperfect lorentzian function , as it is still dissymmetric in the bottom. I have never used this tyme of curve fitting and would be really grateful if anyone could show me a little code-example to find the wanted lorentzian function or the actual relaxation kernel exp(-t/tau).

所以现在分步进行:


  1. 假设我们有一个洛伦兹函数,该函数随着一定的弛豫时间tau衰减,tau不是常数而是时间的函数。因此,假设我们有一个测得的数据,我们将其建模为洛伦兹函数和松弛核之间的卷积exp(-t / tau)(请参见蓝色曲线)

  2. 使用我实现的某种算法,我对未松弛的洛伦兹函数和松弛核exp(-t / tau)
    有一个初步的猜测(请参见绿色的)。

  3. 现在,我想进行最小二乘曲线拟合,以确定最能满足我的数据需求的洛伦兹函数的最佳松弛核和最佳拟合。

  1. Say we have a lorentzian function, that decays with a certain relaxation time tau, tau is not a constant but a function of time. So say we have a measured data that we will model as a convolution between a lorentzian function and a relaxation kernel, exp(-t/tau) (please see blue curve)
  2. With a certain algorithm I implemented, I have a first guess of the "unrelaxated" lorentzian function and the relaxation kernel exp(-t/tau) (please see the green one).
  3. now I would like to do least-square curve-fitting in order to determine the best relaxation kernel and the best fit for the lorentzian function that would much my data.


推荐答案

我使用了最近开发的scipy中的差异进化遗传算法来提供帮助将双重洛伦兹峰方程拟合到拉曼光谱数据中,具有出色的结果。将我的GitHub代码中的数据和拟合方程式更改为您自己的数据,您就应该这样做。

I have used the Differential Evolution genetic algorithm that is in recent versions of scipy to aid in fitting a double Lorentzian peak equation to Raman spectroscopy data with excellent results. Change the data and fitted equation in my GitHub code to your own and you should be done.

该项目的GitHub URL为:

The GitHub URL for this project is:

https://github.com/zunzun/RamanSpectroscopyFit

这篇关于如何使用最小二乘曲线拟合来猜测没有松弛行为的实际洛伦兹函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆