09-09-2019 07:16 AM
Hi all
I'm using LabVIEW to run an instrument called a pendant drop tensiometer, which takes in images of a droplet hanging from a needle and then tries to fit a set of ordinary differential equations to describe the shape of the droplet.
At present I use a simple fitting approach to get a good guess at the parameters I need, and then try to optimize a radius of curvature and shape factor, beta, to get a better fit. In the objective function VI, I use a fourth-order RK integrator to numerically solve the set of ODEs and provide a reference profile for the edge of the drop. I then calculate a least-squares error and use that as the output of my objective function.
Because of the nature of the equations involved, most values for the shape factor fit very poorly, so I had hoped this would be a relatively easy problem.
Unfortunately the only type of optimization VI I can get to work properly is the Downhill Simplex method on the unconstrained optimization VI. The QN and CG methods will adjust other parameters that I route in, but not other values. Many of the problematic local minima in this optimization problem fall outside of the range of acceptable values for the shape factor (0 to 1) so I had hoped to use the constrained optimization VI - unfortunately this lead to the same problem. The VI will not change the value of the shape factor, but will happily optimize all other values in the equation.
One possible cause I've been wondering about is that in the course of the objective function VI, the value for the shape factor is converted to a string in order to be inserted as a constant into one of the equations that's fed into the RK solver - perhaps that interferes with the ability of the equation to calculate a gradient. Has anyone experienced an issue like this before?
Apologies for my messy code - I've attached the sub-VI which is running the objective function and the VI co-ordinating said optimization.
Thanks for any suggestions.