LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Minimizing a multivariate function based on measured data

Hi all,

 

I'm trying to implement some sort of machine learning-esque method that tunes a set of parameters to minimize the error between my desired and actual measurements.  I'm using LabVIEW to send a signal to a wavemaker (hardware that plunges up and down in a wave tank to create water waves).  I'm then measuring the actual wave height using a wave gage.

 

So, I send a signal, which is a spline fit to several points (x,y) --- basically a 1x1200 array of vertical positions of an actuator over time.  Only 5 of these x or y values can be adjusted to optimize the wave produced from the spline.  I read in the wave gage data for 30 seconds while the actuator is moving, ensemble-average the waves recorded, and then compare the wave recorded vs. the wave I was trying to make.  This comparison is based off some error metric, e.g. Euclidean distance.  Based on this error, I want to change the 5 possible tuning parameters in order to reduce the error on the next iteration.

 

I've used a lot of unconstrained optimization methods in Matlab, but I'm not sure how to properly implement this in LabVIEW since each iteration of the "function call" to compute the error requires the whole process of [send signal to wavemaker] --> [record data] --> [process data] --> [compute error].

 

The other option I've considered is just getting a vast training dataset based on random choices of these 5 parameters, but it would be nice to be able to iteratively adjust them in some logical way.  I've worked with just enough machine learning to know the buzzwords and understand the concepts, but not enough to have actually implemented them for a real-world application.

 

Any advice/suggestions would be much appreciated!  Thank you in advance.


Tracy

0 Kudos
Message 1 of 3
(2,937 Views)

Normally when you try to fit a function to data, the data are fixed and the function is known and "variable".  For example, 200 measurements of something, and you fit a Gaussian to the measurements -- the points are known, the function has three parameters, and you adjust the parameters so that the function "best fits" the fixed points.

 

Here, the situation is reversed.  You have an unknown function (the effect of your actuator) with 5 variables.  You experimentally determine the value of the function at the 5 points (by generating your wave and measuring it), and then want to compare the function output (the wave you actually get) with the "wave you want".  Hmm, I guess the "wave you want" could be considered the fixed data.

 

Anyway, this sounds to me like a Simplex Algorithm problem.  Your 5 parameters are a point in a six-dimensional space -- you want to move around in this space until you find a point where your "measure" (how well the produced wave matches the desired) is minimal.  One nice thing about the Simplex Algorithm is that it can (but doesn't always) converge fairly quickly, but with 5 points in a 6-dimension space, you're going to be making (no pun intended!) a lot of waves ...

 

Bob Schor

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

That's an interesting idea!  Thanks for the reply, Bob.

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