12-05-2020 08:56 AM
In LabVIEW, I have a problem where I try to solve four linear equations with "linearsolve" command. I have two input signals from the DAQ assistant which I convert from a dynamic system to a numeric array.
When I try to solve the equations in the Mathscript it says "Error -90051 occurred at Error in function linearsolve at line 13: You specified an invalid number of input parameters for this function."
I have not been able to find help anywhere in other forums other than one place where it suddenly worked again.
I have attached a picture of the block diagram and the error.
Hope someone can help me solve this problem.
12-05-2020 09:21 AM
Showing us a picture of your code that we cannot modify, or try to run ourselves, makes it more difficult for us to help you (imagine that I asked you for help with a Matlab routine and attached a picture of a 3-page printout of its listing).
Attach your VI!
The error message suggests the problem is in "linearsolve", whatever that is. Have you looked into that?
Bob Schor
12-05-2020 01:14 PM - edited 12-05-2020 01:57 PM
Some of your parameters seem to have higher dimensions. What are you actually trying to achieve with all this? Can you take a step back and explain what the data represents and what you are trying to get out of it? I doubt that you need to use mathscript at all. (hint!)
Did you look at the help page for the function?
Why did you wire charts to the 2D array output? Why are there so many coercion dots? Do you know the difference between charts and graphs?
12-06-2020 04:43 AM
Oh sorry about that. The VI is attached now.
Yes, we have looked into the linearsolve, but we can't seem to figure out what the problem is. We are trying to solve the four equations with four unknowns, and linearsolve is the only function that solves linear equations as far as I understand.
Oscar Lyhne
12-06-2020 04:56 AM
We are trying to do forward kinematics for a two-dimensional platform. We have a potentiometer output in voltage which we are converting to an mm output, which is why we have the coercion dots. These two lengths are the input for the mathscript.
The output is then the angle and movement in the y-direction of the platform.
As I understand the mathscript has to have a numeric input which is why we are converting the dynamic data.
The VI is attached to the answer from Bob.
I am really grateful for the help from both of you, but I am quite new at LabView so I really appreciate your help!
12-06-2020 03:49 PM
I don't have MathScript installed, and I don't know what "linearsolve" does nor what its parameters mean -- the error you are seeing suggests that you are calling it improperly.
There are equation-solvers and curve-fitters in LabVIEW that don't require "mystery functions".
Bob Schor
12-07-2020 02:02 PM
I can see I am not the only one who has problems with the mathscript, so I have tried a different method now.
I see that other people are using nD nonlinear system solver for solving similar kinds of problems. But I have a really hard time making it work. I keep getting error -23001 which, as far as I understand, is a syntax error.
Also, I can't figure out how it is possible to have two variable lengths in the function.
The length of the legs will vary (L1 and L2) and are the outputs from the DAQ Assistant.
The four equations are:
(L1+125*sin(theta))-H1 = 0
(350-250*cos(theta))-L5 = 0
arcsin((L2*cos(phi)-L1)/L2)-theta = 0
arcsin(L5/L2)-phi = 0
I have attached the VI
12-07-2020 07:42 PM
Can you fill all your controls with reasonable default data*? (most are currently empty arrays!)
*(enter all values, menu ... edit ... make current values default...save and attach once more.)
12-08-2020 01:43 AM
Sorry about that. Here it is with the values in arrays.
12-08-2020 03:12 AM
I'll have a look at it tomorrow, but make sure to read this page.