library(readxl)
library(extrafont)
## Registering fonts with R
#font_import()

x = c(1:97)

Y_test <- read_xlsx("Y_test_image1.xlsx")
## New names:
## * `` -> ...1
Y_pred <- read_xlsx("Y_pred_image1.xlsx")
## New names:
## * `` -> ...1
Y_test[40,2:98]
## # A tibble: 1 × 97
##     `0`   `1`   `2`   `3`   `4`   `5`   `6`   `7`   `8`   `9`  `10`  `11`  `12`
##   <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1  298.  298.  298.  298.  298.  298.  298.  298.  298.  298.  298.  298.  298.
## # … with 84 more variables: 13 <dbl>, 14 <dbl>, 15 <dbl>, 16 <dbl>, 17 <dbl>,
## #   18 <dbl>, 19 <dbl>, 20 <dbl>, 21 <dbl>, 22 <dbl>, 23 <dbl>, 24 <dbl>,
## #   25 <dbl>, 26 <dbl>, 27 <dbl>, 28 <dbl>, 29 <dbl>, 30 <dbl>, 31 <dbl>,
## #   32 <dbl>, 33 <dbl>, 34 <dbl>, 35 <dbl>, 36 <dbl>, 37 <dbl>, 38 <dbl>,
## #   39 <dbl>, 40 <dbl>, 41 <dbl>, 42 <dbl>, 43 <dbl>, 44 <dbl>, 45 <dbl>,
## #   46 <dbl>, 47 <dbl>, 48 <dbl>, 49 <dbl>, 50 <dbl>, 51 <dbl>, 52 <dbl>,
## #   53 <dbl>, 54 <dbl>, 55 <dbl>, 56 <dbl>, 57 <dbl>, 58 <dbl>, 59 <dbl>, …
labels = c("Modelo completo", "Modelo RLM")

plot(x,Y_test[39,2:98] - 297.95,type = 'l',xlab = "Tiempo (seg)", ylab = expression(Delta~"T(°C)"),family="Times New Roman",lwd=1)



lines(spline(x,Y_pred[39,2:98] - 297.95),method='natural',lty=2,lwd=1)
## Warning in plot.xy(xy.coords(x, y), type = type, ...): "method" is not a
## graphical parameter
legend(x = "topleft", legend = c("Modelo completo", "Modelo RLM"), lty = c(1,2),bty='n',cex = 0.8)

#install.packages('ggplot2')
#library(ggp?ot2)
library(readxl)
library(extrafont)

experimental_data <- read_xlsx("Exp_Data_image2.xlsx")
Y_Exact_values_Comsol <- read_xlsx('Y_Exact_values_Comsol_image2.xlsx')
## New names:
## * `` -> ...1
Y_pred_data <- read_xlsx('Y_pred_image2.xlsx')

x1 = matrix(1:97)

plot(x1,t(experimental_data[,1]),xlab = "Tiempo (seg)", ylab = expression(Delta~"T(°C)"), family="Times New Roman",type = 'l')
lines(spline(x1,t(experimental_data[,2]),n=201,method = 'natural'),lty=2,lwd=1, col=1)
lines(spline(x1,t(experimental_data[,3]),n=201,method = 'natural'),lty=3,lwd=1, col=1)

lines(spline(x1,t(Y_Exact_values_Comsol[,1]-297.95),n=201,method = 'natural'),lty=1,lwd=1,col=2)
lines(spline(x1,t(Y_Exact_values_Comsol[,2]-297.95),n=201,method = 'natural'),lty=2,lwd=1,col=2)
lines(spline(x1,t(Y_Exact_values_Comsol[,3]-297.95),n=201,method = 'natural'),lty=3,lwd=1,col=2)

lines(spline(x1,t(Y_pred_data[,1]-297.95),n=201,method = 'natural'),lty=1,lwd=1,col=4)
lines(spline(x1,t(Y_pred_data[,2]-297.95),n=201,method = 'natural'),lty=2,lwd=1,col=4)
lines(spline(x1,t(Y_pred_data[,3]-297.95),n=201,method = 'natural'),lty=3,lwd=1,col=4)

labels_image2 = c("Medicion experimental para nanofluido al 0.050%", "Modelo completo para nanofluido al 0.050%","Modelo RLM para nanofluido al 0.050%",  
                  
                  "Medicion experimental para nanofluido al 0.025%", "Modelo co?pleto para nanofluido al 0.025%","Modelo RLM para nanofluido al 0.025%",
                  
                  "Medicion experimental para el agua destilada", "Modelo completo para el agua destilada", "Modelo RLM para el agua destilada")

legend(x = "topleft",c(0, 0.5),legend = labels_image2, lty = c(1,1,1,2,2,2,3,3,3),col=c(1,2,4,1,2,4,1,2,4),bty='n',xpd = TRUE,cex=0.65)

x = c(1:97)

J <- read_xlsx("J_image3.xlsx")


par(mfrow=c(2,2))
plot(x,t(J[1]),ylab = "Jcp",xlab="Tiempo (seg)",lwd=1,type='l',family="Times New Roman", font.lab=3)
plot(x,t(J[2]),ylab = expression("J"~rho),xlab="Tiempo (seg)",lwd=1,type='l',family="Times New Roman",font.lab=3)
plot(x,t(J[3]),ylab = "Jk",xlab="Tiempo (seg)",lwd=1,type='l',family="Times New Roman",font.lab=3)
plot(x,t(J[4]),ylab = expression("J"~mu),xlab="Tiempo (seg)",lwd=1,type='l',family="Times New Roman",font.lab=3)