I'm trying to use the Levenberg-Marquardt.vi to fit some data. The equation to which I'm trying to fit it must be entered in a "model cluster". It keeps giving me a 'parsing' error (-23001). Am I entering the equation incorrectly? It looks like this y=A*x^4+B*x^2+C+D*x(-2)+E*x^(-4). The curve fitting vi is reading the data fine but it's not spitting anything out (best fit).
Kieran wrote: > > Hello all, > > I'm trying to use the Levenberg-Marquardt.vi to fit some data. The > equation to which I'm trying to fit it must be entered in a "model > cluster". It keeps giving me a 'parsing' error (-23001). Am I entering > the equation incorrectly? > It looks like this y=A*x^4+B*x^2+C+D*x(-2)+E*x^(-4). The curve fitting > vi is reading the data fine but it's not spitting anything out (best > fit).
1: You could just simplify this equation till it works, thus finding the problem yourself! As someone else wrote, it probably should be D*x^(-2).
2: Or rewrite the formula; using divide symbols lets you remove the brackets & clarify the formula. Easier to spot errors: y=A*x^4 + B*x^2 + C + D/x^2 + E/x^4
3: If this subVI accepts multi- line formulae you might get better execution speed with intermediate numbers, and using * instead of ^2. That's certainly true with some compilers:
The thing that really stands out is your power syntax. Starting with labview 6i, the format for a power is now x**4 for x^4. If you update a VI from version 5 to version 6i, this is automatically done, but if you're programming in 6i, you'll need to use that syntax for your equations.
Thanks fellas for those responses. The equation I had in my vi did not have that '^' error, that was a typo. I tried all sorts of different formats like you suggested and I tried simpler equations etc. Still nothing.
Darren I'd really like to show you the vi if you wouldn't mind. How do I attach files on the newsgroup?
Make sure you follow the suggestions of the others in the group and use the new '**' syntax for powers (instead of the old '^' syntax). Also make sure to put a semicolon on the end of your statement, as was also suggested. If neither of these suggestions helps, you can reply to your original post and you will have the ability to attach a file with the "Attach Files" button underneath the message.
I'm hoping though, that the '**' or semicolon suggestions do the trick.
It might have to do with the capital letters in your formula. The online help for the Parse Formula String VI has a list of acceptable variables. They are:
"a, a0,...,a9
b, b0,...,b9
.
.
.
z, z0,...,z9
Note: For variable and function names, only lowercase letters are allowed. The VIs interpret capital letters as errors."