R Markdown

Content:

Preparing and recalling data.

Modelling Correction of Porosity & Permeability

Parameter visualization

  1. Preparing and recalling data In this section we will recall the data that we will work on from an external file and then calling our dataset:
Samples <-read.csv("D:/karpur.csv",header=T)
summary(Samples)
##      depth         caliper         ind.deep          ind.med       
##  Min.   :5667   Min.   :8.487   Min.   :  6.532   Min.   :  9.386  
##  1st Qu.:5769   1st Qu.:8.556   1st Qu.: 28.799   1st Qu.: 27.892  
##  Median :5872   Median :8.588   Median :217.849   Median :254.383  
##  Mean   :5873   Mean   :8.622   Mean   :275.357   Mean   :273.357  
##  3rd Qu.:5977   3rd Qu.:8.686   3rd Qu.:566.793   3rd Qu.:544.232  
##  Max.   :6083   Max.   :8.886   Max.   :769.484   Max.   :746.028  
##      gamma            phi.N            R.deep            R.med        
##  Min.   : 16.74   Min.   :0.0150   Min.   :  1.300   Min.   :  1.340  
##  1st Qu.: 40.89   1st Qu.:0.2030   1st Qu.:  1.764   1st Qu.:  1.837  
##  Median : 51.37   Median :0.2450   Median :  4.590   Median :  3.931  
##  Mean   : 53.42   Mean   :0.2213   Mean   : 24.501   Mean   : 21.196  
##  3rd Qu.: 62.37   3rd Qu.:0.2640   3rd Qu.: 34.724   3rd Qu.: 35.853  
##  Max.   :112.40   Max.   :0.4100   Max.   :153.085   Max.   :106.542  
##        SP          density.corr          density         phi.core    
##  Min.   :-73.95   Min.   :-0.067000   Min.   :1.758   Min.   :15.70  
##  1st Qu.:-42.01   1st Qu.:-0.016000   1st Qu.:2.023   1st Qu.:23.90  
##  Median :-32.25   Median :-0.007000   Median :2.099   Median :27.60  
##  Mean   :-30.98   Mean   :-0.008883   Mean   :2.102   Mean   :26.93  
##  3rd Qu.:-19.48   3rd Qu.: 0.002000   3rd Qu.:2.181   3rd Qu.:30.70  
##  Max.   : 25.13   Max.   : 0.089000   Max.   :2.387   Max.   :36.30  
##      k.core            Facies         
##  Min.   :    0.42   Length:819        
##  1st Qu.:  657.33   Class :character  
##  Median : 1591.22   Mode  :character  
##  Mean   : 2251.91                     
##  3rd Qu.: 3046.82                     
##  Max.   :15600.00
  1. Modelling and Correction of Porosity & Permeability
Phi.core <- Samples$phi.core/100
par(mfrow=c(1,1))
model <- lm(Phi.core ~ Samples$phi.N)
coef(model)
##   (Intercept) Samples$phi.N 
##     0.3096232    -0.1820696
plot(Samples$phi.N,Phi.core, xlab = 'Phi.Log ',ylab='Phi.Core')
abline(model, lwd='2' )

summary(model)
## 
## Call:
## lm(formula = Phi.core ~ Samples$phi.N)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.135237 -0.030779  0.009432  0.033563  0.104025 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)    0.30962    0.00485  63.846   <2e-16 ***
## Samples$phi.N -0.18207    0.02080  -8.753   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.04368 on 817 degrees of freedom
## Multiple R-squared:  0.08573,    Adjusted R-squared:  0.08462 
## F-statistic: 76.61 on 1 and 817 DF,  p-value: < 2.2e-16
porosity_model<-lm(Phi.core~phi.N+Facies-1,data = Samples)
summary(porosity_model)
## 
## Call:
## lm(formula = Phi.core ~ phi.N + Facies - 1, data = Samples)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.103530 -0.011573 -0.000206  0.010463  0.102852 
## 
## Coefficients:
##           Estimate Std. Error t value Pr(>|t|)    
## phi.N     0.013364   0.018060    0.74     0.46    
## FaciesF1  0.314805   0.002777  113.37   <2e-16 ***
## FaciesF10 0.207680   0.005072   40.95   <2e-16 ***
## FaciesF2  0.175233   0.009390   18.66   <2e-16 ***
## FaciesF3  0.231939   0.004955   46.81   <2e-16 ***
## FaciesF5  0.272953   0.003914   69.74   <2e-16 ***
## FaciesF7  0.225164   0.008730   25.79   <2e-16 ***
## FaciesF8  0.305884   0.005019   60.94   <2e-16 ***
## FaciesF9  0.264448   0.004825   54.81   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.02326 on 810 degrees of freedom
## Multiple R-squared:  0.9928, Adjusted R-squared:  0.9928 
## F-statistic: 1.246e+04 on 9 and 810 DF,  p-value: < 2.2e-16
corrected_porosity<-predict(porosity_model,Samples)
summary(corrected_porosity)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.1775  0.2345  0.2682  0.2693  0.3094  0.3203
corrected_permability<-predict(porosity_model,Samples)
summary(corrected_permability)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.1775  0.2345  0.2682  0.2693  0.3094  0.3203
  1. Parameter visualization In this section we will display our parameters by using plot function.

Predict and plot the “Φ.CoreL”

par(mfrow=(c(1,5)))
plot(Samples$phi.core,Samples$depth,ylim =rev (c(5667,6083)),xlim = c(0.1570,0.3630),type = "l",lwd=2,xlab = 'core porosity',ylab = 'depth m',col="red")
plot(corrected_porosity,Samples$depth,ylim =rev (c(5667,6083)),xlim = c(0.1775,0.3203),type = "l",lwd=2,xlab = 'corrected core porosity',ylab = 'depth m',col="green")
plot(Samples$k.core,Samples$depth,ylim =rev (c(5667,6083)),xlim = c(0.42,15600.00),type = "l",lwd=2,xlab = 'core permability',ylab = 'depth m',col="blue")
plot(corrected_permability,Samples$depth,ylim =rev (c(5667,6083)),xlim = c(11.26,6280.63),type = "l",lwd=2,xlab = 'corrected core permability',ylab = 'depth m',col="orange")
boxplot(depth~Facies,data = Samples,ylim =rev (c(5667,6083)))