Curve fitting via optimization without toolbox

Hello,
I have a data sheet with the following curve data.
time 1.00E-03 0.01 0.04 0.1 1 10
Zth(t) 0.007 0.02 0.04 0.055 0.09 0.1
The equation of the curve is as following:
Equation: Zth(t) = R1*(1-exp(-t/tau1)+R2*(1-exp(-t/tau2)+R3*(1-exp(-t/tau3)
I need to fit the curve on matlab to the measured curve and thus estimate the R1-R3 and Tau1-Tau3 values by optimization.
The matlab version I have does not have a curve fitting or optimization toolbox. Can I get some assistance with the procedure to do it purely on matlab??
Thank you.

Answers (1)

Sorry, but this is INSANE.
You want to fit a sum of THREE exponentials (so 6 coefficients), from 6 data points?
Given that sums of multiple exponentials are a difficult problem to estimate in general, what you want to do is essentially a random number generator. I.e., it will generate arbitrarily meaningless coefficients.
Save your energy. Get better data. LOTS more. Even then, make sure you have good starting values. (You won't.)
John

6 Comments

I have managed to get obtain these optimized values on excel. However, I am required to do the same on matlab. Excel uses the solver feature to generate R and Tau numbers within a specified range until the error is minimum. In this case the range for R is 0-0.1 and Tau is 0-100. I am not sure how to do it in matlab.
You are not addressing John's comment.
I don't care that you got SOMETHING, SOME set of numbers. That is irrelevant. ANY optimizer will do that. The numbers you got are meaningless.
Some set of numbers is what's required, as long as it fits the curve, I can use those R and T values to formulate my model as it has no physical basis in application. I am looking for assistance with this optimization process on matlab as I am new to the software.
If the numbers don't matter then why don't you do it the other way around? Define your function and then get some points on it, which boils down to simple function evaluation. And also that would be a perfect fit.
Exactly. If the numbers themselves as a solution are irrelevant, then just pick some. You don't need to do any optimization, especially an optimization that will likely be poorly conditioned.
You seem to think that just because Excel returned a solution, that it is the "correct" one. Excel returned a set of numbers that its own optimizer stopped at. For us to try to help you stumble through solving a moderately nasty problem would be a waste of our time and yours, especially since you seem to know only a wee bit about optimization.
You would likely find out that the solution is dependent on your starting values, although one answer might be nearly as good as another. Or you might wonder why the solution that Excel returned was a different one from what you find in MATLAB, and then we would need to go through iterations explaining why, or why you don't care anyway. Or you might find that the optimizer seems to diverge sometimes, again depending on starting values.
And finally, for us to wean you through all of this when you don't even have the logical toolboxes one might use is even more a waste of energy when you don't need any help at all.

Sign in to comment.

Asked:

on 12 Jun 2014

Commented:

on 13 Jun 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!