Calculation of melting curves for DNA