By Jaidan Bhakta
2024-10-25
By Jaidan Bhakta
spring_data <- data.frame(
Displacement = seq(0, 1, by = 0.1),
Force = seq(0, 50, by = 5),
EPE = c(0.0, 0.25, 0.50, 1.125, 0.80,
1.25, 1.80, 2.45, 3.20, 4.05, 5.0)
)
library(ggplot2)
library(plotly)
ggplot(spring_data, aes(x = Displacement, y = Force)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE) +
labs(title = "Applied Force v. Displacement",
x = "Displacement (m)", y = "Force (N)") +
theme_minimal()
Demonstrates Hooke’s Law:
\[ F = -k * x \]
ggplot(spring_data, aes(x = Displacement, y = EPE)) +
geom_point() +
stat_smooth(method = "lm", se = FALSE,
formula = y ~ poly(x,2), color = "red") +
labs(title = "Elastic Potential Energy vs. Displacement",
x = "Displacement (m)", y = "Elastic Potential Energy (J)") +
theme_minimal()
Demonstrates the quadratic relationship between EPE and Displacement:
\[ EPE = \frac{1}{2} * k * x^2 \]
Another quadratic relationship:
Insert Hooke’s law equation (x = F/k) into EPE equation: \[ EPE = \frac{1}{2} * k * (\frac{F}{k})^2 \] Final simplified equation: \[ EPE = \frac{F^2}{2*k} \] - Here, the elastic potential energy (EPE) is directly proportional to the square of the force applied (F) to the spring. The coefficient is smaller in this case: 1/(2k)