Answers to these exercises are available here. If you obtained a different (correct) answer than those listed on the solutions page, please feel free to post your answer as a comment on that page.

**Exercise 1**

Recall the previous initial values of all parameters (t,k,S,ntimesteps, time step). It is better to use the same script as the previous exercise so that we can directly compare the original models to the modified one (based on error fixing approach on this exercise). Create a new empty matrix to store the following result of the calculation.

**Exercise 2**

Create a loop of calculation that includes the rounding up process.

**Exercise 3**

Plot the revised model on the same graph as the plot of the original model. Make notes of the performance of the model and where the error on the model occurred.

**Exercise 4**

Now, what happens if we change the time step? Recall all parameters on the original model, but change the final time step. Create a new output matrix for the output.

**Exercise 5**

Re-run the loop with the new parameter.

**Exercise 6**

Re-plot the original model and plot the time step reduced model. Models with longer time steps simulate lower water levels; why? How do we investigate which one is closer to the correct values?

**Exercise 7**

Create a regression equation from the data-set. Use it to compare results from analytical (regression equation) and the latest revised model visually. What can be inferred from it?

**What's next:**

- Explore all our (>1000) R exercises
- Find an R course using our R Course Finder directory
- Subscribe to receive weekly updates and bonus sets by email
- Share with your friends and colleagues using the buttons below

## Leave a Reply