Solving the Profit Analysis of Energy Storage and Heat Dissipation