A tridiagonal matrix model for multistage flash desalination plants