simulation and plotting with postgres server