During the initial period, when the heater is not yet functioning at peak efficiency the heating will increase the temperature inside the building at a rate given by the following equations. During the initial period when the air conditioner is not yet functioning at peak efficacy the air conditioner will decrease the temperature inside the building at a rate given by the same equations.
Interval = (Time since turning on / 2.0 )  3.0
Factor multiplying Temperature change per minute = exp( Interval) / ( 1 + exp(Interval) )
These equations can also be used after the heating or air conditioner reaches peak efficiency. These equations converge to 1, so after the heating or air conditioner reach peak efficiency these equations will always give a value of 1.
NOTE: the value of these equations needs to be multiplied by the RATE TEMPERATURE CHANGES. The RATE TEMPERATURE CHANGES is EITHER the change in temperature inside the building in degrees Celsius per minute caused by heat being extracted by the air conditioning OR the change in temperature inside the building in degrees Celsius per minute caused by the heat being generated by the heating .Temperature change in degrees per minute = Factor multiplying Temperature change per minute * RATE TEMPERATURE CHANGES
Temperature at end of this interval = Temperature at the start of the interval + temperature change due to heat escaping during the this interval + temperature change due to heat generated by the heating system during this interval + temperature change due to heat removed by the cooling system during this interval
i have a:
...rate of .05 for heat escape w/o cooling or heating
...rate of 0.10 for heat escape w/ cooling
...rate of 0.125 for heat increase w/ heating
...Starting temp=38.00
...Time interval 3.50
i can't seem to find the temp at the ending interval?
this is what i tried doing:
#include<iostream>
#include<cmath>
using namespace std;
int main ()
{
double intervals=0.00;
double tempPerMin=0.00;
double tempAtEnd=0.00;
double naturalChange=0.00;
double coolChange=0.00;
double heatChange=0.00;
intervals=(3.5/2.0)3.0;
tempPerMin=(exp(intervals))/(1+exp(intervals));
naturalChange=(0.05)*tempPerMin*3.5;
coolChange=(0.1)*(tempPerMin)*3.5;
heatChange=(0.125)*(tempPerMin)*3.5;
tempAtEnd=38.00+coolChange+naturalChange+heatChange;
cout<<tempAtEnd;
return 0;
}

the temperature at the end of the interval is suppose to be 37.81 but i can't get the answer. I'm pretty sure this is a logical error from the equations i used but i can't seem to find it. Any hints?