In [1]:
import numpy as np

In [ ]:
def mean_life(half_life):
    return half_life / np.log(2)

In [10]:
def remaining(time, initial=1.0, half_life=1, t0=0):
    
    return initial * np.exp(-1 * (time - t0)/(mean_lifetime))

In [11]:
def problem_8_8_E():
    U238_halflife = 4.51e9 #years
    Th234_halflife = 21.4 / 365.25 #days / (days/years)
    Ph234_halflife = 6.75 / 24.0 / 356.25 # hours / (hours/day) / (days/year)
    
    initial_U234 = 1.0
    
    U234_halflife = 2.47e5 #years
    l_earth = 4.54e9 #years
    
    return remaining(time=l_earth, initial=1.0, half_life=U234_halflife)

In [29]:
print problem_8_8_E()


0.0

In [30]:
np.exp(-1000)


Out[30]:
0.0

In [ ]:
t = 4.5e9
lambda_1 = np.log(2) / 4.51e9
lambda_2 = np.log(2) / 2.47e5

In [33]:
N_0 = .0093 / np.exp(-lambda_1 * t)
print N_0


0.0185714353985

In [34]:
print ((N_0 * lambda_1) / (lambda_2 - lambda_1)) * (np.exp(-lambda_1 * t) - np.exp(-lambda_2 * t))


5.09362707891e-07

In [34]:


In [34]:


In [35]:
np.exp(5.0 / 25) / np.exp(5 / 35.)


Out[35]:
1.0588070577429671

In [36]:
np.exp(5/25.- 5/35.)


Out[36]:
1.0588070577429671

In [37]:
import matplotlib.pyplot as plt

In [38]:
plt.ion()

In [39]:
plt.plot(np.exp(np.linspace(0,100,100) * 1/(-.00001)))


Out[39]:
[<matplotlib.lines.Line2D at 0x117c6ec90>]

In [40]:
plt.show()

In [41]:
print 5


5

In [42]:
def n_initial(n_now, t, t_m):
    return n_now / (np.exp(-(t)/t_m))

In [46]:
print'U235 initial:', n_initial(6.49e-5, 4.5e9, 7.1e8 / np.log(2))


U235 initial: 0.0052502657816

In [45]:
print 'U238 initial:', n_initial(8.49e-3, 4.5e9, 4.5e9 / np.log(2))


U238 initial: 0.01698

In [51]:
def n_daughter_initial(n_now, np_initial, t, t_m):
    return n_now - np_initial * (1-np.exp(-t/t_m))




In [52]:
print 'Pb206 initial:', n_daughter_initial(.603, .01698, 4.5e9, 4.5e9 / np.log(2))


Pb206 initial: 0.59451

In [53]:
print 'Pb207 initial:', n_daughter_initial(.650, .00525, 4.5e9, 7.1e8 / np.log(2))


Pb207 initial: 0.644814896715

In [54]:
.6448 / .0612


Out[54]:
10.535947712418302

In [65]:
.1224 * 10.54


Out[65]:
1.290096

In [62]:


In [66]:
.59451 / .0613


Out[66]:
9.69836867862969

In [68]:
.1224 * 9.698


Out[68]:
1.1870352

In [63]:
(7.1e8 / np.log(2)) * np.log(((2.63 - 1.29) / 1.59e-2) + 1)


Out[63]:
4553996945.817317

In [64]:
'%3.2e' % (4553996945.817317)


Out[64]:
'4.55e+09'

In [70]:
(2.63 - 1.29) / (1-np.exp(-4.55e9/ (7.1e8/np.log(2)) ) )


Out[70]:
1.3559629047017809

In [72]:
.00525 / .01698


Out[72]:
0.3091872791519435

In [73]:
1.355 * .309


Out[73]:
0.418695

In [75]:
.419* np.exp(-4.55e9 / (4.5e9/np.log(2)))


Out[75]:
0.20789270474208665

In [76]:
1.187 + .417 * (1 - np.exp(-4.55e9 /  (4.5e9/np.log(2)) ) )


Out[76]:
1.3970996232041764

In [ ]: