diff --git a/Data_Proc.r b/Data_Proc.r index d9ee79d..417ad72 100644 --- a/Data_Proc.r +++ b/Data_Proc.r @@ -5,10 +5,13 @@ library(parallel) library(lpSolve) #For solving discrete value maximization for the power plants ####Manual inputs #DISCOUNT_RATE_LIST <- seq(0,1,by=0.0025) -DISCOUNT_RATE_LIST <- c(0.03,0.05,0.07,0.1) +DISCOUNT_RATE_LIST <- c(0.03,0.0325,0.035,0.0375,0.04,0.045,0.0475,0.05,0.07,0.1) SHIPPING_COST_PER_TON <- 1.2874*26000 #Inflation adjusted from New Mexico Report CV1 <- 1.3074*(10607030-1060703) #Data from Texas Report, converted from 2018 to Dec 2025 dollars -CV2 <- 1.2874*(6984013-1117442) #Data from New Mexico Report, Converted from 2019 to Dec 2025 +#CV2 <- 1.2874*(6984013-1117442) #Data from New Mexico Report, Converted from 2019 to Dec 2025 +CV2 <- 1.2874*(6984013) #Data from New Mexico Report, Converted from 2019 to Dec 2025 +CV2_OP <- 1.2874*1117442 + CV3 <- mean(CV1,CV2) #Average of the two ###################################Cost results @@ -45,6 +48,87 @@ CAPACITY_LIST <- COST_DATA %>% pull(Capacity) %>% unique ### TOTAL <- read_csv("Data/Raw_Data/Curie_Spent_Fuel_Site_Totals.csv") %>% mutate(OP_YEAR=year(Op_Date_Min),CLOSE_YEAR=year(Close_Date_Max))%>% select(Facility,Total_Assemblies,Total_Tons,OP_YEAR,CLOSE_YEAR) +Duane Arnold +Nine Mile Point +Ginna +FACILITY_LIST <- TOTAL %>% pull(Facility) +#https://www.nrc.gov/reactors/operating/licensing/renewal/subsequent-license-renewal +SUBMITTED <-rbind(c(FACILITY_LIST[str_detect(FACILITY_LIST,"Duane*" )],2025), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Nine Mile*" )],2026), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Ginna*" )],2026), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Cooper*" )],2026), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Farley*" )],2027), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Prairie*" )],2027), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Brunswick*" )],2027), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Cook" )],2027), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Hope" )],2027), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Salem" )],2027), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Perry" )],2027), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Millstone" )],2028), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Palisades" )],2028), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Beaver" )],2028), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Callaway" )],2029), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Three Mile Island" )],2029), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Davis-Besse" )],2029), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Wolf" )],2030), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Lucie" )],2021), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Robinson" )],2025), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Hatch" )],2025)) +SUBMITTED <- SUBMITTED %>% as_tibble +colnames(SUBMITTED ) <- c("Facility","App_Date","Status") +SUBMITTED <- SUBMITTED%>% mutate(Status="Applied",App_Date=as.numeric(App_Date)) %>% select(Facility,Status,App_Date) + +#Issued +RENEWED <- rbind(c(FACILITY_LIST[str_detect(FACILITY_LIST,"Turkey" )],"Granted",2018,2033), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Peach" )],"Granted",2019,2034), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Surry" )],"Granted",2020,2033), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"North" )],"Granted",2021,2040), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Monticello" )],"Granted",2024,2030), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Oconee" )],"Granted",2025,2034), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Summer" )],"Granted",2025,2042), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Beach" )],"Granted",2025,2033), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Browns" )],"Granted",2025,2036), +c(FACILITY_LIST[str_detect(FACILITY_LIST,"Dresden" )],"Granted",2025,2031)) +RENEWED <- RENEWED %>% as_tibble +colnames(RENEWED) <- c("Facility","Status","App_Date","Op_Date") +RENEWED <- RENEWED %>% mutate(Op_Date=as.numeric(Op_Date),App_Date=as.numeric(App_Date)) +AVG_LENGTH <- RENEWED %>% mutate(DIFF=Op_Date-App_Date) %>% pull(DIFF) %>% mean %>% round +SUBMITTED <- SUBMITTED %>% mutate(Op_Date=App_Date+AVG_LENGTH) +UPDATE <- rbind(RENEWED,SUBMITTED ) +UPDATE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +str_detect() +TOTAL %>% print(n=50) #!!!!!!!!!!!!#####TEST OF VARIABLITY IN CLOSING YEAR, CHANGE OR FORMALIZE LATER #TOTAL <- TOTAL %>% mutate(CLOSE_YEAR=ifelse(CLOSE_YEAR>2018,CLOSE_YEAR+20,CLOSE_YEAR)) @@ -98,25 +182,35 @@ YEARLY_RESULTS <- function(DATA,DISCOUNT,CAPACITY,SHIPPING_COSTS=0){ #Calculate and individual facilities rate, for all discount rates, and all years Rev_No_Shipping <- do.call(rbind,mclapply(CAPACITY_LIST,function(CAPACITY){do.call(rbind,lapply(DISCOUNT_RATE_LIST,function(x){YEARLY_RESULTS(TOTAL_VALUE_METRICS,x,CAPACITY,0)}))},mc.cores=min(length(CAPACITY_LIST),NCORES))) -Rev_No_Shipping + saveRDS(Rev_No_Shipping,"Data/Cleaned_Data/Model_Estimates.Rds") TEST <- Rev_No_Shipping %>% left_join(COST_DATA) %>% mutate(Profit=Revenue-Cost) %>% group_by(Discount,Capacity,Location) %>% mutate(Time_Benefit=(1-Discount)*(lead(Profit)-Profit),Op_Cost=Discount*Profit,Marginal=Time_Benefit-Op_Cost) %>% unique -TEST TEST <- TEST %>% mutate(Current_Profit=Profit/((1+Discount)^(Year-2026))) %>% ungroup TEST <- TEST %>% group_by(Year,Location,Discount) %>% filter(Current_Profit==max(Current_Profit)) %>% ungroup TEST %>% select(Profit,Current_Profit,Year,Discount) %>% tail -TEST %>% group_by(Location,Discount) %>% filter(Current_Profit==max(Current_Profit)) %>% print(n=100) -TEST %>% group_by(Location,Discount) %>% filter(Discount==0.04) %>% select(Year,Capacity,Profit,Current_Profit) %>% mutate(Delay_Profit=(lead(Current_Profit)-Current_Profit)/10^6) %>% print(n=70) +TEST %>% group_by(Location,Discount) %>% filter(Current_Profit==max(Current_Profit)) %>% print(n=100) %>% +TEMP <- TEST %>% group_by(Location,Discount) %>% select(Year,Capacity,Profit,Current_Profit) %>% mutate(Delay_Profit=(lead(Current_Profit)-Current_Profit)/10^6) +TEMP %>% filter(Year>=2025) %>% summarize(Optimal_Year=sum(ifelse(Current_Profit==max(Current_Profit),Year,0)),Max_Profit=max(Current_Profit),Current_Profit=sum(ifelse(Year==2026,Current_Profit,0)),Yearly_Loss=(Max_Profit-Current_Profit)/(2026-Optimal_Year)/10^6,Next_Years_Loss=(Max_Profit-sum(ifelse(Year==(Optimal_Year+1),Current_Profit,0)))/10^6) +TEST %>% group_by(Location,Discount, ggplot(TEST %>% filter(Discount==0.03) ,aes(x=Year,y=Current_Profit/10^9,color=Capacity))+geom_line()+facet_wrap(Discount~Location,ncol=1)+scale_x_continuous(breaks=seq(1960,2083,by=5)) ggplot(TEST %>% filter(Discount==0.05) ,aes(x=Year,y=Current_Profit/10^9,color=Capacity))+geom_line()+facet_wrap(Discount~Location,ncol=1)+scale_x_continuous(breaks=seq(1960,2083,by=5)) -ggplot(TEST %>% filter(Year>2000) ,aes(x=Year,y=Current_Profit/10^9,color=Capacity))+geom_line()+facet_wrap(Discount~Location,ncol=2,scales = "free_y")+scale_x_continuous(breaks=seq(1960,2083,by=5)) +ggplot(TEST %>% filter(Discount %in% c(0.03,0.05,0.07) ,Year>1970) ,aes(x=Year,y=Current_Profit/10^9,color=Capacity))+geom_line()+facet_wrap(Discount~Location,ncol=2)+scale_x_continuous(breaks=seq(1960,2083,by=5)) + +ggplot(TEST %>% filter(Discount %in% c(0.05) ,Year>1970) ,aes(x=Year,y=Profit/10^9,color=Location))+geom_line()+scale_x_continuous(breaks=seq(1960,2083,by=5)) + +ggplot(TEST %>% filter(Discount %in% c(0.03,0.05,0.07),Year>1970,Year<2050) ,aes(x=Year,y=Marginal/10^6))+ geom_area(aes(y=ifelse(Marginal>0,Marginal/10^6,0)),fill="lightgreen",alpha=0.6)+ geom_area(aes(y=ifelse(Marginal<0,Marginal/10^6,0)),fill="firebrick2",alpha=0.5) +facet_wrap(Discount~Location,ncol=2,scales = "free_y")+scale_x_continuous(breaks=seq(1960,2083,by=5))+scale_y_continuous(breaks=seq(-300,50,by=50))+geom_hline(yintercept=0)+theme_bw()+ylab("Profit Change (Million Dollars)") + ++geom_line()+facet_wrap(Discount~Location,ncol=2,scales = "free_y")+scale_x_continuous(breaks=seq(1960,2083,by=5))+geom_hline(yintercept=0)+theme_bw()+geom_area(fill="green") + + +ggplot(TEST %>% filter(Year>2000) ,aes(x=Year,y=Marginal/10^9,color=Capacity))+geom_line()+facet_wrap(Discount~Location,ncol=2,scales = "free_y")+scale_x_continuous(breaks=seq(1960,2083,by=5)) -ggplot(TEST ,aes(x=Year,y=Current_Profit/10^9,color=Capacity))+geom_line()+facet_wrap(Discount~Location) +ggplot(TEST ,aes(x=Year,y=Current_Profit/10^9,color=Capacity))+geom_line()+facet_wrap(Location~Discount) diff --git a/Single_Price_Data_Proc.r b/Single_Price_Data_Proc.r index 16badf9..39c4181 100644 --- a/Single_Price_Data_Proc.r +++ b/Single_Price_Data_Proc.r @@ -122,7 +122,7 @@ ggplot(TEST %>% filter(Discount==0.03) ,aes(x=Year,y=Current_Profit/10^9,color=C ggplot(TEST %>% filter(Discount==0.05) ,aes(x=Year,y=Current_Profit/10^9,color=Capacity))+geom_line()+facet_wrap(Discount~Location,ncol=1)+scale_x_continuous(breaks=seq(1960,2083,by=5)) -ggplot(TEST %>% filter(Year>2000) ,aes(x=Year,y=Current_Profit/10^9,color=Capacity))+geom_line()+facet_wrap(Discount~Location,ncol=2,scales = "free_y")+scale_x_continuous(breaks=seq(1960,2083,by=5)) +ggplot(TEST %>% filter(Year>1970) ,aes(x=Year,y=Current_Profit/10^9,color=Capacity))+geom_line()+facet_wrap(Discount~Location,ncol=2,scales = "free_y")+scale_x_continuous(breaks=seq(1960,2083,by=5))