Mathematical Analysis Of A Geothermal System