Adding which.max for Z that has max binding energy
This commit is contained in:
parent
d4d8073cd0
commit
7a2b103e3b
@ -1 +1 @@
|
||||
,noah,NovaArchSys,19.01.2023 22:53,file:///home/noah/.config/libreoffice/4;
|
||||
,noah,NovaArchSys,19.01.2023 23:22,file:///home/noah/.config/libreoffice/4;
|
||||
Binary file not shown.
@ -39,7 +39,9 @@ print(carbon_df, row.names=FALSE)
|
||||
# Get max binding energy row
|
||||
print(carbon_df[which.max(carbon_df$"B/A"),], row.names=FALSE)
|
||||
|
||||
plot(carbon_df$A, carbon_df$"B/A", xlab="Number of Nucleons", ylab="Binding Energy", main="Number of Nucleons on Binding Energy")
|
||||
plot(carbon_df$A, carbon_df$"B/A", xlab="Number of Nucleons",
|
||||
ylab="Binding Energy [MeV]",
|
||||
main="Number of Nucleons on Binding Energy for Carbon")
|
||||
|
||||
## Part D: find the value of A that gives the maximum binding energy
|
||||
computeMaxBind <- function(Z){
|
||||
@ -59,9 +61,11 @@ computeMaxBind <- function(Z){
|
||||
bounds <- 100
|
||||
binding_df <- data.frame(nrow=bounds, ncol=2)
|
||||
for (i in seq(1, bounds)){
|
||||
# +1 since R indexes at 1
|
||||
binding_df[i,] <- c(i, computeMaxBind(i)[2])
|
||||
}
|
||||
|
||||
plot(binding_df, xlab="Atomic Number", ylab="B/A [MeV]", type="o",
|
||||
main="Maximum Binding Energy for Most Stable Isotopes of Each Atom")
|
||||
|
||||
# Z with largest binding energy
|
||||
print(binding_df[which.max(unlist(binding_df[2])),], row.names=FALSE)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user