LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Runge Kutta input syntax error

Hello,
I have a problem with string input of right-sides of differenital equations in "ODE Runge Kutta 4th order.vi"
I have a system of 7 partial differential equations of 1st order and, of course, with 7 unknowns.
And I don't know where to find the rules for writing equations in the string form, tride to find it in Help, but all I got were the .vi examples, but they don't cover all my operators.
So if anyone can help with telling me where to find this.

Or, even better, if anyone can help me with explaining problem with the .vi in the attachment,it is one part of code within "ODE Runge Kutta 4th order.vi" for checking the right-side of differential equations input, and with the equations I have to solve and with names of the variables in the string indicator.

Thank you in advance!
Stay well,
Toni Dropulic
0 Kudos
Message 1 of 5
(3,095 Views)

Hi,

I noticed two problems with the formulas that you are trying to use:

1) The formula parser work in decimal point (.) instead of coma (,). You have to modify all the number with coma (1,40363, for example) to (1.40363).

2) The variable name has several restrictions. It accept only the following variables:

a, a0,...,a9; b, b0,...,b9; ...z, z0,...,z9. You have to substitute all the variables to the permitted one.

This will make the errors go away when trying to parse the function. If you don't want to change the equations, you can always use string operations to convert (,) to (.) and use the "Substitute Variables.vi" to replace the previous variable with the permitted sintax.

Hope this help!

 

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 2 of 5
(3,086 Views)
Hi, this advice with variable names helps, thank you!
But as far as I've noticed, the input for Runge Kutta function can be even with comma, doesn't need decimal point.
And that is also used in LabView's examples.

But this works - I'll have to check the results :-).


Stay well,
Toni Dropulic
0 Kudos
Message 3 of 5
(3,083 Views)

Actually, just to clarify, the decimal point depends on your computer's and LabVIEW configuration. If you change the operating system to be decimal, LabVIEW will start using decimal point and your program will not work anymore. There is an Option that allows you to avoid system changes, but you would have to change all to decimal points. If you guarantee that your system will be always coma, that would not be a problem.

Also, in the Full Development System of LabVIEW 8 there is a new function called "LabVIEW 8.0\vi.lib\gmath\ode.llb\ODE Solver.vi" that you can develop the right-hand side of the equations as a VI instead of formula node. This could be attractive for some users (I personally prefer graphical programming instead of equations since it is easy to debug). In addition, this VI allow you to choose which solver as fixed step size (RK1,2,3 or 4) or variable step size (RK 23, RK 45, BDF, etc), Time Step, Minimum and Maximum Timestep, Initial and Final Time, and so on. So, if you can change the solver parameters without changing VIs.

 

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 4 of 5
(3,067 Views)
Aha, that's the catch.

Thank you, Barp!

I will keep my computer on this settings, so there won't be any problems with this....
And this new thing in LabView 8 is great, and seems to be much easier.
With this, I probably wouldn't have this kind of a problem.

Stay well,
Toni Dropulic
0 Kudos
Message 5 of 5
(3,064 Views)