Jump to content

Non linear curve fit


Recommended Posts

Hello,

I have a spectrum from a signal and I know how it should be theorically: A/(1+Bf**2)step(D-f)+E

...where f is frequency.

...where A, B, C, D and E are constants that I want to get from the real data.

To solve this problem I try to use the "Non linear curve fit.vi", but it keeps saying:

Error -20041 occurred at NI_Gmath.lvlib:Nonlinear Curve Fit LM.vi

Possible reason(s):

Analysis: The system of equations cannot be solved because the input matrix is singular.

I checked if the array of independent and dependant values are equal, I checked the fitting model and everything seems ok.

You know why it keeps saying the input matrix has no inverse matrix?

Thank you.

I attached a picture with the VI.

post-7658-1170780650.jpg?width=400

Link to comment
Hello SciWare,

Sorry for the delay. I thought I had posted a message on wednesday but it seems I didn't.

The data wired to the Block is in the next picture. It is a spectrum of a 1/f noise plus a white noise.

I also attach a graph plot of the data contained in the array in the cluster of the spectrum graph.

Nil

The last bit of the data seems to be trailing off to 0. That might be the problem.

Neville.

Link to comment

As soon as I come back and get working on this again I'll tell you if your answer is right. However if I remember well, the last data in the graph was non-zero. I'll try to plot a logaritmic graph so that it is easier to see it's non zero.

QUOTE(Neville D @ Feb 9 2007, 06:58 PM)

The last bit of the data seems to be trailing off to 0. That might be the problem.

Neville.

Link to comment

QUOTE(mermeladeK @ Feb 16 2007, 11:39 AM)

As soon as I come back and get working on this again I'll tell you if your answer is right. However if I remember well, the last data in the graph was non-zero. I'll try to plot a logaritmic graph so that it is easier to see it's non zero.

Here I am!

Well, I checked what you said and... it's not about the zeros. I tried a different input for the Nonlinear Curve Fit VI and it keeps saying again the same thing: NI_Gmath.lvlib:Nonlinear Curve Fit LM.vi.

Does any1 have an idea of what is the problem with this VI? :(

Attached the input waveform:

Link to comment

QUOTE(mermeladeK @ Feb 9 2007, 04:32 AM)

Hello SciWare,

Sorry for the delay. I thought I had posted a message on wednesday but it seems I didn't.

The data wired to the Block is in the next picture. It is a spectrum of a 1/f noise plus a white noise.

I also attach a graph plot of the data contained in the array in the cluster of the spectrum graph.

Nil

Why don't you post the VI's (and data if any) instead of a picture of the BD.. that will save people time in trying to re-build your work just to re-create your error.

Neville.

Link to comment

QUOTE(Neville D @ Feb 26 2007, 10:37 PM)

Why don't you post the VI's (and data if any) instead of a picture of the BD.. that will save people time in trying to re-build your work just to re-create your error.

Neville.

Here are the VI's. The main one is the one with the word "TEST" in the name. The other 2 are subVI's. The "Acquire 1 divided by f idealized spectrum parameters.vi" is the VI supposed to use the Non linear curve fit.

Nil

Link to comment

QUOTE(mermeladeK @ Mar 2 2007, 04:36 AM)

Here are the VI's. The main one is the one with the word "TEST" in the name. The other 2 are subVI's. The "Acquire 1 divided by f idealized spectrum parameters.vi" is the VI supposed to use the Non linear curve fit.

Nil

Thanks,

I will take a look at it shortly.. been out of town and lots to catch up on.

Neville.

Link to comment

I took a look at you code but it isn't easy to follow.

I ran it and it produced the reported error which is due to the Lev Mar Curve Fit being unable to calculate a covariance, I'm not sure why though.

What I would strongly suggest is that you check that your curve fit model is correct and that the data that you are trying to fit it to is appropriate. Generate data that fits your model and see if that works, also check your initial coefficients, are they appropriate?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.