Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
A cup of tea at 90 degrees cools in a room at 20 degrees. Newton's law of cooling says , with in minutes. Use Euler's method with the steps , and minutes to find the temperature after 30 minutes. The exact answer is . How does the error change when the step is halved?
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
Plan. One loop for each step size. In each step, the temperature changes by the rate times the step.
Check. The exact temperature is 23.485 degrees. Euler gives 22.967, 23.225 and 23.355, with the errors 0.518, 0.260 and 0.130. Each time that the step is halved, the error is also halved, because Euler's method is first order.
Answer: 22.967, 23.225 and 23.355 degrees. The exact value is 23.485. The error halves when the step halves.
Log in to join the discussion.
Loading…