03-19-2015 10:47 AM
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... ) 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
03-19-2015 12:50 PM
Please show us your code and we will show you how to easily modify it.
03-19-2015 12:59 PM - edited 03-19-2015 01:13 PM
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.
03-19-2015 01:07 PM
An example using the data variant input can be found here.
03-20-2015 02:33 AM
Ok thank you for your answer, I will try it and mark the discussion as solved when I'm done.