LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Constrained non linear curve fitting

Hi, everyone !

 

First of all, I am sorry if my question was already dealt with, I have done some research on the forum but half successful...

 

I have some troubles with the use of the constrained non linear curve fitting : 

 

I have some data that I'd like to fit with a known mathematical model composed of a single parameter to search (easy !) but with a lot (a lot really... Smiley Frustrated) of user fixed physical parameters (with commands on the front panel). 

I understand (I think...) how to use the VI (f(x,a)) to pass the model that I want to fit the data, but I've seen (here) that I have to use the "data" input at the top of the constrained fit VI to pass the user defined parameters. The solution posted may have enlightened the OP of the thread but I did not really understand it...

I would be very grateful if a good soul would have the patience to explain to me how to solve my problem.

 

If it has an importance, I am using LabView 2012.0.1f5

0 Kudos
Message 1 of 5
(2,690 Views)

Please show us your code and we will show you how to easily modify it.

0 Kudos
Message 2 of 5
(2,662 Views)

Easiest would be to make an array of the additional parameters and convert it to a variant to be wired to the data input. Inside the model, you would use "variant to data" with an empty 1D array of the same type wired to the type input, and you'll get the original array back to be used in your model calculation.

 

If the names are hard to remember, create a cluster with named elements and convert to variant. Convert it back to the cluster inside the model and use unbundle by name to get the values.

0 Kudos
Message 3 of 5
(2,659 Views)

An example using the data variant input can be found here.

0 Kudos
Message 4 of 5
(2,655 Views)

Ok thank you for your answer, I will try it and mark the discussion as solved when I'm done.

0 Kudos
Message 5 of 5
(2,630 Views)