Week 8-9: Measure Heights of Campus Landmarks with Your Inclinometer#

Laboratory 4c
Last updated Oct 19, 2023

00. Content #

Mathematics

  • Calculating height using trigonometry

Programming Skills

  • Creating and reading CSV files

Embedded Systems

  • Use of self-built inclinometer

0. Required Hardware #

  • Inclinometer (made previously)

  • Rope

  • Measuring tape

Copy the file `student_info.py` into the folder you are working in, then run this cell to put your name and email into this document

from student_info import show_info
show_info()

1. Put Your Inclinometer to Use #

Today, you will gather some data using the inclinometer you built before break. You should work in groups of 2 to 4 today. You should collaborate on your answers. If you find it more convenient, you all may work on one jupyter notebook, However, there is a written reflection for exercise 9, you will need to do that individually. Write the names of your group members here.

Write the names of your group members below.

(put your group members’ names here)

Review the method for measuring heights using an inclinometer and rope#

Attached is the document trig_handout.pdf, which describes a method for measuring the height of an object using only an inclinometer and a rope. Read it and get familiar with the method. Then work with your group members to answer the following questions:

Exercise 1 (10 pts)#

  • Why is it not necessary to measure your distance from the base of the object you are measuring?

  • Why is it important that the same person make the measurement at the near and far ends of the rope?

  • What would happen if the rope were not straight, or not pointed toward the object you are measuring?

Write Answers for Exercise 1 Below

Review the types of errors#

Look back at lab 2, where we first introduced error analysis. Work with your group members to answer the following questions:

Exercise 2 (10 pts)#

  • What are the four types of errors described in lab 2? Just list their names.

  • Identify at least five sources of error which might apply to the procedure for measuring the heights of buildings. You should include at least one example of a modeling error and at least two examples of measurement errors.

  • For each type of error you identified, describe a way you can reduce the effect of that error.

Write Answers for Exercise 2 Below

Measure a rope#

We have ropes available for you. Their lengths are unknown. You will have to figure out how long your rope is. A tape measure available, but it is not as long as your rope (long tape measures are expensive and bulky).

Exercise 3 (10 pts)#

Work with your group to figure out a method you can use to measure the length of your rope. Describe your method here. Carry out your procedure, and write down the length you find. Finally, give an estimate of the error in your measurement. How close do you think you are to the true length of the rope? How do you know?

Write Answers for Exercise 3 Below

2. Gather Data #

Attached is the file lab_record_sheet.pdf. It has pictures of five buildings, and a table for you to fill in. Print this out. You will record the measurer’s height, the length of rope, and the components of acceleration from your inclinometer. You will only need one inclinometer; choose one from your group to use. Record the acceleration components directly, not the angle for reasons which will become clear next week. You need to get at least three measurements of at least three buildings – a minimum of nine measurements. You can measure them in whatever order you like. If you have time, measure all five buildings. Here are some tips which you may find useful:

  • Measure each group members’s height, up to their eyeball. This will be easier to do before you go out, since you can use a tape measure. You may find it helpful to write the measurer’s name on the sheet, and fill in the height later.

  • Move the rope in between each measurement, and take turns measuring. This will reduce the chance of a systematic error, since you will be doing it a little different for each measurement.

  • If anything unusual happens with a specific measurement, write that down as well. This will make it easier to remember what has happened when you are reviewing the data, and possibly help explain the errors you find.

  • If you don’t have room to lay out your whole rope, fold it in half. Alternately, make marks along your rope at known distances. Make sure to record the method you choose.

  • Your answers will be more accurate if you place the near end of the rope close to the object you are measuring, and the far end far away.

Before you go, describe the procedure you will use to your instructor. Once you have explained your procedure, go ahead and start measuring!

3. Fill in a Table #

Exercise 4 (10 pts)#

Run the following code cell in order to download the file building_heights.csv.

%%sh
wget -q -N https://raw.githubusercontent.com/TheDataScienceLabs/DSLab_Calculus/main/book/labs/4_measure_tall_things/c_make_the_measurements/building_heights.csv

Next, open the file, and fill in the data you collected. Then, run the cell below which will load and display your answers.

Write Answers for Exercise 4 Below

import numpy as np
import pandas as pd

data = pd.read_csv('building_heights.csv')
display(data)
k = data['k'].to_numpy()
r = data['r'].to_numpy()
near_ax = data['near ax'].to_numpy()
near_ay = data['near ay'].to_numpy()
near_az = data['near az'].to_numpy()
far_ax = data['far ax'].to_numpy()
far_ay = data['far ay'].to_numpy()
far_az = data['far az'].to_numpy()

4. Describe Your Experience #

Any time you gather data, it is good to produce a written reflection on what happened. Together with your group members, answer the following questions:

Exercise 5 (15 pts)#

  • Approximately how long did you spend on each part of the process? Did any parts take longer than expected?

  • Did any surprises occur while you were gathering data? Did you notice any sources of error which you did not expect?

  • Which of your measurements do you suspect to be the most accurate? Which do you suspect to be the least accurate?

Write Answers for Exercise 5 Below

5. Compute Some Answers #

Remember the formula we found in trig_handout.pdf:

\[\begin{align*} h = \frac{r}{\cot \theta -\cot \phi}+k \end{align*}\]

It has terms \(\cot\theta\) and \(\cot\phi\). We will need to compute these from the data you gathered – the components of acceleration (x, y and z). In order to calculate \(\theta\) and \(\phi\), you can plug the acceleration components (y and x in this case) into the following formula to get the angle in degrees:

\[\begin{align*} \theta\ and\ \phi = \tan^{-1}(\dfrac{-x}{y}) \cdot \dfrac{180}{\pi} \end{align*}\]

Exercise 6 (10 pts)#

While it is possible to directly calculate \(\cot\theta\) and \(\cot\phi\), there is a more direct way. After reading through avoiding_trig_calculations.pdf, find a simpler way to calculate \(h\), reducing the use of trig functions.

HINT: When plug in our formula for \(\theta\) and \(\phi\) into the cotangent, we will end up with \(\cot(\tan^{-1}(\frac{-x}{y}))\)

Write Answers for Exercise 6 Below

Check if your angles are reasonable#

Exercise 7 (10 pts)#

Use the first formula you found in exercise 6 to compute \(\theta\) and \(\phi\) for the data you collected. Note that the components of acceleration are available in numpy arrays, near_ax, near_ay, etc. Then, write two to three sentences about whether you think your answers are reasonable. If you think your answers are not reasonable, figure out what went wrong.

Write Answers for Exercise 7 Below

# write some code here to find theta and phi

(write your statement about the reasonableness of your answers here)

Find the heights#

Exercise 8 (10 pts)#

Compute the height \(h\) of each building using the second formula from exercise 6. Then, comment on whether your answers are reasonable. Based on the range of values you got, how precise do you think your answers are? Next time, we will explore a way to figure out exactly how accurate your answers are. For now, take an educated guess and explain how you made your guess.

Write Answers for Exercise 8 Below

#compute h here

(comment on reasonableness here)

6. Reflect on the Lab #

Answer this part on your own – your answer should be different from your teammates’.

Exercise 9 (15 pts)#

How did the lab today go? Write two paragraphs explaining how you feel about it. Any answer which has at least two full paragraphs will receive full credit. If you need an idea, here are some things you could discuss:

  • Which parts did you feel you did well? How did you contribute to your group?

  • What, if anything, have you learned today?

  • Are there any topics we discussed today which you feel you don’t fully understand yet? Where is there room for you to grow?

  • What parts of the lab can the instructors improve? Do you have any suggestions?

Write Answers for Exercise 9 Below