Solving for T gives
Notice that the temperature of the house varies between -1 and 1 degree
centigrade. Notice also that the maximum and minimum temperatures are at
around t=0.05 and t=0.505 respectively. (These are very crude estimates
from visual inspection of the plot.) Since t is measured in days, these
translate to around 1 pm and 1 am respectively. To get more precise estimates,
complexify the expression for T. T is the real part of
0.00000 1.00000 1.00000 2.00000 0.32078 0.33333 4.00000 0.19347 0.20000 6.00000 0.13885 0.14286 8.00000 0.10838 0.11111 10.00000 0.08891 0.09091Here are plots of the exact solution (shown as a solid line) and the one obtained from Euler's method (shown as a dotted line):
h = 1.0; [T,X] = em(h); error = 1./(1.+T); [T',error']to display a table of errors as a function of T for the increment h=1.0. Repeat for the other values of h. Here's a summary of what I got using Octave, with error values rounded to 5 decimal places.
h=1 | h=0.5 | h=0.1 | h=0.01 | |
t=5 | 0.16667 | 0.02776 | 0.00503 | 0.00050 |
t=10 | 0.09091 | 0.01080 | 0.00200 | 0.00020 |
Notice how the errors decrease as the increment decreases.