question

立洲 avatar image
0 Likes"
立洲 asked Jason Lightfoot commented

how to calculate mean and standard deviation

I want to collect and calculate the mean and standard deviation in the Global Table. I would like to ask how to use Process Flow to calculate


how to calculate mean and standard deviation.fsm

FlexSim 20.0.10
meanstandard deviationcalculate
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Jason Lightfoot commented


  1. Table gt1=Table("GlobalTable1");
  2. int numrows=gt1.numRows;
  3. string sql="SELECT SUM([Process time])/count(*) FROM GlobalTable1";
  4. Table result=Table.query(sql);
  5. double mean=result[1][1];
  6. gt1[numrows]["Mean"]=mean;
  7. sql="SELECT SUM(Math.sqr([Process time]-"+string.fromNum(mean,6)+")) FROM GlobalTable1";
  8. result=Table.query(sql);
  9. gt1[numrows]["SD"]=Math.sqrt(result[1][1]/numrows);


· 7
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.