1 00:00:10,180 --> 00:00:12,830 STUDENT: Materials are often classified as crystalline, 2 00:00:12,830 --> 00:00:14,920 semi-crystalline, or amorphous. 3 00:00:14,920 --> 00:00:17,110 Most polymers are semi-crystalline. 4 00:00:17,110 --> 00:00:18,790 This means a fraction of the material 5 00:00:18,790 --> 00:00:22,132 is amorphous and lacks order in arrangements of polymer chains, 6 00:00:22,132 --> 00:00:23,590 while the remainder of the material 7 00:00:23,590 --> 00:00:26,070 exhibits parallel, well-ordered chains that 8 00:00:26,070 --> 00:00:28,540 define crystalline regions. 9 00:00:28,540 --> 00:00:30,850 There are several methods for determining the degree 10 00:00:30,850 --> 00:00:32,880 of crystallinity in a polymer. 11 00:00:32,880 --> 00:00:35,380 X-ray diffraction can be used to determine degree 12 00:00:35,380 --> 00:00:38,650 of crystallinity, because intensity of X-ray diffraction 13 00:00:38,650 --> 00:00:42,120 reflection is proportional to the material density. 14 00:00:42,120 --> 00:00:44,260 An X-ray diffraction pattern displays 15 00:00:44,260 --> 00:00:46,390 both sharp Bragg's peaks, arising 16 00:00:46,390 --> 00:00:49,650 from the crystalline portion, and a broad diffraction peak 17 00:00:49,650 --> 00:00:51,880 caused by scattering from the amorphous portion 18 00:00:51,880 --> 00:00:53,260 of the polymer. 19 00:00:53,260 --> 00:00:55,390 The degree of crystallinity can be determined 20 00:00:55,390 --> 00:00:58,840 using this formula, where the total integrated intensities, 21 00:00:58,840 --> 00:01:01,810 all of the sharp peaks, are divided by the integrated 22 00:01:01,810 --> 00:01:04,030 intensities of all peaks, including 23 00:01:04,030 --> 00:01:06,100 that of the amorphous peak. 24 00:01:06,100 --> 00:01:10,210 Many laboratories have access to XRD peak fitting software that 25 00:01:10,210 --> 00:01:13,030 can be used to calculate degree of crystallinity. 26 00:01:13,030 --> 00:01:15,760 But this software can often be expensive. 27 00:01:15,760 --> 00:01:18,040 I set out to create a peak fitting software 28 00:01:18,040 --> 00:01:19,930 to calculate degree of crystallinity 29 00:01:19,930 --> 00:01:23,170 for semi-crystalline polymers using Mathematica. 30 00:01:23,170 --> 00:01:25,030 The basic idea for this program is 31 00:01:25,030 --> 00:01:28,030 that the user will define a series of Gaussian peaks 32 00:01:28,030 --> 00:01:29,770 using this equation. 33 00:01:29,770 --> 00:01:34,510 The width, the height, and the exposition of these peaks 34 00:01:34,510 --> 00:01:37,090 can be manipulated. 35 00:01:37,090 --> 00:01:39,970 This code allows the user to adjust the appearance 36 00:01:39,970 --> 00:01:42,160 and position of multiple peaks, and match it 37 00:01:42,160 --> 00:01:44,440 to an existing XRD pattern. 38 00:01:44,440 --> 00:01:46,660 First, the code allows the user to adjust 39 00:01:46,660 --> 00:01:50,680 the position and the scale of the XRD pattern. 40 00:01:50,680 --> 00:01:53,170 The user is then able to adjust the positions 41 00:01:53,170 --> 00:01:55,615 of both the crystalline peaks and amorphous peaks. 42 00:02:00,840 --> 00:02:03,330 Once the user obtains a fit that they're happy with, 43 00:02:03,330 --> 00:02:05,610 they can calculate the degree of crystallinity 44 00:02:05,610 --> 00:02:07,590 by determining the integrated area 45 00:02:07,590 --> 00:02:10,800 under the crystalline peaks, divided by the integrated 46 00:02:10,800 --> 00:02:12,465 area under all of the peaks. 47 00:02:15,090 --> 00:02:18,240 In this particular polymer, the determined degree 48 00:02:18,240 --> 00:02:21,420 of crystallinity was 41%. 49 00:02:21,420 --> 00:02:24,050 To test the accuracy of my code, I 50 00:02:24,050 --> 00:02:26,640 fit XRD patterns for polyethylene varieties 51 00:02:26,640 --> 00:02:29,670 with known values for degree of crystallinity. 52 00:02:29,670 --> 00:02:32,820 The polymers for which I chose to match XRD patterns 53 00:02:32,820 --> 00:02:36,330 were low density polyethylene, high density polyethylene, 54 00:02:36,330 --> 00:02:39,390 and ultra high molecular weight polyethylene. 55 00:02:39,390 --> 00:02:42,690 The expected value for degree of crystallinity for low density 56 00:02:42,690 --> 00:02:46,620 polyethylene is 44% to 51% crystallinity. 57 00:02:46,620 --> 00:02:49,110 The value obtained using Mathematica peak fitting 58 00:02:49,110 --> 00:02:53,580 was 46% crystallinity, so this is within the accepted range. 59 00:02:53,580 --> 00:02:55,980 Similarly, the expected value for degree 60 00:02:55,980 --> 00:02:58,740 of crystallinity for high density polyethylene 61 00:02:58,740 --> 00:03:01,740 is 48% to 69% crystallinity. 62 00:03:01,740 --> 00:03:05,040 And Mathematica peak fitting obtained a value of 56% 63 00:03:05,040 --> 00:03:06,450 crystallinity. 64 00:03:06,450 --> 00:03:09,300 Finally, ultra high molecular weight polyethylene 65 00:03:09,300 --> 00:03:14,520 has an expected value of 75% to 77% crystallinity. 66 00:03:14,520 --> 00:03:19,340 Mathematica peak fitting showed a value of 76% crystallinity. 67 00:03:19,340 --> 00:03:21,360 In all three polymer case studies, 68 00:03:21,360 --> 00:03:23,940 this code obtained a degree of crystallinity value 69 00:03:23,940 --> 00:03:27,840 within the acceptable range, indicating manual Mathematica 70 00:03:27,840 --> 00:03:30,420 peak fitting of XRD plots is a reasonable way 71 00:03:30,420 --> 00:03:34,380 to determine a material's degree of crystallinity. 72 00:03:34,380 --> 00:03:36,210 The code I just described showed a way 73 00:03:36,210 --> 00:03:38,670 to import an XRD pattern as an image 74 00:03:38,670 --> 00:03:40,710 and manually fit the peaks to calculate 75 00:03:40,710 --> 00:03:41,709 degree of crystallinity. 76 00:03:41,709 --> 00:03:44,910 However, I can do a better job of determining degree 77 00:03:44,910 --> 00:03:48,450 of crystallinity if I let the user's peak selections be 78 00:03:48,450 --> 00:03:50,520 a starting guess, and let Mathematica 79 00:03:50,520 --> 00:03:54,420 find the best set of Gaussian curves to fit the data. 80 00:03:54,420 --> 00:03:56,250 One of the challenges with this method 81 00:03:56,250 --> 00:04:00,210 is I have to take data that's currently saved as a JPG image 82 00:04:00,210 --> 00:04:02,010 and convert it into something Mathematica 83 00:04:02,010 --> 00:04:04,120 can use to find a best fit. 84 00:04:04,120 --> 00:04:07,860 So the way I do this is I import my JPG image here. 85 00:04:07,860 --> 00:04:09,690 And then I use that, and I convert 86 00:04:09,690 --> 00:04:11,880 it to be either black or white. 87 00:04:11,880 --> 00:04:16,019 Then I'm able to determine the locations of the black pixels 88 00:04:16,019 --> 00:04:17,449 and isolate them. 89 00:04:17,449 --> 00:04:18,990 However, my lines really thick, which 90 00:04:18,990 --> 00:04:22,520 means that at each x position, I have multiple y positions. 91 00:04:22,520 --> 00:04:24,960 So then I'm able to use the following code 92 00:04:24,960 --> 00:04:27,210 to choose whether I want to have the mean y 93 00:04:27,210 --> 00:04:30,270 position at each x value, or one of the highest y 94 00:04:30,270 --> 00:04:32,310 positions at each x value. 95 00:04:32,310 --> 00:04:34,170 After my data is in this form, I'm 96 00:04:34,170 --> 00:04:38,190 able to use it for future curve-fitting applications. 97 00:04:38,190 --> 00:04:40,380 So after I have data, I'm able to write 98 00:04:40,380 --> 00:04:43,500 code that allows the user to input guesses for where 99 00:04:43,500 --> 00:04:46,140 they think the peaks should be located. 100 00:04:46,140 --> 00:04:48,210 And then Mathematica uses a function 101 00:04:48,210 --> 00:04:51,090 called Find Fit, that's going to find the best 102 00:04:51,090 --> 00:04:55,495 approximation for my data given the guesses and the model I 103 00:04:55,495 --> 00:04:56,370 give it to work with. 104 00:04:56,370 --> 00:04:58,860 So this model is a model that includes 105 00:04:58,860 --> 00:05:01,320 three different Gaussian peaks. 106 00:05:01,320 --> 00:05:03,900 So the full code is available to you in my notebook. 107 00:05:03,900 --> 00:05:05,970 But here's the final product. 108 00:05:05,970 --> 00:05:07,770 Like in the previous curve-fitting program 109 00:05:07,770 --> 00:05:11,490 I showed you, you're able to adjust the positions and shapes 110 00:05:11,490 --> 00:05:14,955 of the crystalline peaks and the amorphous peaks as follows. 111 00:05:18,570 --> 00:05:20,870 Once you think you have a fit that's fairly reasonable, 112 00:05:20,870 --> 00:05:23,250 you can click Find Nearest Solution, 113 00:05:23,250 --> 00:05:25,050 and Mathematica is going to help you find 114 00:05:25,050 --> 00:05:27,270 the best fit for this data. 115 00:05:27,270 --> 00:05:29,640 Then, using these Mathematica found values, 116 00:05:29,640 --> 00:05:34,720 you can calculate degree of crystallinity for the curve. 117 00:05:34,720 --> 00:05:37,080 So in conclusion, degree of crystallinity 118 00:05:37,080 --> 00:05:39,270 can be determined from XRD patterns. 119 00:05:39,270 --> 00:05:41,520 And today I demonstrated two possible ways 120 00:05:41,520 --> 00:05:43,364 of doing this in Mathematica. 121 00:05:43,364 --> 00:05:45,030 There's a fair amount of background code 122 00:05:45,030 --> 00:05:47,100 that goes into the outputs you saw today. 123 00:05:47,100 --> 00:05:49,500 And all this code is available to you in my Mathematica 124 00:05:49,500 --> 00:05:50,550 notebook. 125 00:05:50,550 --> 00:05:51,990 Hopefully you'll find it very easy 126 00:05:51,990 --> 00:05:55,640 to modify to meet your unique application needs.