Cancel
Showing results for 
Search instead for 
Did you mean: 

Lognormal distribution gives error in SimTalk

Good day

 

I am trying to execute this code in SimTalk:

 

is
 s : real;
do
 s := z_lognorm(1, 9.1453, 1.7264);
end;

 

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?

3 REPLIES

Re: Lognormal distribution gives error in SimTalk

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

 

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.


Gert Nomden
Senior Consultant | Tecnomatix Product Manager
cardsplmsolutions.com

Re: Lognormal distribution gives error in SimTalk

Thank you Gert. It makes sense.

Re: Lognormal distribution gives error in SimTalk

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

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


Gert Nomden
Senior Consultant | Tecnomatix Product Manager
cardsplmsolutions.com