I am trying to execute this code in SimTalk:
s : real;
s := z_lognorm(1, 9.1453, 1.7264);
It works as I presented it here, but when I change the expression to include boundaries, e.g.
s:= z_lognorm(1, 9.1453, 1.7264, 78, 448000);
The error message is "The maximum number of consecutive trials for sampling a random value has been exceeded..."
Can anyone please help me to understand this error?
Solved! Go to Solution.
You want to generate outcomes in the range 78 to 448000, whereas the mean of your distribution is 9.14.... It means that nearly all the sampled values will be thrown away. You can check it by recording the samples from the unbounded distribution and check how many are at or above 78.
I am not sure why you chose this distribution with these settings, but either one seems not correct.
The best thing is to reread the documentation. The parameters can be a bit confusing, though they make sense on the Plant Simulation side.
The problem is most likely the parameter mu. In the software it denotes the expected value. However, in the texts about this distribution, there is often also mention of a parameter mu, which is used in combination with sigma to calculate the expected value. Hence, two times mu, yet each with a different meaning.
I hope this helps you to arrive at the correct settings...