-
Notifications
You must be signed in to change notification settings - Fork 0
/
NGP_alpha_on_new_PMMA_and_PS.Rmd
673 lines (424 loc) · 18.7 KB
/
NGP_alpha_on_new_PMMA_and_PS.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
---
title: "NGP and alpha on new PMMA and PS"
author: "Zijun Lu"
date: "October 30, 2017"
output:
html_document:
toc: true
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
We are tryng to use a **short time simulation** to get the glass transition temperature compatible with long time simulation. The new simulation on PMMA has 38528 atoms, 64 molecules, 40 monomers per molecule, which leads to 15 atoms per monomer with 2 hydrogen atom on each end of the PMMA molecule.
```{r,echo=FALSE,include=FALSE}
library(foreach)
library(dplyr)
Data.import=function(Path="~/Dropbox/lammps" , filename = "MSD.colmean.matrix.1.txt", temp=c(320,345,370,395,420,445,470,500,550,600),polymer="PMMA"){
# read in data into a matrix
MSDcol=foreach(i=1:length(temp),.combine = cbind)%do% {
# set correct path for the data file
path=paste(Path,"/", polymer,"/atom",temp[i], sep='')
path
setwd(path)
# read in the data
MSDcol=read.table(file=filename,header=TRUE,sep=',')
library(magrittr)
MSDcol%>%dim
MSDcol=MSDcol[[1]]
return(MSDcol)
}
# add a time variable
time=1:dim(MSDcol)[1]
# change data into data frame
MSDcol=cbind(time,MSDcol)%>%as.data.frame()
}
```
# Plot the g0,g1 and g2 MSD for PS (25800 atoms) and PMMA (38528 atoms)
To get the more details about the first few steps, I will need to look into the velocity behavior.
## MSD g0 plot for PS
```{r}
#Run (optimizaed data import function.R) file first
# temp=c(200,250,300,350,400,450,500,550,600)
# import g0 MSD colmean data for PS
########################################################
library(dplyr)
MSD.PS.g0=Data.import(filename="MSD.g0.colmean.1.txt", temp=c(200,250,300,350,400,450,500,550,600),polymer="PS")
MSD.PS.g0=MSD.PS.g0%>%as.data.frame()
MSD.PS.g0=MSD.PS.g0%>%filter(time>1)
# add correct colname
temp=c(200,250,300,350,400,450,500,550,600)
colnames(MSD.PS.g0)=c("time",paste("T",temp,sep=""))
#regular plot
###########################################
library(reshape2)
MSD.PS.g0.melt=melt(MSD.PS.g0,id.vars="time")
library(dplyr)
library(ggplot2)
ggplot(data=MSD.PS.g0.melt,aes(x=time,y=value,colour=variable)) +geom_point(size=0.5)+
ylab("MSD")+
ggtitle("PS g0 MSD vs time plot")
# log10-log10 plot
###########################################
library(reshape2)
MSD.PS.g0.melt=melt(MSD.PS.g0,id.vars="time")
library(ggplot2)
ggplot(data=MSD.PS.g0.melt,aes(x=log10(time),y=log10(value),colour=variable)) +geom_point(size=0.5)+
ylab("log10(MSD)")+
ggtitle("PS g0 MSD vs time log10-log10 plot")
```
Take a look at the first few timesteps in different temperatures.
Discard the first data point in plotting and here.
```{r}
MSD.PS.g0%>%head(10)
```
## MSD g0 plot for PMMA
```{r}
#Run (optimizaed data import function.R) file first
# temp=c(200,250,300,350,400,450,500,550,600)
# import g0 MSD colmean data for PMMA_big
########################################################
library(dplyr)
MSD.PMMA_big.g0=Data.import(filename="MSD.g0.colmean.1.txt", temp=seq(300,600,by=20),polymer="PMMA_big")
MSD.PMMA_big.g0=MSD.PMMA_big.g0%>%as.data.frame()
MSD.PMMA_big.g0=MSD.PMMA_big.g0%>%filter(time>1)
# add correct colname
temp=seq(300,600,by=20)
colnames(MSD.PMMA_big.g0)=c("time",paste("T",temp,sep=""))
#regular plot
###########################################
library(reshape2)
MSD.PMMA_big.g0.melt=melt(MSD.PMMA_big.g0,id.vars="time")
library(dplyr)
library(ggplot2)
ggplot(data=MSD.PMMA_big.g0.melt,aes(x=time,y=value,colour=variable)) +geom_point(size=0.5)+
ylab("MSD")+
ggtitle("PMMA_big g0 MSD vs time plot")
# log10-log10 plot
###########################################
library(reshape2)
MSD.PMMA_big.g0.melt=melt(MSD.PMMA_big.g0,id.vars="time")
library(ggplot2)
ggplot(data=MSD.PMMA_big.g0.melt,aes(x=log10(time),y=log10(value),colour=variable)) +geom_point(size=0.5)+
ylab("log10(MSD)")+
ggtitle("PMMA_big g0 MSD vs time log10-log10 plot")
```
Discard the first data point in plotting and here.
```{r}
MSD.PMMA_big.g0%>%head()
```
## MSD g2 plot for PS
```{r}
#Run (optimizaed data import function.R) file first
# import g2 MSD colmean data for PS
########################################################
library(dplyr)
MSD.PS.g2=Data.import(filename="MSD.g2.colmean.1.txt", temp=c(200,250,300,350,400,450,500,550,600),polymer="PS")
MSD.PS.g2=MSD.PS.g2%>%as.data.frame()
MSD.PS.g2=MSD.PS.g2%>%filter(time>1)
# add correct colname
temp=c(200,250,300,350,400,450,500,550,600)
colnames(MSD.PS.g2)=c("time",paste("T",temp,sep=""))
#regular plot
###########################################
library(reshape2)
MSD.PS.g2.melt=melt(MSD.PS.g2,id.vars="time")
library(dplyr)
library(ggplot2)
ggplot(data=MSD.PS.g2.melt,aes(x=time,y=value,colour=variable)) +geom_point(size=0.5)+
ylab("MSD")+
ggtitle("PS g2 MSD vs time plot")
# log10-log10 plot
###########################################
library(reshape2)
MSD.PS.g2.melt=melt(MSD.PS.g2,id.vars="time")
library(ggplot2)
ggplot(data=MSD.PS.g2.melt,aes(x=log10(time),y=log10(value),colour=variable)) +geom_point(size=0.5)+
ylab("log10(MSD)")+
ggtitle("PS g2 MSD vs time log10-log10 plot")
```
```{r}
MSD.PS.g2%>%head(10)
```
## MSD g2 plot for PMMA_big
```{r}
#Run (optimizaed data import function.R) file first
# import g2 MSD colmean data for PMMA_big
########################################################
library(dplyr)
MSD.PMMA_big.g2=Data.import(filename="MSD.g2.colmean.1.txt", temp=seq(300,600,by=20),polymer="PMMA_big")
MSD.PMMA_big.g2=MSD.PMMA_big.g2%>%as.data.frame()
MSD.PMMA_big.g2=MSD.PMMA_big.g2%>%filter(time>1)
# add correct colname
temp=seq(300,600,by=20)
colnames(MSD.PMMA_big.g2)=c("time",paste("T",temp,sep=""))
#regular plot
###########################################
library(reshape2)
MSD.PMMA_big.g2.melt=melt(MSD.PMMA_big.g2,id.vars="time")
library(dplyr)
library(ggplot2)
ggplot(data=MSD.PMMA_big.g2.melt,aes(x=time,y=value,colour=variable)) +geom_point(size=0.5)+
ylab("MSD")+
ggtitle("PMMA_big g2 MSD vs time plot")
# log10-log10 plot
###########################################
library(reshape2)
MSD.PMMA_big.g2.melt=melt(MSD.PMMA_big.g2,id.vars="time")
library(ggplot2)
ggplot(data=MSD.PMMA_big.g2.melt,aes(x=log10(time),y=log10(value),colour=variable)) +geom_point(size=0.5)+
ylab("log10(MSD)")+
ggtitle("PMMA_big g2 MSD vs time log10-log10 plot")
```
```{r}
MSD.PMMA_big.g2%>%head(10)
```
## MSD g1 plot for PMMA_big
```{r}
#Run (optimizaed data import function.R) file first
# import g1 MSD colmean data for PMMA_big
########################################################
library(dplyr)
MSD.PMMA_big.g1=Data.import(filename="MSD.g1.colmean.1.txt", temp=seq(300,600,by=20),polymer="PMMA_big")
MSD.PMMA_big.g1=MSD.PMMA_big.g1%>%as.data.frame()
MSD.PMMA_big.g1=MSD.PMMA_big.g1%>%filter(time>1)
# add correct colname
temp=seq(300,600,by=20)
colnames(MSD.PMMA_big.g1)=c("time",paste("T",temp,sep=""))
#regular plot
###########################################
library(reshape2)
MSD.PMMA_big.g1.melt=melt(MSD.PMMA_big.g1,id.vars="time")
library(dplyr)
library(ggplot2)
ggplot(data=MSD.PMMA_big.g1.melt,aes(x=time,y=value,colour=variable)) +geom_point(size=0.5)+
ylab("MSD")+
ggtitle("PMMA_big g1 MSD vs time plot")
# log10-log10 plot
###########################################
library(reshape2)
MSD.PMMA_big.g1.melt=melt(MSD.PMMA_big.g1,id.vars="time")
library(ggplot2)
ggplot(data=MSD.PMMA_big.g1.melt,aes(x=log10(time),y=log10(value),colour=variable)) +geom_point(size=0.5)+
ylab("log10(MSD)")+
ggtitle("PMMA_big g1 MSD vs time log10-log10 plot")
```
```{r}
MSD.PMMA_big.g1%>%head(10)
```
## MSD g1 plot for PS
```{r}
#Run (optimizaed data import function.R) file first
# import g1 MSD colmean data for PS
########################################################
library(dplyr)
MSD.PS.g1=Data.import(filename="MSD.g1.colmean.1.txt", temp=seq(200,600,by=50),polymer="PS")
MSD.PS.g1=MSD.PS.g1%>%as.data.frame()
MSD.PS.g1=MSD.PS.g1%>%filter(time>1)
# add correct colname
temp=seq(200,600,by=50)
colnames(MSD.PS.g1)=c("time",paste("T",temp,sep=""))
#regular plot
###########################################
library(reshape2)
MSD.PS.g1.melt=melt(MSD.PS.g1,id.vars="time")
library(dplyr)
library(ggplot2)
ggplot(data=MSD.PS.g1.melt,aes(x=time,y=value,colour=variable)) +geom_point(size=0.5)+
ylab("MSD")+
ggtitle("PS g1 MSD vs time plot")
# log10-log10 plot
###########################################
library(reshape2)
MSD.PS.g1.melt=melt(MSD.PS.g1,id.vars="time")
library(ggplot2)
ggplot(data=MSD.PS.g1.melt,aes(x=log10(time),y=log10(value),colour=variable)) +geom_point(size=0.5)+
ylab("log10(MSD)")+
ggtitle("PS g1 MSD vs time log10-log10 plot")
```
```{r}
MSD.PS.g1%>%head(10)
```
# Curvature and NGP methods on PS and PMMA_big
Define a function to read the results, calculate curvature term, R-squared term and non-gaussian parameter.
In the calculation, I change the time units to ps by multiply it by 0.01 and change the length unit to nm by dividing it by 100.
```{r}
# all even terms and MSD increase linearly with time.
###############################################################################################################
#Run ( data_import.R) file first
# write a function to plot the alpha term for different polymers and different MSD calculation method.
#Run (optimizaed data import function.R) file first
alpha.even.ngp.plot=function(filename1="MSD.g0.colmean.1.txt",filename2="NGP.g0.1.txt", temp=seq(200,600,by=50),polymer="PS",method="linear"){
# import colmean data and do linear regression for alpha term
##############################################################
MSD.PS.g0=Data.import(filename=filename1, temp=temp,polymer=polymer)
MSD.PS.g0=MSD.PS.g0%>%as.data.frame()
# Regression method 1 : using all even order and no intercept
################################################################
# change the time units to ps
time=MSD.PS.g0[,1]*0.01
# change the length unit to nm.
MSD.PS.g0=MSD.PS.g0/100
library(foreach)
############################################################################
if(method=="linear"){
#MSD is increasing linearly with time.
alpha=foreach(i=2:(dim(MSD.PS.g0)[2]),.combine = rbind)%do%{
(lm(MSD.PS.g0[,i]~-1+I(time^2)+I(time^4)+I(time^6)+I(time^8)+I(time^10)+I(time^12)+I(time^14)+I(time^16)+I(time^18)+I(time^20))%>%confint(level=0.95))[2,]
}
Rsquared=foreach(i=2:(dim(MSD.PS.g0)[2]),.combine = rbind)%do%{
c( ( lm(MSD.PS.g0[,i]~-1+I(time^2)+I(time^4)+I(time^6)+I(time^8)+I(time^10)+I(time^12)+I(time^14)+I(time^16)+I(time^18)+I(time^20)) )%>%summary%>%.$adj.rsquared,
( lm(MSD.PS.g0[,i]~-1+I(time^2)+I(time^4)+I(time^6)+I(time^8)+I(time^10)+I(time^12)+I(time^14)+I(time^16)+I(time^18)+I(time^20)) )%>%summary%>%.$r.squared
)
}
}else if(method=="frac"){
#MSD is increasing linearly with fractional power of time.
alpha=foreach(i=2:(dim(MSD.PS.g0)[2]),.combine = rbind)%do%{
(lm(MSD.PS.g0[,i]~-1+I(time^(3/2))+I(time^(7/2))+I(time^(11/2))+I(time^(15/2))+I(time^(19/2)))%>%confint(level=0.95))[2,]
}
Rsquared=foreach(i=2:(dim(MSD.PS.g0)[2]),.combine = rbind)%do%{
c(
(
lm(MSD.PS.g0[,i]~-1+I(time^(3/2))+I(time^(7/2))+I(time^(11/2))+I(time^(15/2))+I(time^(19/2)) )
)%>%summary%>%.$adj.rsquared,
(
lm(MSD.PS.g0[,i]~-1+I(time^(3/2))+I(time^(7/2))+I(time^(11/2))+I(time^(15/2))+I(time^(19/2)) )
) %>%summary%>%.$r.squared
)
}
}else if(method=="solomon"){
#MSD is increasing linearly with time.
alpha=foreach(i=2:(dim(MSD.PS.g0)[2]),.combine = rbind)%do%{
(lm(MSD.PS.g0[,i]/time^2~I(time^2)+I(time^4)+I(time^6)+I(time^8)+I(time^10)+I(time^12)+I(time^14)+I(time^16)+I(time^18)+I(time^20))%>%confint(level=0.95))[2,]
}
Rsquared=foreach(i=2:(dim(MSD.PS.g0)[2]),.combine = rbind)%do%{
c( ( lm(MSD.PS.g0[,i]/time^2~I(time^2)+I(time^4)+I(time^6)+I(time^8)+I(time^10)+I(time^12)+I(time^14)+I(time^16)+I(time^18)+I(time^20)) )%>%summary%>%.$adj.rsquared,
( lm(MSD.PS.g0[,i]/time^2~I(time^2)+I(time^4)+I(time^6)+I(time^8)+I(time^10)+I(time^12)+I(time^14)+I(time^16)+I(time^18)+I(time^20)) )%>%summary%>%.$r.squared
)
}
}else{
print("Enter a valid method like linear or frac.")
}
###############################################################
#first transform the matrix then turn it into a vector
alpha=alpha%>%t%>%as.vector
# combine alpha and temp into a data frame
temp=rep(temp,each=2)
alpha=data.frame(alpha,temp,Rsquared,row.names = NULL)
# calculate the average between two alpha values
alpha_average=alpha%>%group_by(temp) %>% summarize(alpha_average=mean(alpha))
alpha_average=rbind(alpha_average,alpha_average)%>%arrange(temp)
alpha=cbind(alpha,alpha_average["alpha_average"])
# unscaled plot for two 95% confidence interval and average of the end points of the range
library(ggplot2)
p1=ggplot(data=alpha, aes(y=alpha/temp,x=temp))+geom_point()+geom_line(aes(x=temp,y=alpha_average/temp),color="red")+
#geom_smooth(method= "loess")+
xlab("Temperature")+ylab("Curvature of MSD/Temperature ")
p3=ggplot(data=alpha, aes(y=Rsquared,x=temp))+geom_point(color="orange")+
xlab("Temperature")+ylab("R^2 and adj R^2")
####################################################################################################################
#NGP
NGP=Data.import(filename=filename2, temp=temp,polymer=polymer)
temp=temp
# add column names
colnames(NGP)=c("time",paste("T",temp,sep=""))
# delete NA values
NGP=NGP[complete.cases(NGP),]
NGP=NGP%>%colMeans()
NGP=NGP[-1]
NGP=data.frame(NGP,temp)
library(ggplot2)
p2=ggplot(data=NGP, aes(y=NGP,x=temp))+geom_line()+
xlab("Temperature")+ylab("NGP value")
## Plot NGP and alpha term together
library(grid)
grid.newpage()
grid.draw(rbind(ggplotGrob(p1), ggplotGrob(p2), ggplotGrob(p3), size = "first"))
#return the plot.
}
```
Use two different methods to calculate the alpha term (curvature of MSD), the linear methods is Solomon's method, the frac method is using t^0.5 instead of t in the long term trend.
On a side note, Solomon's method that divides the MSD by t^2 before doing regression could lead to a very small number causing calculation error.
## PS
### PS g0 alpha term all even orders (t^2 to t^20)
```{r}
alpha.even.ngp.plot(filename1="MSD.g0.colmean.1.txt",filename2="NGP.g0.1.txt", temp=c(200,250,300,350,400,450,500,550,600),polymer="PS",method="linear")
```
```{r}
alpha.even.ngp.plot(filename1="MSD.g0.colmean.1.txt",filename2="NGP.g0.1.txt", temp=c(200,250,300,350,400,450,500,550,600),polymer="PS",method="solomon")
```
### PS g0 alpha term fractional orders (t^(3/2) to t^(19/2))
```{r}
alpha.even.ngp.plot(filename1="MSD.g0.colmean.1.txt",filename2="NGP.g0.1.txt", temp=c(200,250,300,350,400,450,500,550,600),polymer="PS",method="frac")
```
### PS g2 alpha term all even orders (t^2 to t^20)
```{r}
alpha.even.ngp.plot(filename1="MSD.g2.colmean.1.txt",filename2="NGP.g2.1.txt", temp=c(200,250,300,350,400,450,500,550,600),polymer="PS",method="linear")
```
```{r}
alpha.even.ngp.plot(filename1="MSD.g2.colmean.1.txt",filename2="NGP.g2.1.txt", temp=c(200,250,300,350,400,450,500,550,600),polymer="PS",method="solomon")
```
### PS g2 alpha term fractional orders (t^(3/2) to t^(19/2))
```{r}
alpha.even.ngp.plot(filename1="MSD.g2.colmean.1.txt",filename2="NGP.g2.1.txt", temp=c(200,250,300,350,400,450,500,550,600),polymer="PS",method="frac")
```
## PS
### PS g1 alpha term all even orders (t^2 to t^20)
```{r}
alpha.even.ngp.plot(filename1="MSD.g1.colmean.1.txt",filename2="NGP.g1.1.txt", temp=c(200,250,300,350,400,450,500,550,600),polymer="PS",method="linear")
```
```{r}
alpha.even.ngp.plot(filename1="MSD.g1.colmean.1.txt",filename2="NGP.g1.1.txt", temp=c(200,250,300,350,400,450,500,550,600),polymer="PS",method="solomon")
```
### PS g1 alpha term fractional orders (t^(3/2) to t^(19/2))
```{r}
alpha.even.ngp.plot(filename1="MSD.g1.colmean.1.txt",filename2="NGP.g1.1.txt", temp=c(200,250,300,350,400,450,500,550,600),polymer="PS",method="frac")
```
It seems that NGP method is more appropriate for smaller molecules while curvature method is more appropriate for large molecules.
## PMMA_big
### PMMA_big g0 alpha term even orders (t^2 to t^20)
```{r}
alpha.even.ngp.plot(filename1="MSD.g0.colmean.1.txt",filename2="NGP.g0.1.txt", temp=seq(300,600,by=20),polymer="PMMA_big",method="linear")
```
```{r}
alpha.even.ngp.plot(filename1="MSD.g0.colmean.1.txt",filename2="NGP.g0.1.txt", temp=seq(300,600,by=20),polymer="PMMA_big",method="solomon")
```
### PMMA_big g0 alpha term fractional orders (t^(3/2) to t^(19/2))
```{r}
alpha.even.ngp.plot(filename1="MSD.g0.colmean.1.txt",filename2="NGP.g0.1.txt", temp=seq(300,600,by=20),polymer="PMMA_big",method="frac")
```
### PMMA_big g2 alpha term even orders (t^2 to t^20)
```{r}
alpha.even.ngp.plot(filename1="MSD.g2.colmean.1.txt",filename2="NGP.g2.1.txt", temp=seq(300,600,by=20),polymer="PMMA_big",method="linear")
```
```{r}
alpha.even.ngp.plot(filename1="MSD.g2.colmean.1.txt",filename2="NGP.g2.1.txt", temp=seq(300,600,by=20),polymer="PMMA_big",method="solomon")
```
### PMMA_big g2 alpha term fractional orders (t^(3/2) to t^(19/2))
```{r}
alpha.even.ngp.plot(filename1="MSD.g2.colmean.1.txt",filename2="NGP.g2.1.txt", temp=seq(300,600,by=20),polymer="PMMA_big",method="frac")
```
### PMMA_big g1 alpha term even orders (t^2 to t^20)
```{r}
alpha.even.ngp.plot(filename1="MSD.g1.colmean.1.txt",filename2="NGP.g1.1.txt", temp=seq(300,600,by=20),polymer="PMMA_big",method="linear")
```
```{r}
alpha.even.ngp.plot(filename1="MSD.g1.colmean.1.txt",filename2="NGP.g1.1.txt", temp=seq(300,600,by=20),polymer="PMMA_big",method="solomon")
```
### PMMA_big g1 alpha term fractional orders (t^(3/2) to t^(19/2))
```{r}
alpha.even.ngp.plot(filename1="MSD.g1.colmean.1.txt",filename2="NGP.g1.1.txt", temp=seq(300,600,by=20),polymer="PMMA_big",method="frac")
```
The result on PMMA_big confirms my assumption on the use of NGP on atom averaged result and use of curvature methods on molecule averaged result.
# Conclusion
## PS
Use the curvature method on g0 MSD and NGP on g0 MSD. Glass transition Temperature: 400K~450K
Tg value is about 100 °C (373K)
```{r}
alpha.even.ngp.plot(filename1="MSD.g0.colmean.1.txt",filename2="NGP.g0.1.txt", temp=c(200,250,300,350,400,450,500,550,600),polymer="PS",method="frac")
```
##PMMA_big
Use the curvature method on g0 MSD and NGP on g0 MSD. Glass transition Temperature: 440K~460K
Tg values of commercial grades of PMMA range from 85 to 165 °C (358K to 438 °F) from wiki (https://en.wikipedia.org/wiki/Poly(methyl_methacrylate))
```{r}
alpha.even.ngp.plot(filename1="MSD.g0.colmean.1.txt",filename2="NGP.g0.1.txt", temp=seq(300,600,by=20),polymer="PMMA_big",method="frac")
```