From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-05-2015 07:55 AM
Is possible to solve a nonlinear system with more equations than unknowns in LabView. I am doing some triangulation, and have data from several sensors, so I am able to write 6 equations in order to get 3 coordinates (x,y,z) as a solution. In LabView I was able only to solve a system of 3 equations with this 3 unknowns, but I would like to use all of the 6 equations in order to get more accurate solution, since some measurements can be noisy.
Thank you in advance
Solved! Go to Solution.
07-05-2015 08:04 AM
How would you do this manually? Which equations carry the most weight? How does the system decide?
Do you have a way to determine how noisy the measurements are? Are some data points subject to more noise than others? Dose that change from one measurement to the next?
My first thought is to solve multiple times using 3 different equations each time. Then combine the results from any sets of equations which generated numerically valid solutions to get the final estimate. The noisiness of the data or the residue of the solutions might be useful in weighting the final combinations.
Lynn
07-05-2015 08:15 AM
I know Matlab can manage this situation. I used fsolve function for this. I think it is done by changing the solution until all of the equations are satisfied, being less than the preset error.
But using Matlab isn't an option for this project.
Combining the solutions may work though
07-05-2015 08:52 AM
I do not have Matlab but I looked at the Mathworks web site. The documentation page does not list a function called fsolve. What does your documentation for that function say about more equations than unknowns?
Lynn
07-05-2015 09:54 AM
Look up "Overdetermined Systems" (which is what you have when you have more equations than unknowns). There is a technique for finding the least-squares approximate solution to such a system, with the assumption being that your equations are consistent (that is, some of the equations are really linear combinations of others). LabVIEW should be able to do that, though it might not (natively) use the optimal numeric method ...
Bob Schor
07-06-2015 10:11 AM
You can use the Nonlinear curve fitting code to solve this problem. Consider the following system:
3xy + y - z = 12
x + yx^2 + z = 12
x - y - z = -2
Re-arrange to get 0 on right side. x, y, and z are the paramneters to be fit. The Y input to the Nonlinear Curve Fti.vi will be an array of three zeroes. Initial Parameters will be an array of three values, e.g. [1 1 1]. Attached is an example.
-Jim
07-06-2015 10:15 AM
07-06-2015 01:27 PM
I'm a little confused. The question you asked was "How do I solve a non-linear system of equations when I have more equations than variables?". You mention that you know how to solve (in LabVIEW) 3 equations in 3 unknowns. Several of us ask questions and make suggestions, and you mark as the "solution" solving 3 equations in 3 unknowns. How does this answer your original question?
Bob Schor
07-06-2015 01:53 PM
07-12-2015 05:02 AM
DSPGuy can you attach the examples in LabView 2013 version?