Quantcast
Channel: Fitting a Multi-Exponential Decay With Constraints - Mathematica Stack Exchange
Viewing all articles
Browse latest Browse all 2

Fitting a Multi-Exponential Decay With Constraints

$
0
0

I am having trouble finding a way to fit my data in Mathematica to a multi-exponential decay, with the critical condition that all contributions to the decay sum to 1.

To start, I can fit my data to single exponential decay just fine using:

model = Exp[-t/k];fit = FindFit[cordata,model,k,t];

This gets me a decent fit, and I can also fit my data to a multi-exponential decay using:

modelx = m1 * Exp[-t/k1] + m2 * Exp[-t/k2];fit = FindFit[cordata,modelx,{{m1,.5},{k1,x},{m2,.5},{k2,x}},t];

where x is the value of k returned by the single exponential fitting. This multi-exponential fit is even better (so long as I provide reasonable starting values for m1, m2, k1 and k2. However, if I attempt to constrain the fitting so that all contributions sum to 1:

modelx = m1 * Exp[-t/k1] + m2 * Exp[-t/k2];fit = FindFit[cordata,{modelx,m1+m2==1},{{m1,.5},{k1,x},{m2,.5},{k2,x}},t];

The fitting no longer works. m1, m2, k1 and k2 are just returned as the starting values and thus the fit is no better than for a single exponential decay.

Just for the record, my data basically is an exponential decay that starts at 1 and decays to zero. Fitting it to a multi-exponential decay where all components sum to 1 should be totally reasonable (I think). I need to lock the sum of the components because it is very important to the interpretation and application of the fit. If anyone has any advice on how I can do this, I would greatly appreciate it. Sorry if the answer is obvious. I am new to Mathematica, but I have tried a variety of options to get around this with no success.

Also, if it is somehow possible to take a normal multi-exponential decay and adjust it so that all contributions sum to 1, I would be open to that as well. Sorry if I missed this, my math is not the best.

Edit: Although I showed a second order exponential decay to be concise, I actually want to apply this method to a sixth order decay:

modelx = m1 * Exp[-t/k1] + m2 * Exp[-t/k2] + m3 * Exp[-t/k3] + m4 * Exp[-t/k4] + m5 * Exp[-t/k5] + m6 * Exp[-t/k6]

Where all factors sum to 1. So I cannot define one factor using the other.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images