Skip to contentSkip to lesson map

Application to Data

Lesson map

Objectives

  1. Apply skills learned in Block 1 to data.

Plutonium Record

The table lists yield readings for a bare plutonium sphere by neutron generation. The source is Bridgman, Introduction to the Physics of Nuclear Weapons Effects, Table 2-10. The input generation counts cycles of neutron multiplication. The output yield_KT is the energy released so far, in kilotons (KT).

First 24 readingsTen later readings
generationyield (KT)generationyield (KT)generationyield (KT)
16.66×10−186.66\times10^{-18}401.11×10−31.11\times10^{-3}527.92
53.12×10−163.12\times10^{-16}412.55×10−32.55\times10^{-3}5311.50
101.93×10−141.93\times10^{-14}425.80×10−35.80\times10^{-3}5414.70
151.19×10−121.19\times10^{-12}430.01325517.00
207.32×10−117.32\times10^{-11}440.02985618.50
254.54×10−94.54\times10^{-9}450.06685719.40
302.83×10−72.83\times10^{-7}460.1485819.90
351.78×10−51.78\times10^{-5}470.3235920.10
364.07×10−54.07\times10^{-5}480.6856020.20
379.31×10−59.31\times10^{-5}491.406120.30
382.13×10−42.13\times10^{-4}502.71
394.88×10−44.88\times10^{-4}514.87

1. Applying Block 1 to Data

Objective. Apply skills learned in Block 1 to data.

Example 1

Model the first 24 readings.

  • (a) Determine the model family that fits the readings.
  • (b) Estimate the parameters by hand from the first and last readings.
  • (c) Use fitModel() to find the best-fit model.
  • (d) Plot the fitted model over the readings.
ShowHide solution

(a) Plot the first 24 readings on a standard plot and on a semi-log plot, as the semi-log test of the Lesson 6 sheet, section 1, requires.

Figure
Figure

generation = c(1, 5, 10, 15, 20, 25, 30, 35,
36, 37, 38, 39, 40, 41, 42, 43,
44, 45, 46, 47, 48, 49, 50, 51)
yield_KT = c(6.66e-18, 3.12e-16, 1.93e-14, 1.19e-12,
7.32e-11, 4.54e-9, 2.83e-7, 1.78e-5, 4.07e-5,
9.31e-5, 2.13e-4, 4.88e-4, 1.11e-3, 2.55e-3,
5.80e-3, 0.0132, 0.0298, 0.0668, 0.148, 0.323,
0.685, 1.40, 2.71, 4.87)
plotPoints(yield_KT ~ generation)
plotPoints(log(yield_KT) ~ generation)

Each generation and yield pair in the first 24 readings is one point on each plot: the reading 4.87 at generation 51 is the highest point on the standard plot and the point (51,ln⁡4.87)≈(51,1.583)(51, \ln 4.87) \approx (51, 1.583) on the semi-log plot. R spells ln⁡(yield)\ln(\text{yield}) as log(yield_KT), because log() in R is the natural logarithm.

The standard plot is not linear, because the readings sit near 0 through generation 45 and rise steeply after it. The semi-log plot is close to linear from generation 5 to generation 44, because the slopes between consecutive points there all lie between 0.814 and 0.832. Between generations 5 and 10, for example, the semi-log slope is

ln⁡(1.93×10−14)−ln⁡(3.12×10−16)10−5≈0.825. \frac{\ln(1.93\times10^{-14}) - \ln(3.12\times10^{-16})}{10 - 5} \approx 0.825.

The readings through generation 44 therefore suit an exponential model:

yield=Cek generation. \text{yield} = Ce^{k\,\text{generation}}.

The semi-log plot bends down over the last readings, where the slope between generations 50 and 51 falls to

ln⁡4.87−ln⁡2.7151−50≈0.586. \frac{\ln 4.87 - \ln 2.71}{51 - 50} \approx 0.586.

Those last readings grow more slowly than the exponential model. Example 3 follows that slowdown into the later readings.

(b) The semi-log form of the exponential model is ln⁡(yield)=m generation+b\ln(\text{yield}) = m\,\text{generation} + b, with k=mk = m and C=ebC = e^{b}, as derived on the Lesson 5 sheet, section 4. The two points are the first and last readings on the semi-log plot, (1,ln⁡(6.66×10−18))(1, \ln(6.66\times10^{-18})) and (51,ln⁡4.87)(51, \ln 4.87). Substitute them into the slope formula of the two-point method (Lesson 6 sheet, section 2):

m=ln⁡4.87−ln⁡(6.66×10−18)51−1≈0.823. m = \frac{\ln 4.87 - \ln(6.66\times10^{-18})}{51 - 1} \approx 0.823.

Here the model keeps no horizontal shift, so that its CC compares directly with the fitted CC of part (c). Solve for the intercept bb, the height of the line at generation 0, from the first point:

b=ln⁡(6.66×10−18)−m(1)≈−40.373. b = \ln(6.66\times10^{-18}) - m(1) \approx -40.373.

Convert mm and bb to the exponential parameters:

k=m≈0.823,C=eb≈2.925×10−18.\begin{gather*} k = m \approx 0.823, \\ C = e^{b} \approx 2.925\times10^{-18}. \end{gather*}

In the figure, the filled points are the first and last readings. The dashed line through them has slope mm, and its height at generation 0 is bb.

Figure

Compute the same parameters in R, with every value stored at full precision:

y1 = log(6.66e-18)
y2 = log(4.87)
m = (y2 - y1)/(51 - 1)
b = y1 - m*1
k = m
C = exp(b)
k
C

R returns k=0.8226701k = 0.8226701 and C=2.925453×10−18C = 2.925453\times10^{-18}, the hand values at full precision.

(c) Fit the semi-log line to the two vectors from part (a), then convert its slope and intercept to kk and CC by the method of the Lesson 6 sheet, sections 4 and 5:

bomb_ln = fitModel(log(yield_KT) ~ m*generation + b)
coef(bomb_ln)
cf = coef(bomb_ln)
k = cf[1]
C = exp(cf[2])
C

R returns the slope m=0.824163m = 0.824163, the intercept b=−39.880049b = -39.880049, and C=4.789773×10−18C = 4.789773\times10^{-18}. The output of coef() names each number by its letter in the formula, so cf[1] is the slope mm and cf[2] is the intercept bb.

The fitted intercept is −39.880049−(−40.373)≈0.493-39.880049 - (-40.373) \approx 0.493 above the hand intercept of part (b), because fitModel() uses all 24 readings and the hand line uses two. The fitted CC is therefore about e0.493≈1.637e^{0.493} \approx 1.637 times the hand value. The best-fit model is

yield=(4.790×10−18) e0.824 generation. \text{yield} = (4.790\times10^{-18})\,e^{0.824\,\text{generation}}.

(d) Define the model from the stored CC and kk and draw it over the first 24 readings:

=2.2em bomb = makeFun(C*exp(k*generation) ~
generation)
plotPoints(yield_KT ~ generation)
plotFun(bomb(generation) ~ generation,
add = TRUE, col = "purple")
bomb(51)

Figure

The purple curve is the model, drawn with col = "purple". It stays within 0.01 kilotons of every reading through generation 47 and then rises above the readings. The last line returns 8.604304≈8.6048.604304 \approx 8.604 kilotons at generation 51, against the reading of 4.87.

Example 2

Use the exponential model of Example 1 to predict the yield at generation 61, and classify the prediction as an interpolation or an extrapolation.

ShowHide solution

Rebuild the model of Example 1 and evaluate it at generation 61:

generation = c(1, 5, 10, 15, 20, 25, 30, 35,
36, 37, 38, 39, 40, 41, 42, 43,
44, 45, 46, 47, 48, 49, 50, 51)
yield_KT = c(6.66e-18, 3.12e-16, 1.93e-14, 1.19e-12,
7.32e-11, 4.54e-9, 2.83e-7, 1.78e-5, 4.07e-5,
9.31e-5, 2.13e-4, 4.88e-4, 1.11e-3, 2.55e-3,
5.80e-3, 0.0132, 0.0298, 0.0668, 0.148, 0.323,
0.685, 1.40, 2.71, 4.87)
bomb_ln = fitModel(log(yield_KT) ~ m*generation + b)
cf = coef(bomb_ln)
k = cf[1]
C = exp(cf[2])
bomb = makeFun(C*exp(k*generation) ~ generation)
bomb(61)

R returns a predicted yield of 32,659.54 kilotons at generation 61. The prediction is an extrapolation as defined on the Lesson 10 sheet, section 6, because generation 61 lies outside the inputs of the first 24 readings, generation 1 to 51.

Example 3

The ten later readings run from generation 52 to generation 61. Compare the exponential model of Example 1 with four of them, at generations 52, 55, 58, and 61. State whether the model fits the ten later readings.

ShowHide solution

Rebuild the model of Example 1 and evaluate it at the four generations:

generation = c(1, 5, 10, 15, 20, 25, 30, 35,
36, 37, 38, 39, 40, 41, 42, 43,
44, 45, 46, 47, 48, 49, 50, 51)
yield_KT = c(6.66e-18, 3.12e-16, 1.93e-14, 1.19e-12,
7.32e-11, 4.54e-9, 2.83e-7, 1.78e-5, 4.07e-5,
9.31e-5, 2.13e-4, 4.88e-4, 1.11e-3, 2.55e-3,
5.80e-3, 0.0132, 0.0298, 0.0668, 0.148, 0.323,
0.685, 1.40, 2.71, 4.87)
bomb_ln = fitModel(log(yield_KT) ~ m*generation + b)
cf = coef(bomb_ln)
k = cf[1]
C = exp(cf[2])
bomb = makeFun(C*exp(k*generation) ~ generation)
bomb(c(52, 55, 58, 61))

R returns the four model values in the second column of the table, and the third column gives the readings from the Plutonium Record:

generationmodel (KT)reading (KT)model ÷\div reading
5219.627.922.5
55232.5117.0013.7
582,755.6419.90138.5
6132,659.5420.301,608.8

The exponential model does not fit the ten later readings. It is 2.5 times the reading at generation 52 and 1,608.8 times the reading at generation 61, because the later readings level off near 20 kilotons and the model grows without bound. The readings level off because the sphere expands until it is no longer critical and the chain reaction stops.

Example 4

Model all 34 readings.

  • (a) Determine the model family that fits the readings.
  • (b) Estimate the parameters by hand.
  • (c) Use fitModel() to find the best-fit model.
  • (d) Plot the fitted model over the readings.
ShowHide solution

(a) Plot all 34 readings on a standard plot with plotPoints(yield_KT2 ~ generation2), after entering the vectors as in part (c). A sigmoid model is reasonable, because the readings level off at both ends of the record: they stay below 0.07 kilotons through generation 45 and between 19.90 and 20.30 kilotons from generation 58 on. On this scale the early readings look flat at 0, although the semi-log plot of Example 1 shows them growing. The model is

yield=A⋅pnorm(generation,m,s)+v. \text{yield} = A\cdot\text{\rcmd{pnorm}}(\text{generation}, m, s) + v.

Here mm is the mean of the sigmoid, a different number from the semi-log slope mm of Example 1.

Figure

(b) Estimate the four parameters by the method of the Lesson 9 sheet, section 4. The figure marks each estimate on the readings from generation 40 on: the two levels vv and v+Av + A, the halfway point at the mean mm, and the spread ss as the input distance from mm to the five-sixths level.

Figure
  • The vertical shift vv is the level on the left, near 0 where the readings start: v=0v = 0.
  • The amplitude AA is the whole rise from the level on the left to the level on the right. The last four readings, from 19.90 to 20.30, sit near the level 20: A=20A = 20.
  • The mean mm is the input at the halfway output v+A/2=10v + A/2 = 10. The readings are 7.92 at generation 52 and 11.50 at generation 53. The output 10 lies (10−7.92)/(11.50−7.92)≈0.58(10 - 7.92)/(11.50 - 7.92) \approx 0.58 of the way between them:

    m≈52+0.58≈52.6. m \approx 52 + 0.58 \approx 52.6.
  • The estimate of the spread ss is the input distance from mm to the five-sixths level v+5A/6≈16.7v + 5A/6 \approx 16.7, which stands in for the pnorm(1) point (Lesson 9 sheet, section 2). The readings are 14.70 at generation 54 and 17.00 at generation 55. The output 16.7 lies (16.7−14.70)/(17.00−14.70)≈0.87(16.7 - 14.70)/(17.00 - 14.70) \approx 0.87 of the way between them, at about generation 54+0.87≈54.954 + 0.87 \approx 54.9:

    s≈54.9−52.6=2.3. s \approx 54.9 - 52.6 = 2.3.

(c) Fit the sigmoid model as on the Lesson 9 sheet, section 5, with the hand estimates as the start values:

generation = c(1, 5, 10, 15, 20, 25, 30, 35,
36, 37, 38, 39, 40, 41, 42, 43,
44, 45, 46, 47, 48, 49, 50, 51)
yield_KT = c(6.66e-18, 3.12e-16, 1.93e-14, 1.19e-12,
7.32e-11, 4.54e-9, 2.83e-7, 1.78e-5, 4.07e-5,
9.31e-5, 2.13e-4, 4.88e-4, 1.11e-3, 2.55e-3,
5.80e-3, 0.0132, 0.0298, 0.0668, 0.148, 0.323,
0.685, 1.40, 2.71, 4.87)
generation2 = c(generation, 52, 53, 54, 55, 56,
57, 58, 59, 60, 61)
yield_KT2 = c(yield_KT, 7.92, 11.5, 14.7, 17.0,
18.5, 19.4, 19.9, 20.1, 20.2, 20.3)
bomb2 = fitModel(yield_KT2 ~ A*pnorm(generation2, m, s) + v,
start = list(A = 20, m = 52.6, s = 2.3, v = 0))
coef(bomb2)

The last line prints A=20.15251639A = 20.15251639, m=52.61711780m = 52.61711780, s=2.37144147s = 2.37144147, and v=0.02243469v = 0.02243469. The best-fit model is

yield=20.153⋅pnorm(generation,52.617,2.371)+0.022. \text{yield} = 20.153\cdot\text{\rcmd{pnorm}}(\text{generation}, 52.617, 2.371) + 0.022.

(d) The fitModel() call in part (c) stores bomb2. Draw bomb2 over all 34 readings:

=2.2em plotPoints(yield_KT2 ~ generation2)
plotFun(bomb2(generation2) ~
generation2, add = TRUE, col = "red")

Figure

The red curve is the model, drawn with col = "red". It lies within 0.17 kilotons of every reading, at both levels and along the rise between them.

Example 5

Use the sigmoid model of Example 4 to predict the yield at generations 47 and 53. Classify each prediction as an interpolation or an extrapolation, and compare each with the reading at that generation.

ShowHide solution

Rebuild the sigmoid model of Example 4 and evaluate it at generations 47 and 53:

generation = c(1, 5, 10, 15, 20, 25, 30, 35,
36, 37, 38, 39, 40, 41, 42, 43,
44, 45, 46, 47, 48, 49, 50, 51)
yield_KT = c(6.66e-18, 3.12e-16, 1.93e-14, 1.19e-12,
7.32e-11, 4.54e-9, 2.83e-7, 1.78e-5, 4.07e-5,
9.31e-5, 2.13e-4, 4.88e-4, 1.11e-3, 2.55e-3,
5.80e-3, 0.0132, 0.0298, 0.0668, 0.148, 0.323,
0.685, 1.40, 2.71, 4.87)
generation2 = c(generation, 52, 53, 54, 55, 56,
57, 58, 59, 60, 61)
yield_KT2 = c(yield_KT, 7.92, 11.5, 14.7, 17.0,
18.5, 19.4, 19.9, 20.1, 20.2, 20.3)
bomb2 = fitModel(yield_KT2 ~ A*pnorm(generation2, m, s) + v,
start = list(A = 20, m = 52.6, s = 2.3, v = 0))
bomb2(47)
bomb2(53)

R returns predictions of 0.2023269≈0.2020.2023269 \approx 0.202 kilotons at generation 47 and 11.39113≈11.39111.39113 \approx 11.391 kilotons at generation 53. Both predictions are interpolations, because 47 and 53 lie inside generations 1 to 61, the inputs of all 34 readings. At generation 53 the reading is 11.50, and the model is within 1 percent of it. At generation 47 the reading is 0.323, and the model is 37 percent low.

Example 6

Determine the first generation at which the sigmoid model of Example 4 gives a yield of at least 10 kilotons.

ShowHide solution

Evaluate the model at generations 52 and 53, where the readings cross 10 kilotons:

generation = c(1, 5, 10, 15, 20, 25, 30, 35,
36, 37, 38, 39, 40, 41, 42, 43,
44, 45, 46, 47, 48, 49, 50, 51)
yield_KT = c(6.66e-18, 3.12e-16, 1.93e-14, 1.19e-12,
7.32e-11, 4.54e-9, 2.83e-7, 1.78e-5, 4.07e-5,
9.31e-5, 2.13e-4, 4.88e-4, 1.11e-3, 2.55e-3,
5.80e-3, 0.0132, 0.0298, 0.0668, 0.148, 0.323,
0.685, 1.40, 2.71, 4.87)
generation2 = c(generation, 52, 53, 54, 55, 56,
57, 58, 59, 60, 61)
yield_KT2 = c(yield_KT, 7.92, 11.5, 14.7, 17.0,
18.5, 19.4, 19.9, 20.1, 20.2, 20.3)
bomb2 = fitModel(yield_KT2 ~ A*pnorm(generation2, m, s) + v,
start = list(A = 20, m = 52.6, s = 2.3, v = 0))
bomb2(52)
bomb2(53)

R returns 8.029908≈8.0308.029908 \approx 8.030 kilotons at generation 52, below 10, and 11.39113≈11.39111.39113 \approx 11.391 kilotons at generation 53, above 10. The model is increasing, because pnorm increases with generation and A≈20.153A \approx 20.153 is positive. So the first generation with a yield of at least 10 kilotons is generation 53.

Lesson map