Comp Assignment 1
Comp Assignment 1
D UE DATE
This assignment is due Sunday, May 14, 23:59.
1python: scipy.special.factorial
STATISTICAL PHYSICS: COMPUTATIONAL ASSIGNMENT I 3
In your notebook, give the number of roulette tables N above which the error satisfies the
0.5 % criterion.
(7) (10 Points) Customers are complaining that red seems to appear more often than black.
The casino performs an investigation. Suppose the probability for obtaining red on any
table is P r (for black therefore it is 1 − P r ). Find a formula for the probability of getting n
times red on N roulette tables.
The staff has performed many experiments with the roulete tables and find that the most
probable number of reds when running 50 roulette tables is 30. With this information, find
P r (simply experiment with different values of P r , there is not a unique answer).
Plot the probability of getting n = 0, 1, 2, ..., 50 reds for this case together with a plot for
the case where the roulette tables are fair (equal probability for red and black).
In your notebook, give the formula for the probability of having n reds. Give the value of P r .
Plot the probabilities against the number of reds, for fair and for unfair tables.
3. W EATHER BALLOON
Consider a Helium filled weather balloon that is released at sea level and rises with a fixed ve-
locity of 30 m/s. We will consider the Helium to be an ideal gas.
(8) (3 points) Starting from the first law, illustrate that the time behavior of temperature is
given by
3 dT dV
nR = Q0 − p
2 dt dt
where n is the number of moles, R is the universal gas constant and Q 0 is the heat transfer
per unit time toward the balloon which can be approximated as 10(T ai r − T ).
In your notebook, give the derivation.
(9) (3 points) Use the ideal gas law to rewrite the work term and obtain the energy balance as
5 dT nRT d p
nR = Q0 +
2 dt p dt
In your notebook, give the derivation.
The air pressure as function of the elevation h is aproximately an exponential function, i.e.
g M ai r h
−
p ai r (h) = p 0 e RT0
where the subscript 0 signifies at zero elevation (sea level), g is the gravitational accelera-
tion (9.81 m/s 2 ) and M ai r is the molar mass of air (0.029 kg/mol). Further, we assume the
air temperature decreases linearly with elevation, i.e.
T ai r (h) = 288 − 0.0065h
and the pressure in the balloon is equal to the outside air pressure. The balloon contains
50 moles of Helium.
(10) (3 points) The rate of change of the pressure of the balloon is of the form
dp
=Kp
dt
Show that K = −(g M ai r /RT0 ) ddht .
In your notebook, give the derivation.
The temperature of the balloon is thus described by an ordinary differential equation. We
4 STATISTICAL PHYSICS: COMPUTATIONAL ASSIGNMENT I
will solve it using the Euler-explicit method. For an ODE of the form, d T /d t = f (T ) a single
time step reads
T n+1 = T n + ∆t f (T n )
Here, ∆t is the numerical time step. T n is the present temperature and T n+1 is the temper-
ature at the new time level.
(11) (15 points) Determine and plot the temperature in the balloon as a function of elevation
(between 0 and 5000 m). In the same plot add the case where there is no heat transfer with
the air.
In your notebook, provide a plot of the temperature as function of height for the cases with
and without heat transfer.
Hint: Use at least 100 time steps otherwise stability issues may occur.
Submit this assignment following the instructions on the first page.