Page 69
Identify a problem worth studying and list the variables that affect the behavior you have identified. Which variables would be neglected completely? Which might be considered as constants initially? Can you identify any submodels you would want to study in detail? Identify any data you would want collected.
A problem worth studying is looking at how the cost of mainting a truck fluctuates over the life of a truck. Variables that should be part of the model are: Truck Model, Age, MPG, maintenance cost, part needing replacing. I would ignore average speed of the trucks because of the difficultly to accurately record. A good constant would be the model of the truck. A submodel that would be good is to look at how maintenance costs are tied to the type of weather that the types of trucks endure. Data I would want to collect is maintenance cost, parts replaced, age, mileage, and MPG for the the past 25 years.
Page 79
Determine if the data set supports the stated proportionality model.
library(ggplot2)
y <- c(0,1,2,6,14,24,37,58,82,114)
x <- c(1,2,3,4,5,6,7,8,9,10)
x3 <- x^3
k <- y / x3
prop <- x3 * k
mk <- median(k)
propm <- mk * x3
data <- data.frame(x,y,x3,k,prop,propm)
knitr::kable(data)
| x | y | x3 | k | prop | propm |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 0.0000000 | 0 | 0.1115556 |
| 2 | 1 | 8 | 0.1250000 | 1 | 0.8924444 |
| 3 | 2 | 27 | 0.0740741 | 2 | 3.0120000 |
| 4 | 6 | 64 | 0.0937500 | 6 | 7.1395556 |
| 5 | 14 | 125 | 0.1120000 | 14 | 13.9444444 |
| 6 | 24 | 216 | 0.1111111 | 24 | 24.0960000 |
| 7 | 37 | 343 | 0.1078717 | 37 | 38.2635556 |
| 8 | 58 | 512 | 0.1132812 | 58 | 57.1164444 |
| 9 | 82 | 729 | 0.1124829 | 82 | 81.3240000 |
| 10 | 114 | 1000 | 0.1140000 | 114 | 111.5555556 |
f1 <- ggplot(data) + geom_line(aes(x=x, y=y)) + geom_line(aes(x=x, y=propm), colour="blue") + labs(title="Proportionality, Blue = model")
f1
Page 94
x <- c(17,19,20,23,25,28,32,38,39,41)
y <- c(19,25,32,57,71,113,123,252,259,294)
Board feet = 12 x 12 x 1
\[V = \pi r^2 h\] and the ratio of heights are close to 1 since we assume that all trees are approximately the same height. So as a result r1/r2 != k. K is going to be approximately 1. So the model might look like \[V = k(d/2)^2\].
V <- y * 10 * 144 #144 is board
dh2 <- (x * 0.5)^2
df1 <- data.frame(x,y,dh2,V)
k <- V[10] / dh2[10]
k
## [1] 1007.4
V3 <- k * dh2
Vf <- V3 / 144
df2 <- cbind(df1, V3, Vf)
#Model vs data
f1 <- ggplot(df2) + geom_point(aes(x=x, y=y)) + geom_line(aes(x=x, y=Vf / 10))
f1
If height is proportional to the diameter, taller trees have larger diameters and vice versa. Geometric similarity is at play in this case because ratio of diameters would equal the ratio of the heights. So Volume would be equal to ratio x diameter cubed.
\[V = kd^3\]
y3 <- y * 10 * 144
x3 <- x ^ 3
df <- data.frame(x, y, x3, y3)
k <- y3[10] / x3[10]
k
## [1] 6.142685
in3 <- k * x3
Vf <- in3 / 144
df <- cbind(df, in3, Vf)
#Model vs data
f2 <- ggplot(df) + geom_point(aes(x=x, y=y)) + geom_line(aes(x=x, y=Vf / 10))
f2
The second model is better because it fits the points better.