Creating Economic Model for Oil and Gas Projects EcoMan

Writing The Economic Functions

The Input data

We have two different projects to be evaluated based on the folowing economic parameters:
- Net Present Value NPV
- Internal Rate of Return IRR
- Pay back Period PBP
- Discounted Pay back Period DPBP
- Discounted Cash Flow DCF

### the Two Project that needed to be evaluated
# To evaluate the two projects they should have the same project time
#together to evaluate them together or you should evaluate them separately
  Time.Evaluation <-c(1:6)
  Project1 <- c(-1000, 1250, 10, 10, 20, 20)
  Project2 <- c(-1000, -10, 0, 10, 20, 2000)
  Projects.data <- data.frame(Time.Evaluation, Project1 , Project2)
  knitr::kable(Projects.data, digits = 2)
Time.Evaluation Project1 Project2
1 -1000 -1000
2 1250 -10
3 10 0
4 10 10
5 20 20
6 20 2000

The Method of Evaluations

1. Calculating the Discounted Cash Flow DCF

To understand the time value of Money for the two projects.

### Calculating the Discounted Cash Flow "DCF"
### the interest rate given is 0.06 "6%"

CDF.P1 <- dcf(Project1, r= 0.06, t0=TRUE)
cdfProject1<- data.frame(Time.Evaluation, Project1,CDF.P1)
knitr::kable(cdfProject1, digits = 2)
Time.Evaluation Project1 CDF.P1
1 -1000 -1000.00
2 1250 1179.25
3 10 8.90
4 10 8.40
5 20 15.84
6 20 14.95
CDF.P2 <- dcf(Project2, r= 0.06, t0=TRUE)
cdfProject2<- data.frame(Time.Evaluation, Project2,CDF.P2)
knitr::kable(cdfProject2, digits = 2)
Time.Evaluation Project2 CDF.P2
1 -1000 -1000.00
2 -10 -9.43
3 0 0.00
4 10 8.40
5 20 15.84
6 2000 1494.52

2. Claculating Net Present Value NPV

To understand the Whole project monetry value in the present day.

### NPV Calculations
npv.p1 <- npv(Project1, r=0.06, t0 = TRUE)
npv.p2 <- npv(Project2, r=0.06, t0 = TRUE)
npv.all <- data.frame(npv.p1,npv.p2)
knitr::kable(npv.all, digits = 2)
npv.p1 npv.p2
227.33 509.32

3. Calculating the Payback Period PBP

### PayBack Period Calculations
pbp.p1<- pbp(Project1)
pbp.p2<- pbp(Project2)
pbp.all <- data.frame(pbp.p1,pbp.p2)
knitr::kable(pbp.all)
pbp.p1 pbp.p2
0.8 4.49
dpbp.p1 <- dpbp(Project1, r= 0.06, t0=TRUE)
dpbp.p2 <- dpbp(Project2, r= 0.06, t0=TRUE)
dpbp.all <- data.frame(dpbp.p1,dpbp.p2)
knitr::kable(dpbp.all, digits = 2)
dpbp.p1 dpbp.p2
0.85 4.66

4. Calculating the Internal Rate Of Return IRR

### IRR Calculations 
IRR.P1 <- irr(Project1)
IRR.P2 <- irr(Project2)
IRR.all <- data.frame(IRR.P1,IRR.P2)
knitr::kable(IRR.all, digits = 2)
IRR.P1 IRR.P2
0.28 0.15
library(cowplot)
## 
## Attaching package: 'cowplot'
## The following object is masked from 'package:ggplot2':
## 
##     ggsave
projects <- c("Project1","Project2")
NpvA <- c(npv.p1,npv.p2)
pay<- c(pbp.p1,pbp.p2)
dpay <- c(dpbp.p1,dpbp.p2)
ir <- c(IRR.P1,IRR.P2)
Econman <- data.frame(projects,NpvA, pay,dpay, ir)
knitr::kable(Econman, digits = 2,caption = "The Economic parameters Comparison")
The Economic parameters Comparison
projects NpvA pay dpay ir
Project1 227.33 0.80 0.85 0.28
Project2 509.32 4.49 4.66 0.15
par(mfrow=c(2,2))
NPVPlt<- ggplot(data = Econman,aes(x=Econman$projects, y= Econman$NpvA))+geom_col()+labs(x = "Projects", y= "NPV", title = "NPV MMSD")
PayPlt<- ggplot(data = Econman,aes(x=Econman$projects, y= Econman$pay))+geom_col()+labs(x = "Projects", y= "Payback Period", title = "PayBack Period in Years")
dpayPlt<- ggplot(data = Econman,aes(x=Econman$projects, y= Econman$dpay))+geom_col()+labs(x = "Projects", y= "Disc Payback", title = "Discounted Payback Period in Years")
IRRPlt<- ggplot(data = Econman,aes(x=Econman$projects, y= Econman$ir*100))+geom_col()+labs(x = "Projects", y= "IRR", title = "Internal Rate Of return %")

plot_grid(NPVPlt,PayPlt,dpayPlt,IRRPlt)

Shinyapp has been created to estiamte the economic analysis of any given projects without the hassel of changing the code. You can just play with the essential parameters and you get all the results instantaneously.

Please dont hesitate to contact me over a_moslim@live.com to share your comments.