Assignment 02

Assignment 2 – Interpolation

Outcomes

Learn to use arrays
Learn to use variables and do more complex calculations.

Assignment

A rain gage was read at the following times with the following values. The gage was designed so that when the gage detected a significant change in rainfall intensity it took a measurement.

Time (hr) 0 1 2 5 7 8 10 12 15
Rainfall (in) 0 0.4 0.6 1.3 2.1 2.9 3.4 3.7 3.9

Use this data and assuming the rainfall rates were essentially linear between each measurement.

Write a program that allows the user to enter any time between 0 and 15 and give an estimate of the total rainfall. Use this program to calculate the total rainfall at all non-measured hours and submit these as results in your report.

Generate an Engineering Report (see guidelines) with the solution and the methodology used to solve the problem. Submit the report as a document (Word or PDF). It should include the code and screen captures of running the code along with full explanation of the code (which can be done as comments within the code).

Materials

Lecture 2 – https://youtu.be/6ew33nLbQIA – Covers Python with creating an interpolation.

Python Tutorial – https://www.w3schools.com/python/default.asp  – You should go over Lists, Arrays, and Conditions.

The Lectures Page has more video and information on the programming for this and all the other assignments. You should look at the lectures available.

Discuss additional resources and solution methodologies on the discussion boards.

Output

Your output should complete all missing spaces in the rainfall table. This is the most efficient method of presenting the results.

Time (hr)01234 56 789101112131415
Rainfall (in)00.40.6??1.3?2.12.9??3.4?3.7??3.9