05-20-2010 11:32 AM
Hey,All
I am a rookie to labview. I try to fit experimental data with nonlinear fitting (Lev-Mar) and attain the fitting parameter. But the fitting curve looks bad. I tried so hard to get better fitting, but the progress is so little. I wonder whether there is some way to put the fitting in a loop to get a better fitting.
Basically, the aim is to calculate the Young's modulus from the indentation data. The parameters in the model vi are k (Spring constant , 0.02) , poisson ratio(0.5), d0 (-77.86), and cone angel (0.314). The initial condition for E and z0 could be (115270, 1017). The attached is one set of data and the model vi. If someone has such experience, could you possibly help me out? Your help is really appreciated.
05-20-2010 11:59 AM
05-20-2010 01:36 PM
I don't quite see how your model can generate anything similar to your data. Can you point me to a website that describes the model?
(Also, your model is very inefficient. The globals belong before the loop because the values hopefully don't change during the execution of the FOR loop.)
05-20-2010 01:39 PM
Thanks for the quick reply and suggestion!
The covariance seems fine. the matrix is (102189 , 23.3397
23.3397 0.0127) .
Do you think the matrix looks fine? Is there some way to get better fitting?
Thanks a lot!
05-20-2010 02:11 PM
Let us leave LabVIEW out of the discussion for a moment and just talk about your data and your model.
From a physics point of view I could explain why I think your model function vi is flawed, but I don't have time to go through the details now. Let me just ask you to look at the data and look at your model. Without looking hard I see that you have a y=sqrt(x) form for your model VI and that your data appears to be constant and then has a y=x^2 dependence. No amount of fitting and refitting and jiggering with coefficients is going to help you here.
Look at your model again, figure out what is going on and get back to us. What I like to do when tweaking is wire a control to the termination cluster of the LM VI, set the max iterations to zero and it will output f(x,a) for your input guesses. Tweak the inputs until you are at least in the ballpark with your initial guesses, and then unleash the fit.
Post back if you need more help after you figure out what is going on with your model. (I have a guess based on simple physics, you should know better if you actually use an AFM).
05-20-2010 02:42 PM
Thanks for your reply!
It is really amazing of you. How do you know the data is collecting from AFM!
The relationship in my model vi between y and x is y= x+x^0.5+constant. It is also a typical model to fit the data. It is supposed that a good fitting could be accomplished. Attached is one snapshot of fitting result.The fitting is close to the real data, that is why i wonder whether the better fitting could be achieved by loop.
Thanks again for your suggestion!
05-20-2010 03:18 PM
Never used an AFM in my life, but it looks like the curves I see and if I was ever planning on measuring Young's modulus I would hope to have one around.
I still don't see a sqrt(x) behaviour in your data, your last screenshot was about as good of a fit as I was able to get with your original model, perhaps even better. The transition I was seeing was either very sharp, or sqrt(x)-like over a broad range of parameters. You can try iterating by hand a couple of times. Take your best fit and feed the parameters into your initial guesses and try again.
My seat-of-the-pants guess is that the force is proportional to the square of the displacement. I don't remember my continuum mechanics well enough to know if that is the case for a conical or spherical punch. Anyways, I also think there is some model for the constant of proportionality that depends on E and mu and the cone angle and is probably where pi comes into your model. To get E from my fit I would have to figure out that relation I can just tell you that the guess y=a*x^2 + y0 for x>d0 works pretty well. Not perfect, so my simplified guess could probably use some fine-tuning.
05-20-2010 04:30 PM
Thanks for your reply!
Attached are the descriptions of the model i used in the vi and one snapshot of fitting results.
Speaking of the efficience,i do happen to the efficience problem. after i run for couples of times, the program is really stuck. The parameter in the model vi are the ones i need to control for difference groups of data. Could you possibly give some instruction about the better solution? Thanks
05-20-2010 09:11 PM
> The relationship in my model vi between y and x is y= x+x^0.5+constant
Perhaps you mean x*x^0.5? The SPIP appnote you posted gives force proportional to displacement^(3/2) for a spherical indenter and proportional to displacement^2 for a pyramidal one. Your data looks like a reasonable fit to either from the point of contact onwards.