LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

constrained lm fit: having problem

So…

Here is my problem (Using LabView 8.5) --

 

I want to use constrained LM routine for iterative re-convolution fitting program (attached). I started with a simpler LM routine and it works well. It gives correct values for one exponential decay after re-convolution fitting.

 

 

 


 

 

 

 

 

But when I replace this with a constrained LM routine and try to run it gives error: 

(see the second LM is replaced with constrained LM and prameter bounds are also added)

 

 

 

 

Error -20039 occurred at NI_Gmath.lvlib:LM get new coefficients.vi

The number of columns in the first matrix is not equal to the number of rows in the second matrix or vector.

 

I’ve put in three min and max array or vector (in the lower and upper bound of parameters).

 

Looking forward for help to resolve this problem.

Thanks in advance.

Download All
0 Kudos
Message 1 of 3
(3,672 Views)

Dear Debanjan

 

Has this problem been sorted out yet? I have the exact same problem. Does the Non-linear fit maybe not require the derivative as an input?

 

Regards

G

0 Kudos
Message 2 of 3
(3,460 Views)

The problem is in the model function.  After the convolution the size of the output array f(x,a) is not the same as the number of data points.  This causes a series of functions to fail in the contrained LM code, yielding a very unhelpful error message far away from the error condition.  We will fix that error handling.  The unconstrained LM code does not fail, but only uses the first 750 data points (arguably a worse behavior that is harder to debug, but seems to have worked for your problem).  The fix is to modify your model function to output the same number of points as your y-data.

 

-Jim

 

0 Kudos
Message 3 of 3
(3,449 Views)