LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

levenberg Marquardt algorithm with complexe numbers

Hi everybody,

I have some questions about the best method to fit a complex curve when we know the complex model. I thank in advance everyone, who will help me, or who will add a simple remarq.

 

Here is my questions, I detail the context further:

1) What is the best way to fit a complex curve when we know the model (but not the exact parameters of this model)?

2) In the "constrained nonlinear curve fit.vi" with LM bound instance, this algorithm is based on the least square method. Do we have access to the minimisation criterium? (picture below, J(c))

 

The context:

My work concern impedance spectrum (Z(jw)), and I have to find the parameters of my complex model with the mesurement of 6 points on the impedance spectrum.

 

My 2 different solutions (not the best, It seems to work, but I don't know if its a proper way to handle this):

1) Use the constrained nonlinear curve fit, with cast (see the attached files named code.zip/cast & model)

2) Use the constrained nonlinear curve fit, with a minimisation criterium (not complexe input data, but the goal is the same) (see the attached files named code.zip/criterium & model_criterium)

Download All
0 Kudos
Message 1 of 7
(4,450 Views)

Instead of attaching a bucket full of mbp images, it would help of you could instead attach the actual code (both versions) and some typical data.

 

Since you are using the constrained version, what do you use for the parameter bounds? What method?

0 Kudos
Message 2 of 7
(4,441 Views)

Thanks for the reply,

The complete code is a little bit tricky, I'll do a short version and I'll send it. I'm not in my office, I'll send you the data and parameters too.

I use the LM bound. 

 

I saw your comment concerning this algorithm before posting mine, I think you provide a good help in this forum. 

0 Kudos
Message 3 of 7
(4,419 Views)

I have been faced with a similar problem.  Refer to the following thread:

 

http://forums.ni.com/ni/board/message?board.id=170&thread.id=479316&view=by_date_ascending&page=3 

 

There are several examples available.  The L-M turns out to be a very simple optimisation algorithm to use, though I have read mixed opinions about the results it gives.

 

It is important to be able to provide accurate initial estimates of your parameters and/or be able to provide the partial derivatives.

 

I am not sure how L-M will deal with complex numbers but since it is simply a minimalisation problem it should not matter.  I'd be interested to see..

 

All you have to do is build your equation(s) into the template VI.

0 Kudos
Message 4 of 7
(4,409 Views)

@Battler,

Hi, thanks for the link, "pa" is the minimisation criterium in your case, or simply the function of your curve?

 

@Everybody

Here is the both codes with the same algorithm, the same parameters and the same data, but one use only the data, and the orther use a minimum criterium.

The first seems to work well, but in the second (with the criterium), the best fit parameters saturate.

(There are two projects, load "HOST.vi" and change the relativ path in "fitting.vi" to find the file "model.vi")

0 Kudos
Message 5 of 7
(4,388 Views)

Hello blackwarrior,

Did you manage to do what you were after?

I am also working with complex impedance spectra and trying to do curve fitting using similar approach. Thinking how you managed to solve your problem.

0 Kudos
Message 6 of 7
(3,977 Views)

Does anyone solve that problem - I think that solving problem like that is very important to many electrochemist around the world.

 

0 Kudos
Message 7 of 7
(3,786 Views)