Math

Dear all

I'm a new user of Igor, so I'm not familiar with it. I need to write a code to fit data. The fitting function is a convolution between a Gaussianand an exponential decay which is multiplied by the Heaviside step function. (Gauss)x(exponent*step function). Such that for negative values of the independent variable, the product (exponent*step function ) is zero. Should be something simple but I couldn't do it. Is there any idea? Thanks a lot
Decay.jpg (21.61 KB)
Giannis wrote:
... The fitting function is a convolution between a Gaussian and an exponential decay which is multiplied by the Heaviside step function ... Is there any idea?


My first thought is, the way you might approach this depends on what parameters you already know.

* Do you have a template function that parametrically represents the convolution of a Gaussian with an exponential times a HS step? If so, this template function becomes your overall fitting function.

* Is the overall formulation non-analytical (ie, it might require numerical integration)? If so ...

-- Can you deconvolve the Gaussian blur first, then fit what is left to the exponential times HS step data? This method would be preferred when you know exactly what your Gaussian blurring function is for all cases (for example, it is much like an instrument transmission function).

-- Can you fit to the exponential + HS step raw data, obtain the model for the experiment, and then deconvolve the Gaussian blur? This method would be preferred when your Gaussian blur changes from experiment to experiment (for example, it is much like a system-dependent time constant response).

-- Can you write a function for the exponential times HS step with a separate function for the numerical integration/convolution and then fit with the two functions combined (my experience here is limited, though I believe Igor can handle this)? This method would be preferred when either of the two methods above (deconvolve+fit or fit+deconvolve) are limiting in some way.

HTH

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
Giannis wrote:
Dear J. J. Weimer

Thank you very much for the response. I really appreciate it .
I have found a code but I can not so far to include the HS step function.
I have attached the file may be it is interesting for you too. Just you need to have a wave for the coefficients.
All the best
Giannis


Giannis, note in your attached file (copied out of the Igor manual) that this line:

expwave = (x>=0)*pw[4]*dT*exp(-pw[4]*x)

does, in fact, implement the multiplication by the step function. Note the "(X>=0)" at the start of the expression; it has a value of zero when X < 0 and 1 when X >= 0. Please be sure to read about the limitations of the first, easy implementation of convfunc()

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Thank you very much for the response dear Johnweek
I really depreciate it.