<%@ Page Title="" Language="C#" MasterPageFile="~/Default.master" AutoEventWireup="true" CodeBehind="Q077.aspx.cs" Inherits="ON7AMI_2012.BookShelf.Physics.SolutionsPhysicsForEngeneersAndScientistsInternational.Q077" %> Q077 - Physics For Engineers And Scientists - Solutions

Question 77 - Review - Chapter 1

Problem:

For many years there was a speed limit in the United States on the federal highways of 55 mi / h

Question:

a) How much is this in km / h?
b) How much is this in feet per second?
c) How much is this in m / s?

Solution:

One mile = 1.609 km

In [1]:
# Berekeningen
mile_km = 1.60934
speed_mi_h = 55
speed_km_h = speed_mi_h * mile_km
print(f'The speed in km/h = {speed_km_h:5.3} km/h')
The speed in km/h =  88.5 km/h

One feet = 0.3048 m = 3.048e-4 km

One hour = 3600 seconds

In [2]:
feet_km = 3.048e-4
hour_sec = 3600
speed_feet_h = speed_km_h / (hour_sec * feet_km)
print(f'The speed in Feet per second = {speed_feet_h:.2g} ft/s')
The speed in Feet per second = 81 ft/s
In [3]:
km_m = 1e-3
speed_m_s = speed_km_h / (hour_sec * km_m)
print(f'The speed in meter per second = {speed_m_s:.2g} m/s')
The speed in meter per second = 25 m/s

Alternative solution:

Alternatively we can make python do the conversion fully automatic by using Library Pint

The correct calculation and conversion is done entirely with the built-in logic.

In [4]:
# Same using Pint unit conversion lybrary
from pint import UnitRegistry
ureg = UnitRegistry()
speed_mi_h = 55 * ureg.mi / ureg.hour
speed_km_h = speed_mi_h.to(ureg.km / ureg.hour)
speed_ft_s = speed_mi_h.to(ureg.feet / ureg.sec)
speed_m_s = speed_mi_h.to(ureg.m / ureg.sec)
print(f'The speed in mi/h = {speed_mi_h:5.3}')
print(f'The speed in km/h = {speed_km_h:5.3}')
print(f'The speed in ft/s = {speed_ft_s:5.3}')
print(f'The speed in m/s = {speed_m_s:5.3}')
The speed in mi/h = 55.0 mile / hour
The speed in km/h = 88.5 kilometer / hour
The speed in ft/s = 80.7 foot / second
The speed in m/s = 24.6 meter / second