Application of Integrable Systems to Phase Transitions