取消
显示结果 
搜索替代 
您的意思是: 

Random Sample not updated

已解决!
转到解答

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.

0 项奖励
11 条消息(共 21 条)
1,904 次查看

@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.

0 项奖励
12 条消息(共 21 条)
1,893 次查看

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. 

0 项奖励
13 条消息(共 21 条)
1,890 次查看

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

0 项奖励
14 条消息(共 21 条)
1,888 次查看

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. 

0 项奖励
15 条消息(共 21 条)
1,885 次查看

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)

 

Meaninglessprocessing.png

 

0 项奖励
16 条消息(共 21 条)
1,881 次查看

Altenbach,

 

Do you need a wire from the random number into the element of the right hand side in the IPE?

17 条消息(共 21 条)
1,874 次查看

@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...)

18 条消息(共 21 条)
1,872 次查看

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)


 

0 项奖励
19 条消息(共 21 条)
1,868 次查看
解答
已被主题作者 Hamdi30 接受

Here's a version that initializes with zeroes instead (probably preferred). Modify as needed.

Make sure you completely understand every single part of it!

 

Meaninglessprocessing2.png

0 项奖励
20 条消息(共 21 条)
1,859 次查看