06-14-2014 11:41 AM - edited 06-14-2014 11:41 AM
Hello,
Is there a way to solve two nonlinear equations and find x and y from them using LabVIEW without MatLAB and MathScript (don`t have ones on the lab PC)?
Maybe someone has an example..
Thanks.
Solved! Go to Solution.
06-15-2014 07:15 PM
You should be able to do this with the nD Nonlinear System Solver.vi from the Mathematics >> Scripts & Formulas >> Zeros palette.
Can you post some typical values for the parameters and the expected values of x and y for those parameter values?
Lynn
06-15-2014 07:45 PM
Hi! Thanks for your answer.
Parameters change from test to test (especially time), but average values are: v=5900 m/s; t2a=0.00001 s; t2b=0.000015 s; x1=0; y1=2000; x2a=3000 mm; y2b=0.
Expected values of x and y are [800, 1000].
I tried to play with nD Nonlinear System Solver.vi basing on several examples that I managed to find. However, all my attempts were unsuccessful - x and y are always zeros. Cannot find a mistake..
06-15-2014 08:06 PM
So this is what I tried to do, but answers always are zeros. Another question is how to automate the input variables using this VI..
06-15-2014 08:29 PM
When I use the VI version of the nonlinear solver I get x= 1500 and y = 1000 for the values which you say should yield 800, 1000. I have not double checked the implementation of the equations.
In the VI version of the solver I pass the parameters as an array to the Data input.
What version of LV are you using?
Lynn
06-16-2014 05:03 AM
I`m using LabVIEW 2013.
Sounds good, at least you have got no zeros 🙂 Is the right side of the block diagram correct? I`ll try one more time with an array of input parameters..
06-16-2014 06:41 AM
I don`t know why all data I insert in front panel elemets (formulas, variables and start data) disappears when I access the file after saving it.
I have got error -23001, but I think that syntax of functions is correct.
Functions are :
sqrt((x-3000)^2+y^2)-sqrt(x^2+(y-2000)^2)-5900000*0.00001
sqrt(x^2-y^2)-sqrt(x^2+(y-2000)^2)-5900000*0.000015
06-16-2014 09:06 AM
You need to right click on the controls and pick Data Operations >> Make Current Value Default if you want those values to be there after saving and reopening the VI. Alternatively, click the Edit menu and pick Make Current Values Default to do all the controls on the VI at once.
06-16-2014 09:36 AM
Thank you very much! It works)
I still have error -23001. What do I do wrong?..
06-16-2014 01:11 PM - edited 06-16-2014 01:12 PM
When I ran your VI, I got error -23023. When I enter that into Explain Error, I get Wrong dimension on Start. Error -23001 is a syntax error. In your second equation you have sqrt(x^2 - y^2) while the equation in your initial post has a +, not a -. That does not give me a syntax error but it does prevent finding a zero.
The reason for error -23023 is that you have specified Start but not End. Creating a control for End and entering two values immediately finds a zero at 1518.178612...
Here is the VI I used. You may need to relink the reference to the function VI because it will be in a different location.
Lynn