Part C: binding energy of isotopes

This commit is contained in:
Noah L. Schrick 2023-01-19 18:53:08 -06:00
parent 5cfc3e6ab0
commit e1389f16f6

View File

@ -27,6 +27,17 @@ computeBindingEnergy(58,28)
(15.67*58) - (17.23*(58^(2/3))) - ((0.75)*((28^2)/(58^(1/3)))) - ((93.2)*(((58-(2*28))^2)/58)) + (12/(58^(1/2)))
## Part C: table with two columns: nucleons and binding energy per nucleon
Z=6 # Carbon
carbon_df <- data.frame(nrow=2*Z, ncol=2)
for (i in seq(Z, 3*Z)){
# +1 since R indexes at 1
carbon_df[i-Z+1,] <- rbind(i, computeBindingEnergy(i, Z)/i)
}
rownames(carbon_df) <- NULL
colnames(carbon_df) <- c("A", "B/A")
print(carbon_df, row.names=FALSE)
# Get max binding energy row
print(carbon_df[which.max(carbon_df$"B/A"),], row.names=FALSE)
## Part D: find the value of A that gives the maximum binding energy