Advertisement
Guest User

chica

a guest
Mar 21st, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.36 KB | None | 0 0
  1. Mean :2014-12-25 05:14:59 Mean :151.0
  2. 3rd Qu.:2015-01-23 07:45:00 3rd Qu.:155.1
  3. Max. :2015-03-01 13:00:00 Max. :165.6
  4.  
  5. > sd(On[,2])
  6. [1] 5.226163
  7.  
  8. > On_All <-ggarrange(On_L,On_B, On_H,
  9. + labels = c("A", "B","C"),
  10. + ncol = 1, nrow = 3,common.lege .... [TRUNCATED]
  11. `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
  12. `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
  13.  
  14. > annotate_figure(On_All,top = text_grob("Period for When Heat Exchanger is ON (Temp >130oC)", color = "red", face = "bold", size = 14))
  15.  
  16. > summary(On)
  17. Time Temp
  18. Min. :2014-10-28 00:00:00 Min. :131.9
  19. 1st Qu.:2014-11-29 04:15:00 1st Qu.:147.9
  20. Median :2014-12-29 15:30:00 Median :149.9
  21. Mean :2014-12-25 05:14:59 Mean :151.0
  22. 3rd Qu.:2015-01-23 07:45:00 3rd Qu.:155.1
  23. Max. :2015-03-01 13:00:00 Max. :165.6
  24.  
  25. > sd(On[,2])
  26. [1] 5.226163
  27.  
  28. > #Filtered
  29. > #Set On1
  30. > On1<- MD %>%
  31. + filter(Temp>=130,Time<"2014/11/8 00:00:00")
  32.  
  33. > On1_L<-ggplot(On1, aes(Time,Temp))+geom_line()+ggtitle("Temperature Over Time for Time<2014/11/8")+scale_y_continuous("Temperature /oC")
  34.  
  35. > On1_B<-ggplot(On1,aes(Time,Temp))+geom_boxplot()+ggtitle("Boxplot of Temperature Over Time")+scale_y_continuous("Temperature /oC")
  36.  
  37. > summary(On1)
  38. Time Temp
  39. Min. :2014-10-28 00:00:00 Min. :143.9
  40. 1st Qu.:2014-10-30 17:45:00 1st Qu.:147.0
  41. Median :2014-11-02 11:30:00 Median :148.0
  42. Mean :2014-11-02 11:30:00 Mean :148.1
  43. 3rd Qu.:2014-11-05 05:15:00 3rd Qu.:149.6
  44. Max. :2014-11-07 23:00:00 Max. :151.6
  45.  
  46. > sd(On1[,2])
  47. [1] 1.777138
  48.  
  49. > #Set On2
  50. > On2<- MD %>%
  51. + filter(Temp>=130,Time>"2014/11/21 00:00:00",Time<"2014/12/12 00:00:00")
  52.  
  53. > On2_L<-ggplot(On2,aes(Time,Temp))+geom_line()+ggtitle("Temperature Over Time for 2014/11/21<Time<2014/12/12")+scale_y_continuous("Temperature /oC")
  54.  
  55. > On2_B<-ggplot(On2,aes(Time,Temp))+geom_boxplot()+ggtitle("Boxplot of Temperature Over Time")+scale_y_continuous("Temperature /oC")
  56.  
  57. > summary(On2)
  58. Time Temp
  59. Min. :2014-11-22 08:00:00 Min. :144.2
  60. 1st Qu.:2014-11-27 02:00:00 1st Qu.:148.7
  61. Median :2014-12-01 20:00:00 Median :149.5
  62. Mean :2014-12-01 20:00:00 Mean :149.7
  63. 3rd Qu.:2014-12-06 14:00:00 3rd Qu.:150.5
  64. Max. :2014-12-11 08:00:00 Max. :162.7
  65.  
  66. > sd(On2[,2])
  67. [1] 2.328006
  68.  
  69. > #Set On3
  70. > On3<- MD %>%
  71. + filter(Temp>=130,Time>"2014/12/23 00:00:00",Time<"2015/01/12 00:00:00")
  72.  
  73. > On3_L<- ggplot(On3,aes(Time,Temp))+geom_line()+ggtitle("Temperature Over Time for 2014/12/23<Time<2015/01/12")+scale_y_continuous("Temperature /oC")
  74.  
  75. > On3_B<- ggplot(On3,aes(Time,Temp))+geom_boxplot()+ggtitle("Boxplot of Temperature Over Time")+scale_y_continuous("Temperature /oC")
  76.  
  77. > summary(On3)
  78. Time Temp
  79. Min. :2014-12-23 03:00:00 Min. :141.4
  80. 1st Qu.:2014-12-28 02:00:00 1st Qu.:146.4
  81. Median :2015-01-02 01:00:00 Median :155.1
  82. Mean :2015-01-02 01:00:00 Mean :152.5
  83. 3rd Qu.:2015-01-07 00:00:00 3rd Qu.:156.4
  84. Max. :2015-01-11 23:00:00 Max. :162.1
  85.  
  86. > sd(On3[,2])
  87. [1] 5.348035
  88.  
  89. > #Set On4
  90. > On4<- MD %>%
  91. + filter(Temp>=130,Time>"2015/1/19 00:00:00",Time<"2015/02/8 00:00:00")
  92.  
  93. > On4_L<-ggplot(On4,aes(Time,Temp))+geom_line()+ggtitle("Temperature Over Time for 2015/1/19<Time<2015/02/8")+scale_y_continuous("Temperature /oC")
  94.  
  95. > On4_B<-ggplot(On4,aes(Time,Temp))+geom_boxplot()+ggtitle("Boxplot of Temperature Over Time")+scale_y_continuous("Temperature /oC")
  96.  
  97. > summary(On4)
  98. Time Temp
  99. Min. :2015-01-19 01:00:00 Min. :132.3
  100. 1st Qu.:2015-01-24 01:15:00 1st Qu.:148.9
  101. Median :2015-01-29 00:30:00 Median :151.1
  102. Mean :2015-01-29 00:20:20 Mean :153.6
  103. 3rd Qu.:2015-02-02 23:45:00 3rd Qu.:159.6
  104. Max. :2015-02-07 23:00:00 Max. :165.6
  105.  
  106. > sd(On4[,2])
  107. [1] 5.824139
  108.  
  109. > #Set On5
  110. > On5<- MD %>%
  111. + filter(Temp>=130,Time>"2015/02/26 00:00:00")
  112.  
  113. > On5_L <-ggplot(On5,aes(Time,Temp))+geom_line()+ggtitle("Temperature Over Time for Time>2015/02/26")+scale_y_continuous("Temperature /oC")
  114.  
  115. > On5_B <-ggplot(On5,aes(Time,Temp))+geom_boxplot()+ggtitle("Boxplot of Temperature Over Time")+scale_y_continuous("Temperature /oC")
  116.  
  117. > summary(On4)
  118. Time Temp
  119. Min. :2015-01-19 01:00:00 Min. :132.3
  120. 1st Qu.:2015-01-24 01:15:00 1st Qu.:148.9
  121. Median :2015-01-29 00:30:00 Median :151.1
  122. Mean :2015-01-29 00:20:20 Mean :153.6
  123. 3rd Qu.:2015-02-02 23:45:00 3rd Qu.:159.6
  124. Max. :2015-02-07 23:00:00 Max. :165.6
  125.  
  126. > sd(On4[,2])
  127. [1] 5.824139
  128.  
  129. > On_TimeFrames <-ggarrange(On1_L,On1_B, On2_L,On2_B,On3_L,On3_B,On4_L,On4_B,On5_L,On5_B,
  130. + labels = c("A", "B","C", "D","E", "F","G","H"," ..." ... [TRUNCATED]
  131.  
  132. > annotate_figure(On_TimeFrames,top = text_grob("Time periods when Heat Exchanger is ON (Temp >130oC)", color = "red", face = "bold", size = 14))
  133.  
  134. > #Set Off
  135. > Off<- MD %>%
  136. + filter(Temp<=50)
  137.  
  138. > Off_L <- ggplot(Off,aes(x=Time,y=Temp))+geom_line()+ggtitle("Temperature Over Time")+scale_y_continuous("Temperature /oC")
  139.  
  140. > Off_B <- ggplot(Off,aes(x=Time,y=Temp))+geom_boxplot()+ggtitle("Boxplot of Temperature Data")+scale_y_continuous("Temperature /oC")
  141.  
  142. > Off_H <- ggplot(Off,aes(x=Temp))+geom_histogram()+ggtitle("Temperature Frequency Distribution")+scale_x_continuous("Temperature / oC")+scale_y_conti .... [TRUNCATED]
  143.  
  144. > Off_all <- ggarrange(Off_L,Off_B, Off_H,
  145. + labels = c("A", "B","C"),
  146. + ncol = 1, nrow = 3,common.legend .... [TRUNCATED]
  147. `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
  148. `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
  149.  
  150. > annotate_figure(Off_all,top = text_grob("Period for When Heat Exchanger is OFF (Temp <50oC)", color = "red", face = "bold", size = 14))
  151.  
  152. > summary(Off)
  153. Time Temp
  154. Min. :2014-11-09 08:00:00 Min. :25.57
  155. 1st Qu.:2014-11-20 22:45:00 1st Qu.:33.79
  156. Median :2014-12-22 10:30:00 Median :37.36
  157. Mean :2015-01-04 18:12:47 Mean :37.25
  158. 3rd Qu.:2015-02-14 10:15:00 3rd Qu.:40.53
  159. Max. :2015-02-26 16:00:00 Max. :49.64
  160.  
  161. > sd(Off[,2])
  162. [1] 4.490162
  163.  
  164. > #Filtered
  165. > #Set Off1
  166. > Off1<- MD %>%
  167. + filter(Temp<=50,Time>"2014/11/8 00:00:00", Time<"2014/11/21 00:00:00")
  168.  
  169. > Off1_L<-ggplot(Off1, aes(Time,Temp))+geom_line()+ggtitle("Temperature Over Time for 2014/11/8>Time>2014/11/21")+scale_y_continuous("Temperature /oC" .... [TRUNCATED]
  170.  
  171. > Off1_B<-ggplot(Off1,aes(Time,Temp))+geom_boxplot()+ggtitle("Boxplot of Temperature Over Time")+scale_y_continuous("Temperature /oC")
  172.  
  173. > summary(Off1)
  174. Time Temp
  175. Min. :2014-11-09 08:00:00 Min. :29.37
  176. 1st Qu.:2014-11-12 05:45:00 1st Qu.:37.82
  177. Median :2014-11-15 03:30:00 Median :40.00
  178. Mean :2014-11-15 03:30:00 Mean :40.12
  179. 3rd Qu.:2014-11-18 01:15:00 3rd Qu.:42.40
  180. Max. :2014-11-20 23:00:00 Max. :49.38
  181.  
  182. > sd(Off1[,2])
  183. [1] 3.389296
  184.  
  185. > #Set Off2
  186. > Off2<- MD %>%
  187. + filter(Temp<=50,Time>"2014/12/12 00:00:00",Time<"2014/12/23 00:00:00")
  188.  
  189. > Off2_L<-ggplot(Off2,aes(Time,Temp))+geom_line()+ggtitle("Temperature Over Time for 2014/12/12>Time>2014/12/23")+scale_y_continuous("Temperature /oC" .... [TRUNCATED]
  190.  
  191. > Off2_B<-ggplot(Off2,aes(Time,Temp))+geom_boxplot()+ggtitle("Boxplot of Temperature Over Time")+scale_y_continuous("Temperature /oC")
  192.  
  193. > summary(Off2)
  194. Time Temp
  195. Min. :2014-12-12 01:00:00 Min. :28.70
  196. 1st Qu.:2014-12-14 16:15:00 1st Qu.:34.48
  197. Median :2014-12-17 07:30:00 Median :38.29
  198. Mean :2014-12-17 07:30:00 Mean :37.79
  199. 3rd Qu.:2014-12-19 22:45:00 3rd Qu.:40.93
  200. Max. :2014-12-22 14:00:00 Max. :45.21
  201.  
  202. > sd(Off2[,2])
  203. [1] 3.805508
  204.  
  205. > #Set Off3
  206. > Off3<- MD %>%
  207. + filter(Temp<=50,Time>"2015/01/12 00:00:00",Time<"2015/1/19 00:00:00")
  208.  
  209. > Off3_L<- ggplot(Off3,aes(Time,Temp))+geom_line()+ggtitle("Temperature Over Time for 2015/01/12>Time>2015/1/19")+scale_y_continuous("Temperature /oC" .... [TRUNCATED]
  210.  
  211. > Off3_B<- ggplot(Off3,aes(Time,Temp))+geom_boxplot()+ggtitle("Boxplot of Temperature Over Time")+scale_y_continuous("Temperature /oC")
  212.  
  213. > summary(Off3)
  214. Time Temp
  215. Min. :2015-01-13 02:00:00 Min. :31.17
  216. 1st Qu.:2015-01-14 09:45:00 1st Qu.:35.50
  217. Median :2015-01-15 17:30:00 Median :38.30
  218. Mean :2015-01-15 17:30:00 Mean :38.18
  219. 3rd Qu.:2015-01-17 01:15:00 3rd Qu.:40.67
  220. Max. :2015-01-18 09:00:00 Max. :48.62
  221.  
  222. > sd(Off3[,2])
  223. [1] 3.389462
  224.  
  225. > #Set off4
  226. > Off4<- MD %>%
  227. + filter(Temp<=50,Time>"2015/02/8 00:00:00",Time<"2015/02/26 00:00:00")
  228.  
  229. > Off4_L<-ggplot(Off4,aes(Time,Temp))+geom_line()+ggtitle("Temperature Over Time for 2015/02/8>Time>2015/02/26")+scale_y_continuous("Temperature /oC")
  230.  
  231. > Off4_B<-ggplot(Off4,aes(Time,Temp))+geom_boxplot()+ggtitle("Boxplot of Temperature Over Time")+scale_y_continuous("Temperature /oC")
  232.  
  233. > summary(Off4)
  234. Time Temp
  235. Min. :2015-02-08 08:00:00 Min. :25.57
  236. 1st Qu.:2015-02-12 14:00:00 1st Qu.:32.02
  237. Median :2015-02-16 20:00:00 Median :33.85
  238. Mean :2015-02-16 22:20:49 Mean :34.31
  239. 3rd Qu.:2015-02-21 02:00:00 3rd Qu.:36.50
  240. Max. :2015-02-25 23:00:00 Max. :49.64
  241.  
  242. > sd(Off4[,2])
  243. [1] 3.932441
  244.  
  245. > On_TimeFrames <-ggarrange(Off1_L,Off1_B, Off2_L,Off2_B,Off3_L,Off3_B,Off4_L,Off4_B,
  246. + labels = c("A", "B","C", "D","E", "F ..." ... [TRUNCATED]
  247.  
  248. > annotate_figure(On_TimeFrames,top = text_grob("Time periods when Heat Exchanger is OFF (Temp<50oC)", color = "red", face = "bold", size = 14))
  249.  
  250. > #Variance PLot
  251. > #dz<-diff(MD[,2])
  252. > #plot(time_var,dz)
  253. >
  254. >
  255. > # # #Set 1_5/5
  256. > # # we<- MD %>%
  257. > # # filter(Temp>=135,Time<"2014/11/9 12:00:00") .... [TRUNCATED]
  258. There were 50 or more warnings (use warnings() to see the first 50)
  259. > source('~/CHICA/Ass1/Ass1/FFT.R', echo=TRUE)
  260.  
  261. > #install.packages(tidy)
  262. > #D2H14A:TTPV Exchanger 14A temperature
  263. > library(readxl)
  264.  
  265. > library(tidyverse)
  266.  
  267. > library(xts)
  268.  
  269. > library(forecast)
  270.  
  271. > library(ggpubr)
  272.  
  273. > library(EnvStats)
  274.  
  275. > rm(list=ls())
  276.  
  277. > data<- read_excel("QAL_plant.xlsx", sheet = 1, skip = 3, col_names = TRUE)
  278. New names:
  279. * Date -> Date..1
  280. * Date -> Date..2
  281. * D2H12TTPVTemp_oC -> D2H12TTPVTemp_oC..21
  282. * D2H13TTPVTemp_oC -> D2H13TTPVTemp_oC..22
  283. * D2H14TTPVTemp_oC -> D2H14TTPVTemp_oC..23
  284. * ... and 5 more
  285.  
  286. > T1Col <- 18
  287.  
  288. > #Temp Data
  289. > my_Temp<-data[T1Col]
  290.  
  291. > #Creating Time Data
  292. > time_index <- seq(from=as.POSIXct("2014-10-28 00:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  293.  
  294. > time_var<- seq(from=as.POSIXct("2014-10-28 01:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  295.  
  296. > #My Data
  297. > MD <- data.frame(time_index,my_Temp)
  298.  
  299. > colnames(MD) <- c("Time","Temp")
  300.  
  301. > #################################################= Required Functions
  302. > plot.frequency.spectrum <- function(X.k, xlimits=c(0,length(X.k))) {
  303. + plo .... [TRUNCATED]
  304.  
  305. > # Plot the i-th harmonic
  306. > # Xk: the frequencies computed by the FFt
  307. > # i: which harmonic
  308. > # ts: the sampling time points
  309. > # acq.freq: the acqui .... [TRUNCATED]
  310.  
  311. > get.trajectory <- function(X.k,ts,acq.freq) {
  312. +
  313. + N <- length(ts)
  314. + i <- complex(real = 0, imaginary = 1)
  315. + x.n <- rep(0,N) # .... [TRUNCATED]
  316.  
  317. > 2############################=Working
  318. [1] 2
  319.  
  320. > X.k <- fft(MD$Temp) # find all harmonics with fft()
  321.  
  322. > plot.frequency.spectrum(X.k, xlimits=c(0,100))
  323. There were 50 or more warnings (use warnings() to see the first 50)
  324. > source('~/CHICA/Ass1/Ass1/FFT.R', echo=TRUE)
  325.  
  326. > #install.packages(tidy)
  327. > #D2H14A:TTPV Exchanger 14A temperature
  328. > library(readxl)
  329.  
  330. > library(tidyverse)
  331.  
  332. > library(xts)
  333.  
  334. > library(forecast)
  335.  
  336. > library(ggpubr)
  337.  
  338. > library(EnvStats)
  339.  
  340. > rm(list=ls())
  341.  
  342. > data<- read_excel("QAL_plant.xlsx", sheet = 1, skip = 3, col_names = TRUE)
  343. New names:
  344. * Date -> Date..1
  345. * Date -> Date..2
  346. * D2H12TTPVTemp_oC -> D2H12TTPVTemp_oC..21
  347. * D2H13TTPVTemp_oC -> D2H13TTPVTemp_oC..22
  348. * D2H14TTPVTemp_oC -> D2H14TTPVTemp_oC..23
  349. * ... and 5 more
  350.  
  351. > T1Col <- 18
  352.  
  353. > #Temp Data
  354. > my_Temp<-data[T1Col]
  355.  
  356. > #Creating Time Data
  357. > time_index <- seq(from=as.POSIXct("2014-10-28 00:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  358.  
  359. > time_var<- seq(from=as.POSIXct("2014-10-28 01:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  360.  
  361. > #My Data
  362. > MD <- data.frame(time_index,my_Temp)
  363.  
  364. > colnames(MD) <- c("Time","Temp")
  365.  
  366. > #################################################= Required Functions
  367. > plot.frequency.spectrum <- function(X.k, xlimits=c(0,length(X.k))) {
  368. + plo .... [TRUNCATED]
  369.  
  370. > # Plot the i-th harmonic
  371. > # Xk: the frequencies computed by the FFt
  372. > # i: which harmonic
  373. > # ts: the sampling time points
  374. > # acq.freq: the acqui .... [TRUNCATED]
  375.  
  376. > get.trajectory <- function(X.k,ts,acq.freq) {
  377. +
  378. + N <- length(ts)
  379. + i <- complex(real = 0, imaginary = 1)
  380. + x.n <- rep(0,N) # .... [TRUNCATED]
  381.  
  382. > 2############################=Working
  383. [1] 2
  384.  
  385. > X.k <- fft(MD$Temp %>% filter(Temp>=137)) # find all harmonics with fft()
  386. Error in UseMethod("filter_") :
  387. no applicable method for 'filter_' applied to an object of class "c('double', 'numeric')"
  388. In addition: There were 50 or more warnings (use warnings() to see the first 50)
  389. > source('~/CHICA/Ass1/Ass1/FFT.R', echo=TRUE)
  390.  
  391. > #install.packages(tidy)
  392. > #D2H14A:TTPV Exchanger 14A temperature
  393. > library(readxl)
  394.  
  395. > library(tidyverse)
  396.  
  397. > library(xts)
  398.  
  399. > library(forecast)
  400.  
  401. > library(ggpubr)
  402.  
  403. > library(EnvStats)
  404.  
  405. > rm(list=ls())
  406.  
  407. > data<- read_excel("QAL_plant.xlsx", sheet = 1, skip = 3, col_names = TRUE)
  408. New names:
  409. * Date -> Date..1
  410. * Date -> Date..2
  411. * D2H12TTPVTemp_oC -> D2H12TTPVTemp_oC..21
  412. * D2H13TTPVTemp_oC -> D2H13TTPVTemp_oC..22
  413. * D2H14TTPVTemp_oC -> D2H14TTPVTemp_oC..23
  414. * ... and 5 more
  415.  
  416. > T1Col <- 18
  417.  
  418. > #Temp Data
  419. > my_Temp<-data[T1Col]
  420.  
  421. > #Creating Time Data
  422. > time_index <- seq(from=as.POSIXct("2014-10-28 00:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  423.  
  424. > time_var<- seq(from=as.POSIXct("2014-10-28 01:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  425.  
  426. > #My Data
  427. > MD <- data.frame(time_index,my_Temp)
  428.  
  429. > colnames(MD) <- c("Time","Temp")
  430.  
  431. > #################################################= Required Functions
  432. > plot.frequency.spectrum <- function(X.k, xlimits=c(0,length(X.k))) {
  433. + plo .... [TRUNCATED]
  434.  
  435. > # Plot the i-th harmonic
  436. > # Xk: the frequencies computed by the FFt
  437. > # i: which harmonic
  438. > # ts: the sampling time points
  439. > # acq.freq: the acqui .... [TRUNCATED]
  440.  
  441. > get.trajectory <- function(X.k,ts,acq.freq) {
  442. +
  443. + N <- length(ts)
  444. + i <- complex(real = 0, imaginary = 1)
  445. + x.n <- rep(0,N) # .... [TRUNCATED]
  446.  
  447. > 2############################=Working
  448. [1] 2
  449.  
  450. > X.k <- fft(MD %>% filter(Temp>=137)) # find all harmonics with fft()
  451. Error in fft(MD %>% filter(Temp >= 137)) : non-numeric argument
  452. In addition: There were 50 or more warnings (use warnings() to see the first 50)
  453. > source('~/CHICA/Ass1/Ass1/FFT.R', echo=TRUE)
  454.  
  455. > #install.packages(tidy)
  456. > #D2H14A:TTPV Exchanger 14A temperature
  457. > library(readxl)
  458.  
  459. > library(tidyverse)
  460.  
  461. > library(xts)
  462.  
  463. > library(forecast)
  464.  
  465. > library(ggpubr)
  466.  
  467. > library(EnvStats)
  468.  
  469. > rm(list=ls())
  470.  
  471. > data<- read_excel("QAL_plant.xlsx", sheet = 1, skip = 3, col_names = TRUE)
  472. New names:
  473. * Date -> Date..1
  474. * Date -> Date..2
  475. * D2H12TTPVTemp_oC -> D2H12TTPVTemp_oC..21
  476. * D2H13TTPVTemp_oC -> D2H13TTPVTemp_oC..22
  477. * D2H14TTPVTemp_oC -> D2H14TTPVTemp_oC..23
  478. * ... and 5 more
  479.  
  480. > T1Col <- 18
  481.  
  482. > #Temp Data
  483. > my_Temp<-data[T1Col]
  484.  
  485. > #Creating Time Data
  486. > time_index <- seq(from=as.POSIXct("2014-10-28 00:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  487.  
  488. > time_var<- seq(from=as.POSIXct("2014-10-28 01:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  489.  
  490. > #My Data
  491. > MD <- data.frame(time_index,my_Temp)
  492.  
  493. > colnames(MD) <- c("Time","Temp")
  494.  
  495. > #################################################= Required Functions
  496. > plot.frequency.spectrum <- function(X.k, xlimits=c(0,length(X.k))) {
  497. + plo .... [TRUNCATED]
  498.  
  499. > # Plot the i-th harmonic
  500. > # Xk: the frequencies computed by the FFt
  501. > # i: which harmonic
  502. > # ts: the sampling time points
  503. > # acq.freq: the acqui .... [TRUNCATED]
  504.  
  505. > get.trajectory <- function(X.k,ts,acq.freq) {
  506. +
  507. + N <- length(ts)
  508. + i <- complex(real = 0, imaginary = 1)
  509. + x.n <- rep(0,N) # .... [TRUNCATED]
  510.  
  511. > 2############################=Working
  512. [1] 2
  513.  
  514. > X.k <- fft(MD$Temp %>% filter(Temp>=137)) # find all harmonics with fft()
  515. Error in UseMethod("filter_") :
  516. no applicable method for 'filter_' applied to an object of class "c('double', 'numeric')"
  517. In addition: There were 50 or more warnings (use warnings() to see the first 50)
  518. > source('~/CHICA/Ass1/Ass1/FFT.R', echo=TRUE)
  519.  
  520. > #install.packages(tidy)
  521. > #D2H14A:TTPV Exchanger 14A temperature
  522. > library(readxl)
  523.  
  524. > library(tidyverse)
  525.  
  526. > library(xts)
  527.  
  528. > library(forecast)
  529.  
  530. > library(ggpubr)
  531.  
  532. > library(EnvStats)
  533.  
  534. > rm(list=ls())
  535.  
  536. > data<- read_excel("QAL_plant.xlsx", sheet = 1, skip = 3, col_names = TRUE)
  537. New names:
  538. * Date -> Date..1
  539. * Date -> Date..2
  540. * D2H12TTPVTemp_oC -> D2H12TTPVTemp_oC..21
  541. * D2H13TTPVTemp_oC -> D2H13TTPVTemp_oC..22
  542. * D2H14TTPVTemp_oC -> D2H14TTPVTemp_oC..23
  543. * ... and 5 more
  544.  
  545. > T1Col <- 18
  546.  
  547. > #Temp Data
  548. > my_Temp<-data[T1Col]
  549.  
  550. > #Creating Time Data
  551. > time_index <- seq(from=as.POSIXct("2014-10-28 00:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  552.  
  553. > time_var<- seq(from=as.POSIXct("2014-10-28 01:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  554.  
  555. > #My Data
  556. > MD <- data.frame(time_index,my_Temp)
  557.  
  558. > colnames(MD) <- c("Time","Temp")
  559.  
  560. > #################################################= Required Functions
  561. > plot.frequency.spectrum <- function(X.k, xlimits=c(0,length(X.k))) {
  562. + plo .... [TRUNCATED]
  563.  
  564. > # Plot the i-th harmonic
  565. > # Xk: the frequencies computed by the FFt
  566. > # i: which harmonic
  567. > # ts: the sampling time points
  568. > # acq.freq: the acqui .... [TRUNCATED]
  569.  
  570. > get.trajectory <- function(X.k,ts,acq.freq) {
  571. +
  572. + N <- length(ts)
  573. + i <- complex(real = 0, imaginary = 1)
  574. + x.n <- rep(0,N) # .... [TRUNCATED]
  575.  
  576. > On<- MD %>%
  577. + filter(Temp>=137)
  578.  
  579. > 2############################=Working
  580. [1] 2
  581.  
  582. > X.k <- fft(On$Temp) # find all harmonics with fft()
  583.  
  584. > plot.frequency.spectrum(X.k, xlimits=c(0,100))
  585. There were 50 or more warnings (use warnings() to see the first 50)
  586. > source('~/CHICA/Ass1/Ass1/FFT.R', echo=TRUE)
  587.  
  588. > #install.packages(tidy)
  589. > #D2H14A:TTPV Exchanger 14A temperature
  590. > library(readxl)
  591.  
  592. > library(tidyverse)
  593.  
  594. > library(xts)
  595.  
  596. > library(forecast)
  597.  
  598. > library(ggpubr)
  599.  
  600. > library(EnvStats)
  601.  
  602. > rm(list=ls())
  603.  
  604. > data<- read_excel("QAL_plant.xlsx", sheet = 1, skip = 3, col_names = TRUE)
  605. New names:
  606. * Date -> Date..1
  607. * Date -> Date..2
  608. * D2H12TTPVTemp_oC -> D2H12TTPVTemp_oC..21
  609. * D2H13TTPVTemp_oC -> D2H13TTPVTemp_oC..22
  610. * D2H14TTPVTemp_oC -> D2H14TTPVTemp_oC..23
  611. * ... and 5 more
  612.  
  613. > T1Col <- 18
  614.  
  615. > #Temp Data
  616. > my_Temp<-data[T1Col]
  617.  
  618. > #Creating Time Data
  619. > time_index <- seq(from=as.POSIXct("2014-10-28 00:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  620.  
  621. > time_var<- seq(from=as.POSIXct("2014-10-28 01:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  622.  
  623. > #My Data
  624. > MD <- data.frame(time_index,my_Temp)
  625.  
  626. > colnames(MD) <- c("Time","Temp")
  627.  
  628. > #################################################= Required Functions
  629. > plot.frequency.spectrum <- function(X.k, xlimits=c(0,length(X.k))) {
  630. + plo .... [TRUNCATED]
  631.  
  632. > # Plot the i-th harmonic
  633. > # Xk: the frequencies computed by the FFt
  634. > # i: which harmonic
  635. > # ts: the sampling time points
  636. > # acq.freq: the acqui .... [TRUNCATED]
  637.  
  638. > get.trajectory <- function(X.k,ts,acq.freq) {
  639. +
  640. + N <- length(ts)
  641. + i <- complex(real = 0, imaginary = 1)
  642. + x.n <- rep(0,N) # .... [TRUNCATED]
  643.  
  644. > On<- MD %>%
  645. + filter(Temp>=137)
  646.  
  647. > On1<- MD %>%
  648. + filter(Temp>=137,Time<"2014/11/8 00:00:00")
  649.  
  650. > On2<- MD %>%
  651. + filter(Temp>=137,Time>"2014/11/21 00:00:00",Time<"2014/12/12 00:00:00")
  652.  
  653. > On3<- MD %>%
  654. + filter(Temp>=137,Time>"2014/12/23 00:00:00",Time<"2015/01/12 00:00:00")
  655.  
  656. > On4<- MD %>%
  657. + filter(Temp>=137,Time>"2015/1/19 00:00:00",Time<"2015/02/8 00:00:00")
  658.  
  659. > On5<- MD %>%
  660. + filter(Temp>=137,Time>"2014/11/01 00:00:00",Time<"2014/11/01 12:00:00")
  661.  
  662. > 2############################=Working
  663. [1] 2
  664.  
  665. > X.k <- fft(On1$Temp) # find all harmonics with fft()
  666.  
  667. > plot.frequency.spectrum(X.k, xlimits=c(0,100))
  668. There were 50 or more warnings (use warnings() to see the first 50)
  669. > source('~/CHICA/Ass1/Ass1/FFT.R', echo=TRUE)
  670.  
  671. > #install.packages(tidy)
  672. > #D2H14A:TTPV Exchanger 14A temperature
  673. > library(readxl)
  674.  
  675. > library(tidyverse)
  676.  
  677. > library(xts)
  678.  
  679. > library(forecast)
  680.  
  681. > library(ggpubr)
  682.  
  683. > library(EnvStats)
  684.  
  685. > rm(list=ls())
  686.  
  687. > data<- read_excel("QAL_plant.xlsx", sheet = 1, skip = 3, col_names = TRUE)
  688. New names:
  689. * Date -> Date..1
  690. * Date -> Date..2
  691. * D2H12TTPVTemp_oC -> D2H12TTPVTemp_oC..21
  692. * D2H13TTPVTemp_oC -> D2H13TTPVTemp_oC..22
  693. * D2H14TTPVTemp_oC -> D2H14TTPVTemp_oC..23
  694. * ... and 5 more
  695.  
  696. > T1Col <- 18
  697.  
  698. > #Temp Data
  699. > my_Temp<-data[T1Col]
  700.  
  701. > #Creating Time Data
  702. > time_index <- seq(from=as.POSIXct("2014-10-28 00:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  703.  
  704. > time_var<- seq(from=as.POSIXct("2014-10-28 01:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  705.  
  706. > #My Data
  707. > MD <- data.frame(time_index,my_Temp)
  708.  
  709. > colnames(MD) <- c("Time","Temp")
  710.  
  711. > #################################################= Required Functions
  712. > plot.frequency.spectrum <- function(X.k, xlimits=c(0,length(X.k))) {
  713. + plo .... [TRUNCATED]
  714.  
  715. > # Plot the i-th harmonic
  716. > # Xk: the frequencies computed by the FFt
  717. > # i: which harmonic
  718. > # ts: the sampling time points
  719. > # acq.freq: the acqui .... [TRUNCATED]
  720.  
  721. > get.trajectory <- function(X.k,ts,acq.freq) {
  722. +
  723. + N <- length(ts)
  724. + i <- complex(real = 0, imaginary = 1)
  725. + x.n <- rep(0,N) # .... [TRUNCATED]
  726.  
  727. > On<- MD %>%
  728. + filter(Temp>=137)
  729.  
  730. > On1<- MD %>%
  731. + filter(Temp>=137,Time<"2014/11/8 00:00:00")
  732.  
  733. > On2<- MD %>%
  734. + filter(Temp>=137,Time>"2014/11/21 00:00:00",Time<"2014/12/12 00:00:00")
  735.  
  736. > On3<- MD %>%
  737. + filter(Temp>=137,Time>"2014/12/23 00:00:00",Time<"2015/01/12 00:00:00")
  738.  
  739. > On4<- MD %>%
  740. + filter(Temp>=137,Time>"2015/1/19 00:00:00",Time<"2015/02/8 00:00:00")
  741.  
  742. > On5<- MD %>%
  743. + filter(Temp>=137,Time>"2014/11/01 00:00:00",Time<"2014/11/01 12:00:00")
  744.  
  745. > 2############################=Working
  746. [1] 2
  747.  
  748. > X.k <- fft(On2$Temp) # find all harmonics with fft()
  749.  
  750. > plot.frequency.spectrum(X.k, xlimits=c(0,100))
  751. There were 50 or more warnings (use warnings() to see the first 50)
  752. > source('~/CHICA/Ass1/Ass1/FFT.R', echo=TRUE)
  753.  
  754. > #install.packages(tidy)
  755. > #D2H14A:TTPV Exchanger 14A temperature
  756. > library(readxl)
  757.  
  758. > library(tidyverse)
  759.  
  760. > library(xts)
  761.  
  762. > library(forecast)
  763.  
  764. > library(ggpubr)
  765.  
  766. > library(EnvStats)
  767.  
  768. > rm(list=ls())
  769.  
  770. > data<- read_excel("QAL_plant.xlsx", sheet = 1, skip = 3, col_names = TRUE)
  771. New names:
  772. * Date -> Date..1
  773. * Date -> Date..2
  774. * D2H12TTPVTemp_oC -> D2H12TTPVTemp_oC..21
  775. * D2H13TTPVTemp_oC -> D2H13TTPVTemp_oC..22
  776. * D2H14TTPVTemp_oC -> D2H14TTPVTemp_oC..23
  777. * ... and 5 more
  778.  
  779. > T1Col <- 18
  780.  
  781. > #Temp Data
  782. > my_Temp<-data[T1Col]
  783.  
  784. > #Creating Time Data
  785. > time_index <- seq(from=as.POSIXct("2014-10-28 00:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  786.  
  787. > time_var<- seq(from=as.POSIXct("2014-10-28 01:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  788.  
  789. > #My Data
  790. > MD <- data.frame(time_index,my_Temp)
  791.  
  792. > colnames(MD) <- c("Time","Temp")
  793.  
  794. > #################################################= Required Functions
  795. > plot.frequency.spectrum <- function(X.k, xlimits=c(0,length(X.k))) {
  796. + plo .... [TRUNCATED]
  797.  
  798. > # Plot the i-th harmonic
  799. > # Xk: the frequencies computed by the FFt
  800. > # i: which harmonic
  801. > # ts: the sampling time points
  802. > # acq.freq: the acqui .... [TRUNCATED]
  803.  
  804. > get.trajectory <- function(X.k,ts,acq.freq) {
  805. +
  806. + N <- length(ts)
  807. + i <- complex(real = 0, imaginary = 1)
  808. + x.n <- rep(0,N) # .... [TRUNCATED]
  809.  
  810. > On<- MD %>%
  811. + filter(Temp>=137)
  812.  
  813. > On1<- MD %>%
  814. + filter(Temp>=137,Time<"2014/11/8 00:00:00")
  815.  
  816. > On2<- MD %>%
  817. + filter(Temp>=137,Time>"2014/11/21 00:00:00",Time<"2014/12/12 00:00:00")
  818.  
  819. > On3<- MD %>%
  820. + filter(Temp>=137,Time>"2014/12/23 00:00:00",Time<"2015/01/12 00:00:00")
  821.  
  822. > On4<- MD %>%
  823. + filter(Temp>=137,Time>"2015/1/19 00:00:00",Time<"2015/02/8 00:00:00")
  824.  
  825. > On5<- MD %>%
  826. + filter(Temp>=137,Time>"2014/11/01 00:00:00",Time<"2014/11/01 12:00:00")
  827.  
  828. > 2############################=Working
  829. [1] 2
  830.  
  831. > X.k <- fft(On$Temp) # find all harmonics with fft()
  832.  
  833. > plot.frequency.spectrum(X.k, xlimits=c(0,100))
  834. There were 50 or more warnings (use warnings() to see the first 50)
  835. > source('~/CHICA/Ass1/Ass1/FFT.R', echo=TRUE)
  836.  
  837. > #install.packages(tidy)
  838. > #D2H14A:TTPV Exchanger 14A temperature
  839. > library(readxl)
  840.  
  841. > library(tidyverse)
  842.  
  843. > library(xts)
  844.  
  845. > library(forecast)
  846.  
  847. > library(ggpubr)
  848.  
  849. > library(EnvStats)
  850.  
  851. > rm(list=ls())
  852.  
  853. > data<- read_excel("QAL_plant.xlsx", sheet = 1, skip = 3, col_names = TRUE)
  854. New names:
  855. * Date -> Date..1
  856. * Date -> Date..2
  857. * D2H12TTPVTemp_oC -> D2H12TTPVTemp_oC..21
  858. * D2H13TTPVTemp_oC -> D2H13TTPVTemp_oC..22
  859. * D2H14TTPVTemp_oC -> D2H14TTPVTemp_oC..23
  860. * ... and 5 more
  861.  
  862. > T1Col <- 18
  863.  
  864. > #Temp Data
  865. > my_Temp<-data[T1Col]
  866.  
  867. > #Creating Time Data
  868. > time_index <- seq(from=as.POSIXct("2014-10-28 00:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  869.  
  870. > time_var<- seq(from=as.POSIXct("2014-10-28 01:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  871.  
  872. > #My Data
  873. > MD <- data.frame(time_index,my_Temp)
  874.  
  875. > colnames(MD) <- c("Time","Temp")
  876.  
  877. > #################################################= Required Functions
  878. > plot.frequency.spectrum <- function(X.k, xlimits=c(0,length(X.k))) {
  879. + plo .... [TRUNCATED]
  880.  
  881. > # Plot the i-th harmonic
  882. > # Xk: the frequencies computed by the FFt
  883. > # i: which harmonic
  884. > # ts: the sampling time points
  885. > # acq.freq: the acqui .... [TRUNCATED]
  886.  
  887. > get.trajectory <- function(X.k,ts,acq.freq) {
  888. +
  889. + N <- length(ts)
  890. + i <- complex(real = 0, imaginary = 1)
  891. + x.n <- rep(0,N) # .... [TRUNCATED]
  892.  
  893. > On<- MD %>%
  894. + filter(Temp>=137)
  895.  
  896. > On1<- MD %>%
  897. + filter(Temp>=137,Time<"2014/11/8 00:00:00")
  898.  
  899. > On2<- MD %>%
  900. + filter(Temp>=137,Time>"2014/11/21 00:00:00",Time<"2014/12/12 00:00:00")
  901.  
  902. > On3<- MD %>%
  903. + filter(Temp>=137,Time>"2014/12/23 00:00:00",Time<"2015/01/12 00:00:00")
  904.  
  905. > On4<- MD %>%
  906. + filter(Temp>=137,Time>"2015/1/19 00:00:00",Time<"2015/02/8 00:00:00")
  907.  
  908. > On5<- MD %>%
  909. + filter(Temp>=137,Time>"2014/11/01 00:00:00",Time<"2014/11/01 12:00:00")
  910.  
  911. > 2############################=Working
  912. [1] 2
  913.  
  914. > X.k <- fft(On3$Temp) # find all harmonics with fft()
  915.  
  916. > plot.frequency.spectrum(X.k, xlimits=c(0,100))
  917. There were 50 or more warnings (use warnings() to see the first 50)
  918. > source('~/CHICA/Ass1/Ass1/FFT.R', echo=TRUE)
  919.  
  920. > #install.packages(tidy)
  921. > #D2H14A:TTPV Exchanger 14A temperature
  922. > library(readxl)
  923.  
  924. > library(tidyverse)
  925.  
  926. > library(xts)
  927.  
  928. > library(forecast)
  929.  
  930. > library(ggpubr)
  931.  
  932. > library(EnvStats)
  933.  
  934. > rm(list=ls())
  935.  
  936. > data<- read_excel("QAL_plant.xlsx", sheet = 1, skip = 3, col_names = TRUE)
  937. New names:
  938. * Date -> Date..1
  939. * Date -> Date..2
  940. * D2H12TTPVTemp_oC -> D2H12TTPVTemp_oC..21
  941. * D2H13TTPVTemp_oC -> D2H13TTPVTemp_oC..22
  942. * D2H14TTPVTemp_oC -> D2H14TTPVTemp_oC..23
  943. * ... and 5 more
  944.  
  945. > T1Col <- 18
  946.  
  947. > #Temp Data
  948. > my_Temp<-data[T1Col]
  949.  
  950. > #Creating Time Data
  951. > time_index <- seq(from=as.POSIXct("2014-10-28 00:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  952.  
  953. > time_var<- seq(from=as.POSIXct("2014-10-28 01:00"), to =as.POSIXct("2015-03-01 13:00"), by="hour")
  954.  
  955. > #My Data
  956. > MD <- data.frame(time_index,my_Temp)
  957.  
  958. > colnames(MD) <- c("Time","Temp")
  959.  
  960. > #################################################= Required Functions
  961. > plot.frequency.spectrum <- function(X.k, xlimits=c(0,length(X.k))) {
  962. + plo .... [TRUNCATED]
  963.  
  964. > # Plot the i-th harmonic
  965. > # Xk: the frequencies computed by the FFt
  966. > # i: which harmonic
  967. > # ts: the sampling time points
  968. > # acq.freq: the acqui .... [TRUNCATED]
  969.  
  970. > get.trajectory <- function(X.k,ts,acq.freq) {
  971. +
  972. + N <- length(ts)
  973. + i <- complex(real = 0, imaginary = 1)
  974. + x.n <- rep(0,N) # .... [TRUNCATED]
  975.  
  976. > On<- MD %>%
  977. + filter(Temp>=137)
  978.  
  979. > On1<- MD %>%
  980. + filter(Temp>=137,Time<"2014/11/8 00:00:00")
  981.  
  982. > On2<- MD %>%
  983. + filter(Temp>=137,Time>"2014/11/21 00:00:00",Time<"2014/12/12 00:00:00")
  984.  
  985. > On3<- MD %>%
  986. + filter(Temp>=137,Time>"2014/12/23 00:00:00",Time<"2015/01/12 00:00:00")
  987.  
  988. > On4<- MD %>%
  989. + filter(Temp>=137,Time>"2015/1/19 00:00:00",Time<"2015/02/8 00:00:00")
  990.  
  991. > On5<- MD %>%
  992. + filter(Temp>=137,Time>"2014/11/01 00:00:00",Time<"2014/11/01 12:00:00")
  993.  
  994. > 2############################=Working
  995. [1] 2
  996.  
  997. > X.k <- fft(On4$Temp) # find all harmonics with fft()
  998.  
  999. > plot.frequency.spectrum(X.k, xlimits=c(0,100))
  1000. There were 50 or more warnings (use warnings() to see the first 50)
  1001. >
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement