85
48
1 Computing with formulas
(N =kgm/s2). Also print the ratio of the drag force and the gravity force.
DefineC
D
,�,A,V,m,g,F
d
,andF
g
as variables, and put a comment
with the corresponding unit. Use the program to calculate the forces on
the ball for a hard kick,V = 120km/h and for a soft kick,V = 10km/h
(it is easy to mix inconsistent units, so make sure you compute withV
expressed in m/s). Filename: kick.py.
Exercise 1.12: How to cook the perfect egg
As an egg cooks, the proteins first denature and then coagulate. When
the temperature exceeds a critical point, reactions begin and proceed
faster as the temperature increases. In the egg white, the proteins start
to coagulate for temperatures above 63 C, while in the yolk the proteins
start to coagulate for temperatures above 70 C. For a soft boiled egg,
the white needs to have been heated long enough to coagulate at a
temperature above 63 C, but the yolk should not be heated above 70 C.
For a hard boiled egg, the center of the yolk should be allowed to reach
70 C.
The following formula expresses the timet it takes (in seconds) for
the center of the yolk to reach the temperature T
y
(in Celsius degrees):
t=
M2/3cρ1/3
Kπ2(4π/3)2/3
ln
�
0.76
T
o
−T
w
T
y
−T
w
�
.
(1.9)
Here,M,ρ,c, andK are properties of the egg:M is the mass,ρ is the
density,c is the specific heat capacity, andK is thermal conductivity.
Relevant values areM = 47 gfor a smallegg andM =67 gfor alarge egg,
ρ=1.038 gcm−3, c=3.7 Jg−1K
−1
,andK = 5.4· 10−3 Wcm−1K
−1
.
Furthermore,T
w
is the temperature (in C degrees) of the boiling water,
andT
o
is the original temperature (in C degrees) of the egg before being
put in the water. Implement the formula in a program, setT
w
=100
CandT
y
=70 C, and computet for a large egg taken from the fridge
(T
o
=4 C) and from room temperature (T
o
=20 C). Filename: egg.py.
Exercise 1.13: Derive the trajectory of a ball
The purpose of this exercise is to explain how Equation (1.6) for the
trajectory of a ball arises from basic physics. There is no programming
in this exercise, just physics and mathematics.
The motion of the ball is governed by Newton’s second law:
F
x
=ma
x
(1.10)
F
y
=ma
y
(1.11)