04-30-2019 04:10 PM
Then you should be using the wire that comes out of function A! Not the original k wire. So if you need a second random number generator, then put it in.
04-30-2019 04:42 PM - edited 04-30-2019 04:44 PM
@Hamdi30 wrote:
Given you example, I need k to be updated to k-prime for function B before the loop repeats, and using the same random number generator. Hope this makes clear what I am looking for. Thanks.
No, it makes no sense!
Why does it have to be the same? if you need more than 1 random numbers, you can place multiple generators.
Still, from your formula they cannot be independent, but just time (or k-) shifted, so you need to maintain the correlations and keep a history of at least the last 5 points.
Do you have a web link that describes the algorithm you are trying to implement? What's the purpose of all this? What does it all mean? Just having some random numbers dancing incoherently is not really informative or interesting.
04-30-2019 04:55 PM
Again, I need both functions using “one” random number generator (rng). And the result of function A should be used as input to function B. This can be done easily.
The hard part is the following. Given there is a while loop iterates every period of time.
In one iteration (name it k), I need function A uses the generated number of the rng. Then after 5 k or five iterations, function B uses the generated number of the rng. In other words, I need each function (inside the while loop) works only and every specific number of while-loop’s iterations. For example, if function A uses the generated number x at iteration number k and performs the calculations, the output of it will be used by function B but after 5 iterations. Please note that after 5 iterations, the x value should be updated ( given that a new random number generated in each iteration from the “same source” not a different rng.
04-30-2019 04:57 PM
And that is what you use shift registers for! Or even feedback nodes. The values you put into either can be returned 1 to N iterations later.
I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
Learn LabVIEW
04-30-2019 05:07 PM
Currently I don’t have access to my laptop and using my cellphone to reply to your comments. I don’t need two random number generators because I am using a “ similar” vi that mimics my original vi. The origin one has one source of input comes from a device called opal-rt through a communication network uses dnp3 protocol which is mostly not supported by many labview basic licenses. That’s why I simplified what I need in a “similar” vi and a diagram.
The one random number is really a mimic to what I have in the real vi. Hope now makes sense.
04-30-2019 05:12 PM - edited 04-30-2019 05:22 PM
Again, please give us a web link that describes the algorithm. Does it have a name?
Maybe something like this? (You can initialize the array with anything you want but discard the first five values later)
04-30-2019 05:18 PM
Altenbach,
Do you need a wire from the random number into the element of the right hand side in the IPE?
04-30-2019 05:20 PM - edited 04-30-2019 05:31 PM
@RavensFan wrote:
Do you need a wire from the random number into the element of the right hand side in the IPE?
Yes. 😄
(I corrected it...)
04-30-2019
05:30 PM
- last edited on
04-30-2019
05:32 PM
by
altenbach
I think I am getting very close. The algorithm is not on the web—I am developing it for my PhD. I will definitely share it not only with you but also with the world once I complete it. Now, could you please share your last vi, please. I think you are right I need to understand the shift register very well. Thank you again.
@altenbach wrote:
Again, please give us a web link that describes the algorithm. Does it have a name?
Maybe something like this? (You can initialize the array with anything you want but discard the first five values later)
04-30-2019 05:43 PM
Here's a version that initializes with zeroes instead (probably preferred). Modify as needed.
Make sure you completely understand every single part of it!