Dynamic modeling of multistage flash desalination plants