Project Title: Meter Readings from meters connected to 3 power plants in Jaisalmer, Rajasthan

NAME: ASWATHY GUNADEEP

EMAIL: aswathygunadeep@gmail.com

COLLEGE / COMPANY: NATIONAL INSTITUTE OF TECHNOLOGY KARNATAKA

setwd("C:/Users/user/Desktop/tarsha systems summer internship/project/data_3plants")
met1.df <- read.csv(paste("plant1-time sort.csv", sep=""))

SUMMARY OF THE VARIABLES OF THE DATASET

str(met1.df)
## 'data.frame':    1048575 obs. of  10 variables:
##  $ dataid        : int  52733463 52728738 52761108 52758796 52719389 52763320 52765532 52751860 52754172 52756484 ...
##  $ paramrefid    : int  45831866 45831867 45831868 45831869 45831870 45831871 45831872 45831873 45831874 45831875 ...
##  $ timestamp     : Factor w/ 16760 levels "2017-10-27 18:15:00+00",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ rawvalue      : num  0.00011 0 0.00173 0 49.91 ...
##  $ processedvalue: num  0.00011 0 0.00173 0 49.91 ...
##  $ meterid       : int  45830385 45830385 45830385 45830385 45830385 45830385 45830385 45830385 45830385 45830385 ...
##  $ tagid         : int  3006 3002 3306 3302 2252 2210 2213 2004 2005 2006 ...
##  $ interval      : int  15 15 15 15 15 15 15 15 15 15 ...
##  $ profileid     : int  1008 1008 1008 1008 1008 1008 1008 1008 1008 1008 ...
##  $ tagname       : Factor w/ 30 levels "Active Energy Export Time Integral 5",..: 1 2 3 4 5 6 7 16 17 18 ...
attach(met1.df)

VISUALIZATION:

  1. CORRGRAM

Problem Statement:We are trying to find out factors that drive energy usage in 3 plants located in Jaisalmer district of Rajasthan. The first two plants have 4 meters each, while the third one has 21 meters. This is the analysis for the 1st plant. Weather also plays a crucial role. Jaisalmer, being an arid desert region, is prone to extremes in terms of temperature. The temperature varies greatly from day to night in both summer and winter. The maximum summer temperature is around 49 °C (120 °F) while the minimum is 25 °C (77 °F). Also, the meter readings are a combination of solar and wind generation units. Most of the meters(3meters in plant1, 3 meters in plant2 and 21 meters in plant 3) have took readings at an interval of 15 minutes. The readings are either cumulative for the day, or even can be an average.

library(gplots)
## 
## Attaching package: 'gplots'
## The following object is masked from 'package:stats':
## 
##     lowess
library(corrplot)
## corrplot 0.84 loaded
par(mfrow=c(1,1))
sub.df <- subset(met1.df[c(1,2,4,5,6,7,8,9)])
corrplot.mixed(corr=cor(sub.df, use="complete.obs"), 
               upper = "pie", tl.pos="lt", main="corrgram")

  1. meterid and tagid distribution
mytable <- table(meterid)
mytable1 <- table(tagid)
par(mfrow=c(1,2))
pie(table(meterid),main="meterid", col=c("violet","cyan","darkseagreen"))
pie(table(tagid), cex=0.5, col=c("pink","violet","cyan","darkcyan","red","orange","blue","skyblue","turquoise","darkgreen","green"))

Each meterid corresponds to each meter. There are 3 such meters setup in the plant.And each tagid corresponds to or represents a unit of measure of the energy value(cane be energy, current, volatge etc.).

Average value of each reading:

seg.df <- aggregate(rawvalue, by=list(tagname=tagname),mean)
seg.df
##                                   tagname            x
## 1    Active Energy Export Time Integral 5 1.744971e-04
## 2    Active Energy Import Time Integral 5 2.436947e-02
## 3  Apparent Energy Export Time Integral 5 2.544449e-03
## 4  Apparent Energy Import Time Integral 5 2.467396e-02
## 5               Avg Frequency Current Avg 4.964319e+01
## 6                        Avg Power Factor 4.171192e-01
## 7               Avg Power Factor L1 Phase 3.696120e-02
## 8         Cumulative Active Energy Export 2.907322e+00
## 9         Cumulative Active Energy Import 3.718952e+02
## 10      Cumulative Apparent Energy Export 3.844312e+01
## 11      Cumulative Apparent Energy Import 3.772982e+02
## 12          Cumulative Reactive Energy Q1 2.538040e+01
## 13          Cumulative Reactive Energy Q2 3.801008e+01
## 14          Cumulative Reactive Energy Q3 1.508291e-01
## 15         Cumulative Reactive Energy Q4  4.123199e+00
## 16                        Current L1 Avg  5.649939e-01
## 17                        Current L2 Avg  5.595764e-01
## 18                        Current L3 Avg  5.622253e-01
## 19             L1 Cumulative kvarh Export 3.302984e-02
## 20             L3 Cumulative kvarh Import 1.561168e-01
## 21                     man specific data3 4.746922e+01
## 22                     man specific data4 6.553500e+04
## 23             Net Energy Time Integral 5 2.419497e-02
## 24     Reactive Energy Q1 Time integral 5 1.484545e-03
## 25     Reactive Energy Q2 Time integral 5 2.538193e-03
## 26     Reactive Energy Q3 Time integral 5 3.251737e-08
## 27     Reactive Energy Q4 Time integral 5 3.459571e-04
## 28                        Voltage L1 Avg  6.384467e+01
## 29                        Voltage L2 Avg  6.432853e+01
## 30                        Voltage L3 Avg  6.406652e+01

Maximum value of each reading:

seg1.df <- aggregate(rawvalue, by=list(tagname=tagname),max)
seg1.df
##                                   tagname           x
## 1    Active Energy Export Time Integral 5     0.00097
## 2    Active Energy Import Time Integral 5     0.15998
## 3  Apparent Energy Export Time Integral 5     0.01072
## 4  Apparent Energy Import Time Integral 5     0.16024
## 5               Avg Frequency Current Avg    50.28000
## 6                        Avg Power Factor     1.00000
## 7               Avg Power Factor L1 Phase     0.20900
## 8         Cumulative Active Energy Export     5.51870
## 9         Cumulative Active Energy Import   760.99990
## 10      Cumulative Apparent Energy Export    78.88120
## 11      Cumulative Apparent Energy Import   766.89520
## 12          Cumulative Reactive Energy Q1    64.11610
## 13          Cumulative Reactive Energy Q2    78.56340
## 14          Cumulative Reactive Energy Q3     0.23870
## 15         Cumulative Reactive Energy Q4     14.44570
## 16                        Current L1 Avg      3.38900
## 17                        Current L2 Avg      3.39800
## 18                        Current L3 Avg      3.39900
## 19             L1 Cumulative kvarh Export     8.19320
## 20             L3 Cumulative kvarh Import    52.25150
## 21                     man specific data3    63.00000
## 22                     man specific data4 65535.00000
## 23             Net Energy Time Integral 5     0.15998
## 24     Reactive Energy Q1 Time integral 5     0.01408
## 25     Reactive Energy Q2 Time integral 5     0.01072
## 26     Reactive Energy Q3 Time integral 5     0.00005
## 27     Reactive Energy Q4 Time integral 5     0.01043
## 28                        Voltage L1 Avg     70.69000
## 29                        Voltage L2 Avg     70.94000
## 30                        Voltage L3 Avg     70.72000

I Cumulative Active Energy Export and Cumulative Active Energy Import 1. Distribution:

par(mfrow=c(1,1))
sub.df <- subset(met1.df,tagname=="Cumulative Active Energy Export")
sub1.df <- subset(met1.df,tagname=="Cumulative Active Energy Import")
plot(sub.df$rawvalue ~ sub.df$timestamp, ylab="active energy export", xlab="days", main="cumulative active energy export for a day v/s no. of days",col="blue")

plot(sub1.df$rawvalue ~ sub1.df$timestamp, ylab="active energy import", xlab="days", main="cumulative active energy import for a day v/s no. of days",col="green")

Starting from 6.30pm on 27-0-2017 for around 6 months, the average and maximum active energy export are 2.9kWh and 5.5kWh respectively.The readings are taken cumulatively for a day. Similarly, the average and maximum active energy import are 372kWh and 761kWh respectively, which are quite high.

  1. CHI-SQUARED TEST:
print("Cumulative Active Energy Export")
## [1] "Cumulative Active Energy Export"
chisq.test(sub.df$rawvalue,sub.df$timestamp)
## Warning in chisq.test(sub.df$rawvalue, sub.df$timestamp): Chi-squared
## approximation may be incorrect
## 
##  Pearson's Chi-squared test
## 
## data:  sub.df$rawvalue and sub.df$timestamp
## X-squared = 60900, df = 60726, p-value = 0.3083
print("Cumulative Active Energy Import")
## [1] "Cumulative Active Energy Import"
chisq.test(sub1.df$rawvalue,sub1.df$timestamp)
## Warning in chisq.test(sub1.df$rawvalue, sub1.df$timestamp): Chi-squared
## approximation may be incorrect
## 
##  Pearson's Chi-squared test
## 
## data:  sub1.df$rawvalue and sub1.df$timestamp
## X-squared = 60900, df = 60726, p-value = 0.3083

Since the p-value s quite high, we don’t reject the NULL hypothesis and our original hypothesis is wrong.

  1. forecasting future values:
print("Cumulative Active Energy Export")
## [1] "Cumulative Active Energy Export"
library(forecast)
ash.df <- subset(sub.df[,c(4,5,7,8)])
myts <- ts(ash.df)
forecast(myts, 3)
## rawvalue
##     Point Forecast    Lo 80    Hi 80    Lo 95    Hi 95
## 351       4.828201 4.092524 5.563877 3.703081 5.953321
## 352       4.839983 4.102484 5.577482 3.712076 5.967891
## 353       4.851766 4.112410 5.591121 3.721019 5.982513
## 
## processedvalue
##     Point Forecast    Lo 80    Hi 80    Lo 95    Hi 95
## 351       4.828201 4.092524 5.563877 3.703081 5.953321
## 352       4.839983 4.102484 5.577482 3.712076 5.967891
## 353       4.851766 4.112410 5.591121 3.721019 5.982513
## 
## tagid
##     Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
## 351           3005  3005  3005  3005  3005
## 352           3005  3005  3005  3005  3005
## 353           3005  3005  3005  3005  3005
## 
## interval
##     Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
## 351           1440  1440  1440  1440  1440
## 352           1440  1440  1440  1440  1440
## 353           1440  1440  1440  1440  1440
plot(forecast(myts, 3))

print("Cumulative Active Energy Import")
## [1] "Cumulative Active Energy Import"
ash.df <- subset(sub1.df[,c(4,5,7,8)])
myts <- ts(ash.df)
forecast(myts, 3)
## rawvalue
##     Point Forecast    Lo 80    Hi 80    Lo 95    Hi 95
## 351       663.3755 509.3071 817.4439 427.7482 899.0028
## 352       665.3095 510.7914 819.8277 428.9945 901.6246
## 353       667.2436 512.2750 822.2121 430.2396 904.2475
## 
## processedvalue
##     Point Forecast    Lo 80    Hi 80    Lo 95    Hi 95
## 351       663.3755 509.3071 817.4439 427.7482 899.0028
## 352       665.3095 510.7914 819.8277 428.9945 901.6246
## 353       667.2436 512.2750 822.2121 430.2396 904.2475
## 
## tagid
##     Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
## 351           3001  3001  3001  3001  3001
## 352           3001  3001  3001  3001  3001
## 353           3001  3001  3001  3001  3001
## 
## interval
##     Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
## 351           1440  1440  1440  1440  1440
## 352           1440  1440  1440  1440  1440
## 353           1440  1440  1440  1440  1440
plot(forecast(myts, 3))

II Cumulative Apparent Energy Export and Cumulative Apparent Energy Import

sub.df <- subset(met1.df,tagname=="Cumulative Apparent Energy Export")
sub1.df <- subset(met1.df,tagname=="Cumulative Apparent Energy Import")
plot(sub.df$rawvalue ~ sub.df$timestamp, ylab="apparent energy export", xlab="days", main="cumulative apparent energy export for a day v/s no. of days",col="blue")

plot(sub1.df$rawvalue ~ sub1.df$timestamp, ylab="apparent energy import", xlab="days", main="cumulative apparent energy import for a day v/s no. of days",col="green")

Starting from 6.30pm on 27-0-2017 for around 6 months, the average and maximum apparent energy export are 38.4kVAh and 79kVAh respectively.The readings are taken cumulatively for a day. Similarly, the average and maximum active energy import are 377.3kVAh and 767kVAh respectively, which are quite high.

III Cumulative Reactive Energy in each quartile

sub1.df <- subset(met1.df,tagname=="Cumulative Reactive Energy Q1")
sub2.df <- subset(met1.df,tagname=="Cumulative Reactive Energy Q2")
sub3.df <- subset(met1.df,tagname=="Cumulative Reactive Energy Q3")
sub4.df <- subset(met1.df, tagid=="3125")
plot(sub1.df$rawvalue ~ sub1.df$timestamp, xlab="days", ylab="reactive energy for quarter 1", main="quarter 1")

plot(sub2.df$rawvalue ~ sub2.df$timestamp, xlab="days", ylab="reactive energy for quarter 2", main="quarter 2")

plot(sub3.df$rawvalue ~ sub3.df$timestamp, xlab="days", ylab="reactive energy for quarter 3", main="quarter 3", ylim=c(0,0.3))

plot(sub4.df$rawvalue ~ sub4.df$timestamp, xlab="days", ylab="reactive energy for quarter 4", main="quarter 4")

The readings are taken cumulatively for a day. For the 1st quarter, the average and maximum reactive energy are 25.4kvarh and 64.1kvarh respectively. For the 2nd quarter, the average and maximum reactive energy are 38kvarh and 78.6kvarh respectively. For the 3rd quarter, the data seemed to be categorical type and irregular also, with the meters showing only 2 readings(0.237kvarh and 0.0636kvarh). For the 4th quarter, there is a gradual increase in teh values and the average and maximum reactive energy are 4.12kvarh and 14.4kvarh respectively.

IV Average current in each phase, L1,L2 and L3:

The mean is constant with time for all the 3 phases. Starting from 6.15pm on 27-10-2017, the readings have been taken at an interval of 15minutes each till 20-4-2018 8.00am. The average current in each phase are same(0.56 amperes) and maximum of 3.39amperes.

print("current in phase L1")
## [1] "current in phase L1"
library(forecast)
ash.df <- subset(sub1.df[,c(3,4)])
myts <- ts(ash.df)
forecast(myts, 3)
## timestamp
##     Point Forecast    Lo 80    Hi 80    Lo 95    Hi 95
## 351       16776.41 16745.28 16807.53 16728.80 16824.01
## 352       16824.31 16793.18 16855.44 16776.71 16871.92
## 353       16872.22 16841.09 16903.35 16824.61 16919.83
## 
## rawvalue
##     Point Forecast    Lo 80    Hi 80      Lo 95    Hi 95
## 351       42.56867 14.53442 70.60291 -0.3060064 85.44334
## 352       42.68618 14.57448 70.79788 -0.3069545 85.67932
## 353       42.80370 14.61445 70.99294 -0.3080312 85.91543
plot(forecast(myts, 3))

print("current in phase L2")
## [1] "current in phase L2"
ash.df <- subset(sub2.df[,c(3,4)])
myts <- ts(ash.df)
forecast(myts, 3)
## timestamp
##     Point Forecast    Lo 80    Hi 80    Lo 95    Hi 95
## 351       16776.41 16745.28 16807.53 16728.80 16824.01
## 352       16824.31 16793.18 16855.44 16776.71 16871.92
## 353       16872.22 16841.09 16903.35 16824.61 16919.83
## 
## rawvalue
##     Point Forecast    Lo 80    Hi 80    Lo 95    Hi 95
## 351       66.10704 47.03132 85.18276 36.93325 95.28084
## 352       66.26021 47.14029 85.38014 37.01881 95.50162
## 353       66.41338 47.24924 85.57752 37.10436 95.72241
plot(forecast(myts, 3))

print("current in phase L3")
## [1] "current in phase L3"
ash.df <- subset(sub3.df[,c(3,4)])
myts <- ts(ash.df)
forecast(myts, 3)
## timestamp
##     Point Forecast    Lo 80    Hi 80    Lo 95    Hi 95
## 351       16776.41 16745.28 16807.53 16728.80 16824.01
## 352       16824.31 16793.18 16855.44 16776.71 16871.92
## 353       16872.22 16841.09 16903.35 16824.61 16919.83
## 
## rawvalue
##     Point Forecast      Lo 80     Hi 80       Lo 95     Hi 95
## 351      0.1508171 0.03884783 0.2627863 -0.02042511 0.3220593
## 352      0.1508171 0.03884783 0.2627863 -0.02042511 0.3220593
## 353      0.1508171 0.03884783 0.2627863 -0.02042511 0.3220593
plot(forecast(myts, 3))

V Average voltage in each phase, L1,L2 and L3:

The mean is constant with time for all the 3 phases. The average values in each phases are almost same(around 64volts) and a maximum value of 70volts. For phase L1 alone, the meter started readings on 6.15pm on 27-10-2017 at intervals of 15 minutes. For phases L2 and L3, the meter started recording values 4 days later, also at intervals of 15 minutes each.

print("voltage in phase L1")
## [1] "voltage in phase L1"
library(forecast)
ash.df <- subset(sub1.df[,c(3,4)])
myts <- ts(ash.df)
forecast(myts, 3)
## timestamp
##     Point Forecast    Lo 80    Hi 80    Lo 95    Hi 95
## 351       16776.41 16745.28 16807.53 16728.80 16824.01
## 352       16824.31 16793.18 16855.44 16776.71 16871.92
## 353       16872.22 16841.09 16903.35 16824.61 16919.83
## 
## rawvalue
##     Point Forecast    Lo 80    Hi 80      Lo 95    Hi 95
## 351       42.56867 14.53442 70.60291 -0.3060064 85.44334
## 352       42.68618 14.57448 70.79788 -0.3069545 85.67932
## 353       42.80370 14.61445 70.99294 -0.3080312 85.91543
plot(forecast(myts, 3))

print("voltage in phase L2")
## [1] "voltage in phase L2"
ash.df <- subset(sub2.df[,c(3,4)])
myts <- ts(ash.df)
forecast(myts, 3)
## timestamp
##     Point Forecast    Lo 80    Hi 80    Lo 95    Hi 95
## 351       16776.41 16745.28 16807.53 16728.80 16824.01
## 352       16824.31 16793.18 16855.44 16776.71 16871.92
## 353       16872.22 16841.09 16903.35 16824.61 16919.83
## 
## rawvalue
##     Point Forecast    Lo 80    Hi 80    Lo 95    Hi 95
## 351       66.10704 47.03132 85.18276 36.93325 95.28084
## 352       66.26021 47.14029 85.38014 37.01881 95.50162
## 353       66.41338 47.24924 85.57752 37.10436 95.72241
plot(forecast(myts, 3))

print("voltage in phase L3")
## [1] "voltage in phase L3"
ash.df <- subset(sub3.df[,c(3,4)])
myts <- ts(ash.df)
forecast(myts, 3)
## timestamp
##     Point Forecast    Lo 80    Hi 80    Lo 95    Hi 95
## 351       16776.41 16745.28 16807.53 16728.80 16824.01
## 352       16824.31 16793.18 16855.44 16776.71 16871.92
## 353       16872.22 16841.09 16903.35 16824.61 16919.83
## 
## rawvalue
##     Point Forecast      Lo 80     Hi 80       Lo 95     Hi 95
## 351      0.1508171 0.03884783 0.2627863 -0.02042511 0.3220593
## 352      0.1508171 0.03884783 0.2627863 -0.02042511 0.3220593
## 353      0.1508171 0.03884783 0.2627863 -0.02042511 0.3220593
plot(forecast(myts, 3))

VI Power factor

sub.df <- subset(met1.df,tagid=="2210")
plot(sub.df$rawvalue ~ sub.df$timestamp,main="power factor",xlab="days",ylab="value")

The average power factor is 0.41(it has amximum value of 1), which is fine. Powerfactor doesn’t affect energy consumption much.

VII Frequency of current signals:

The average frequency of current is 50Hz, which is also close to its maximum value of 50.2Hz. So the meter readings could in the form os a fast oscillating sine wave.

VIII CONCLUSION: