ruby calculation error

For general discussion related FlowStone
Post Reply
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

ruby calculation error

Post by tester »

I'm getting strange calculation error in ruby schematic.

What I'm missing here?
Attachments
rubyerror.fsm
(865 Bytes) Downloaded 898 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: ruby calculation error

Post by tulamide »

Nothing. You're just working with single precision values from green, and output to green (which converts from Ruby's double precision back to single precision). If you need accuracy, stay in Ruby for both input data, multiplication factor and output data. (Enter "skuk2" as last line in the RubyEdit and look at the values in the info pane to see what I mean)
"There lies the dog buried" (German saying translated literally)
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: ruby calculation error

Post by tester »

So this amount of error will not propagate and kill the statistics?
Because equations are made specifically for statistics.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: ruby calculation error

Post by tulamide »

With this exact structure (input once from green, output once to green) it won't propagate. But if you use the output on further calculations, it will. That's why I said, stay in Ruby. It is easy to load data directly into Ruby, and also to save it directly from Ruby. And visually presenting data can also be done from within Ruby.

But if you absolutely need to go to green, then Ruby and again green, just make sure to do the translations/conversions only once.
"There lies the dog buried" (German saying translated literally)
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: ruby calculation error

Post by tester »

Ok., thanks. I think in my case - rounding to 3rd place should fixe the problem. What I was worried were high output changes from small recalc differences, but maybe i't's not the case (structure of equations).
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Post Reply