The following code is reading in the csv (comma seperated value) file containing the data and changing the mass variable to a character. This allows the mass variable to be used as an ID value to split the table by. From there the data is rended into a plot, and the chart shows a Loess local curve fit, and a 50% linear quantile.
dataIn$Mass <- as.character(dataIn$Mass)
gg <- ggplot(data = dataIn, aes(x = Height, y = Length, group = Mass)) +
geom_smooth(aes(linetype = Mass, color = Mass)) +
geom_point() +
geom_quantile(aes(linetype = Mass, color = Mass), quantiles = 0.5)
ggplotly(gg, session = "knitr")
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## Smoothing formula not specified. Using: y ~ x
## Smoothing formula not specified. Using: y ~ x
## Smoothing formula not specified. Using: y ~ x
The following code takes the data for each mass and applying a linear fit to the data. This is then summarized to get R-squared values and to return coefficents for the equation, to create an equation that allows to determine the length of the cord that is required to get close to the target distance.
fit200 <- lm(df200$Length ~ df200$Height)
fit400 <- lm(df400$Length ~ df400$Height)
fit700 <- lm(df700$Length ~ df700$Height)
model_equation(fit200)
## [1] "df200$Length = - 48.5803957 + 0.7732137 * df200$Height"
model_equation(fit400)
## [1] "df400$Length = - 42.6268809 + 0.5922049 * df400$Height"
model_equation(fit700)
## [1] "df700$Length = - 37.529982 + 0.422947 * df700$Height"
In the case of the bungee drop, there are several energy transformations. If we include the earth in our system, there are several differet energy transfers. When the mass is above the platform, there is gravitational potential energy as the mass has height. The energy required to get the mass to that height is provided by the chemical energy from food, that was converted to kinetic by us. Then when the mass is dropped the gravitational potential energy is converted into kinetic and spring potential energy as it is falling toward the earth (and the earth is falling toward it minutely) and stretching the surgical tubeing that is being used as the spring. The spring potential energy is then converted back into gravitational potential and kinetic energy, and the cycle continues untill the thermal energy from the rubber molecules rubbing against each other dissapates all of the initial energy that the system had to heat. This energy transfer cycle happens every time the mass is dropped and from any height