Hi everyone, I am trying to calculate breakeven selling price for biojet by following the below code (below parameters have certain no, I am not providing them here):

...

irr <- r_eq (.15)

#irr <- r_eq-r_inf

CF0 <- capex*0.08*(1+irr)^2+capex*0.6*(1+irr)+capex*0.32

exp_ut <- q_water*p_water+q_elec*p_elec+

q_gas*p_gas+q_h2*p_h2

exp <- exp_ut+q_fd*p_fd+q_lab*p_lab #275.56

exp

sale_by <- q_dsl*p_dsl+q_lpg*p_lpg+q_nap*p_nap

p_jet_range <- seq(0.4,1,by=0.001)

# search within [0.4,1] to find a value yielding a NPV closest to zero

bsp_jet <- 1000 #default

bsp_npv <- 1000 #default

for (p_jet in p_jet_range){

sale <- sale_by+q_jet*p_jet

# cat("revenue share for meal:",q_meal*p_meal/sale,"\n")

ebitda <- sale-exp

dep <- capex*0.8/t_dep

ebit <- ebitda-dep

amort <- amort.table(Loan=capex*debt,n=t_loan,pmt=NA,irr)[["Schedule"]]

CF1 <- as.data.frame(amort) # cash flow for Y1-10

CF1$Depreciation <- dep

CF2 <- CF1*0 # cash flow for Y11-20
CF <- rbind(CF1,CF2)
CF <- cbind(Year=1:nrow(CF),CF)
CF$EBIT <- ebit
CF$EBT <- CF$EBIT-CF$*(1-r_tax)+CF$Depreciation-CF$

`Interest Paid`

CF$Flow <- CF$EBT`Principal Paid`

CF$Discount <- irr

CF$PV <- CF$Flow/(1+CF$Discount)^CF$Year

NPV <- sum(CF$PV)-CF0

if (abs(NPV)<bsp_npv){

bsp_jet <- p_jet

bsp_npv <- abs(NPV)

}

}

bsp_jet (#this will calculate the breakeven price for jet)

...

The p_jet is fixed at .47. But every time I run this code, I get the maximum value which is 1. I have 30 cases like this where I have to calculate breakeven selling price (for each of them, parameters such as capex, q_jet, q_diesel are different) and for most of them I get 1 as breakeven selling price, for 1/2 cases, I get .7/.6. Is there something wrong with this code? does it need any sort of modifications? for example, I have fixed p_jet=.47, so I search within .4 and 1 to get NPV close to zero (from the code: p_jet_range <- seq(0.4,1,by=0.001)). But maybe there is something wrong with this code? I increased the maximum value to 10, even 1000, it gives me that maximum value after running the above code. What I mean is if I change part of this code: _jet_range <- seq(0.4,1000,by=0.001)), the resulting bsp_jet will be 1000. Does this mean that I will have a breakeven price which is infinite? or even might be larger than 1000? But in that case, how do I figure out the exact no for breakeven price?