Optimising Principle for Non-Equilibrium Phase Transitions and Pattern Formation with Results for Heat Convection