LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to speed up the RK4 VIs?

Solved!
Go to solution
One of the longest running parts of my application is A simulation of a vector valued DE using the built in RK4 VIs in NiGmathlib. Simulations tend to have about 100k runs of this VI, with 1k runs taking about 200ms. If I were to use an implementation of RK4 in C under a function node, would this possibly run faster? Or should I just reduce the number of time steps?
0 Kudos
Message 1 of 3
(2,566 Views)
Solution
Accepted by topic author ijustlovemath

Is there a specific execution time you need to achieve, or are you just interested in speeding up execution in general?

Whether or not a C code implementation of RK4 would run faster depends on many factors such as the specific implementation of the code, how the compilers translate the code, and whether or not the LabVIEW VI and/or C code are able to take advantage of parallel execution. If you're interested in finding out which is faster, your best bet is to try each idea. Changing the time step seems like the easiest one, so why not start there and see what you can do?

Charlie J.
National Instruments
Message 2 of 3
(2,516 Views)

Thanks, I've been experimenting with that already. The solutions seem to be relatively insensitive to changes in time step, so I think I'm going to leave it at that. I'm about to run this particular code several hundred thousand times, so any bit of execution time I can shave is helpful.

0 Kudos
Message 3 of 3
(2,511 Views)