Cancel
Showing results for 
Search instead for 
Did you mean: 

Next interesting calculation "feature" in PlantSimulation

Builder
Builder

It looks like, that at least PlantSimulation 10.1.12 has some problems with large values:

 

Having the following code for calculating a cummulative poisson probability:

is
do
    local v_quantil := -1;
    local v_lambda := 190.2363636363637;
    local v_result := 0.0;
    repeat
        v_quantil := v_quantil + 1;
        v_result := v_result + (pow(v_lambda, v_quantil) / gamma(v_quantil + 1)) * exp(-v_lambda);
    until v_result >= 0.8;

end;

 

The code stops when reaching v_quantil = 136 providing a value of "1.#INF" for v_result.

v_result = "1.#INF"

 

Actually it should continue far ahead of 191!

1 REPLY

Re: Next interesting calculation "feature" in PlantSimulation

Siemens Phenom Siemens Phenom
Siemens Phenom

The CPU computes floating point values in the IEEE 754 double precision format. The maximum representable value is about 1e308.

The sub-expression

    pow(v_lambda, v_quantil)

with

    v_lambda=190.2363636363637, v_quantil=136

is greater than the maximum value and will therefore become infinite.

If you divide an infinite value by any positive value, it will remain infinite.

_________________________________________________________________
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.