############################################## ## Python code for plotting tensile test CSV files ## VERSION 0.8 5.5.2021 # ## Used as part of a publication: ## Mechanical Properties and Fracture Characterization of Additively Manufactured Plastics After Accelerated Weathering # ## Corresponging Author: Tuomas Puttonen, tuomas.puttonen@aalto.fi ## ## Feel free to improve the code; file import and plotting functions are the obvious next steps. ## That's why this is version 0.8... :D ############################################## import numpy as np import pandas as pd import matplotlib.pyplot as plt import statistics # # Dataset of the accompanying article available at: 10.5281/zenodo.5044976 # ############## READ INPUT DATA ################## # Data file location path = "ADD_INPUT_PATH_HERE/CSVs/" save_path = "ADD_SAVE_PATH_HERE" # "SLS_XY_BLACK" data1 = pd.read_csv(path +'SLS_XY_BLACK/01_SLS_XY_black_Corrected.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data2 = pd.read_csv(path +'SLS_XY_BLACK/02_SLS_XY_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data3 = pd.read_csv(path +'SLS_XY_BLACK/03_SLS_XY_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data4 = pd.read_csv(path +'SLS_XY_BLACK/01_UV_SLS_XY_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data5 = pd.read_csv(path +'SLS_XY_BLACK/02_UV_SLS_XY_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data6 = pd.read_csv(path +'SLS_XY_BLACK/03_UV_SLS_XY_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) ## # "SLS_Z_BLACK" data7 = pd.read_csv(path +'SLS_Z_BLACK/01_SLS_Z_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data8 = pd.read_csv(path +'SLS_Z_BLACK/02_SLS_Z_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data9 = pd.read_csv(path +'SLS_Z_BLACK/03_SLS_Z_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data10 = pd.read_csv(path +'SLS_Z_BLACK/01_UV_SLS_Z_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data11 = pd.read_csv(path +'SLS_Z_BLACK/02_UV_SLS_Z_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data12 = pd.read_csv(path +'SLS_Z_BLACK/03_UV_SLS_Z_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) # "SLS_XY_BLACK_COATING_1" data13 = pd.read_csv(path +'SLS_XY_BLACK_C1/01_SLS_XY_BLACK_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data14 = pd.read_csv(path +'SLS_XY_BLACK_C1/02_SLS_XY_BLACK_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data15 = pd.read_csv(path +'SLS_XY_BLACK_C1/03_SLS_XY_BLACK_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data16 = pd.read_csv(path +'SLS_XY_BLACK_C1/01_UV_SLS_XY_BLACK_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data17 = pd.read_csv(path +'SLS_XY_BLACK_C1/02_UV_SLS_XY_BLACK_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data18 = pd.read_csv(path +'SLS_XY_BLACK_C1/03_UV_SLS_XY_BLACK_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) # "SLS_Z_BLACK_COATING_1" data19 = pd.read_csv(path +'SLS_Z_BLACK_C1/01_SLS_Z_black_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data20 = pd.read_csv(path +'SLS_Z_BLACK_C1/02_SLS_Z_black_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data21 = pd.read_csv(path +'SLS_Z_BLACK_C1/03_SLS_Z_black_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data22 = pd.read_csv(path +'SLS_Z_BLACK_C1/01_UV_SLS_Z_black_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data23 = pd.read_csv(path +'SLS_Z_BLACK_C1/02_UV_SLS_Z_black_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data24 = pd.read_csv(path +'SLS_Z_BLACK_C1/03_UV_SLS_Z_black_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) # "MJF_XY_BLACK" data25 = pd.read_csv(path +'MJF_XY_BLACK/01_MJF_XY_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data26 = pd.read_csv(path +'MJF_XY_BLACK/02_MJF_XY_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data27 = pd.read_csv(path +'MJF_XY_BLACK/03_MJF_XY_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data28 = pd.read_csv(path +'MJF_XY_BLACK/01_UV_MJF_XY_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data29 = pd.read_csv(path +'MJF_XY_BLACK/02_UV_MJF_XY_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data30 = pd.read_csv(path +'MJF_XY_BLACK/03_UV_MJF_XY_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) # "MJF_Z_BLACK" data31 = pd.read_csv(path +'MJF_Z_BLACK/01_MJF_Z_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data32 = pd.read_csv(path +'MJF_Z_BLACK/02_MJF_Z_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data33 = pd.read_csv(path +'MJF_Z_BLACK/03_MJF_Z_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data34 = pd.read_csv(path +'MJF_Z_BLACK/01_UV_MJF_Z_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data35 = pd.read_csv(path +'MJF_Z_BLACK/02_UV_MJF_Z_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data36 = pd.read_csv(path +'MJF_Z_BLACK/03_UV_MJF_Z_black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) # "MJF_XY_BLACK_C1" data37 = pd.read_csv(path +'MJF_XY_BLACK_C1/01_MJF_XY_Black_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data38 = pd.read_csv(path +'MJF_XY_BLACK_C1/02_MJF_XY_Black_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data39 = pd.read_csv(path +'MJF_XY_BLACK_C1/03_MJF_XY_Black_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data40 = pd.read_csv(path +'MJF_XY_BLACK_C1/01_UV_MJF_XY_Black_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data41 = pd.read_csv(path +'MJF_XY_BLACK_C1/02_UV_MJF_XY_Black_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data42 = pd.read_csv(path +'MJF_XY_BLACK_C1/03_UV_MJF_XY_Black_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) # "MJF_Z_BLACK_C1" data43 = pd.read_csv(path +'MJF_Z_BLACK_C1/01_MJF_Z_black_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data44 = pd.read_csv(path +'MJF_Z_BLACK_C1/02_MJF_Z_black_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data45 = pd.read_csv(path +'MJF_Z_BLACK_C1/03_MJF_Z_black_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data46 = pd.read_csv(path +'MJF_Z_BLACK_C1/01_UV_MJF_Z_black_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data47 = pd.read_csv(path +'MJF_Z_BLACK_C1/02_UV_MJF_Z_black_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data48 = pd.read_csv(path +'MJF_Z_BLACK_C1/03_UV_MJF_Z_black_C1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) # "SLS_XY_BLACK_C2" data49 = pd.read_csv(path +'SLS_XY_BLACK_C2/01_SLS_XY_black_C2.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data50 = pd.read_csv(path +'SLS_XY_BLACK_C2/02_SLS_XY_black_C2.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data51 = pd.read_csv(path +'SLS_XY_BLACK_C2/03_SLS_XY_black_C2.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data52 = pd.read_csv(path +'SLS_XY_BLACK_C2/01_UV_SLS_XY_black_C2.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data53 = pd.read_csv(path +'SLS_XY_BLACK_C2/02_UV_SLS_XY_black_C2.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data54 = pd.read_csv(path +'SLS_XY_BLACK_C2/03_UV_SLS_XY_black_C2.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) # "SLS_Z_BLACK_C2" data55 = pd.read_csv(path +'SLS_Z_BLACK_C2/01_SLS_Z_black_C2.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data56 = pd.read_csv(path +'SLS_Z_BLACK_C2/02_SLS_Z_black_C2.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data57 = pd.read_csv(path +'SLS_Z_BLACK_C2/03_SLS_Z_black_C2.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data58 = pd.read_csv(path +'SLS_Z_BLACK_C2/01_UV_SLS_Z_black_C2.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data59 = pd.read_csv(path +'SLS_Z_BLACK_C2/02_UV_SLS_Z_black_C2.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data60 = pd.read_csv(path +'SLS_Z_BLACK_C2/03_UV_SLS_Z_black_C2.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) # "PA3200GF_XY" data61 = pd.read_csv(path +'PA3200GF_XY/01_PA3200GF_XY.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data62 = pd.read_csv(path +'PA3200GF_XY/02_PA3200GF_XY.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data63 = pd.read_csv(path +'PA3200GF_XY/03_PA3200GF_XY.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data64 = pd.read_csv(path +'PA3200GF_XY/01_UV_PA3200GF_XY.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data65 = pd.read_csv(path +'PA3200GF_XY/02_UV_PA3200GF_XY.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data66 = pd.read_csv(path +'PA3200GF_XY/03_UV_PA3200GF_XY.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) # "PA3200GF_Z" data67 = pd.read_csv(path +'PA3200GF_Z/01_PA3200GF_Z.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data68 = pd.read_csv(path +'PA3200GF_Z/02_PA3200GF_Z.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data69 = pd.read_csv(path +'PA3200GF_Z/03_PA3200GF_Z.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data70 = pd.read_csv(path +'PA3200GF_Z/01_UV_PA3200GF_Z.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data71 = pd.read_csv(path +'PA3200GF_Z/02_UV_PA3200GF_Z.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data72 = pd.read_csv(path +'PA3200GF_Z/03_UV_PA3200GF_Z.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) # "PMMA_PCUV_NUM1 = PC" data73 = pd.read_csv(path +'PMMA_PCUV_NUM1/01_PMMA_PCUV_NUM1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data74 = pd.read_csv(path +'PMMA_PCUV_NUM1/02_PMMA_PCUV_NUM1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data75 = pd.read_csv(path +'PMMA_PCUV_NUM1/03_PMMA_PCUV_NUM1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data76 = pd.read_csv(path +'PMMA_PCUV_NUM1/01_UV_PMMA_PCUV_NUM1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data77 = pd.read_csv(path +'PMMA_PCUV_NUM1/02_UV_PMMA_PCUV_NUM1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data78 = pd.read_csv(path +'PMMA_PCUV_NUM1/03_UV_PMMA_PCUV_NUM1.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) # "PMMA_PCUV_NUM2 = PMMA" data79 = pd.read_csv(path +'PMMAP_PCUV_NUM2/01_PMMA_PCUV_NUM2.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data80 = pd.read_csv(path +'PMMAP_PCUV_NUM2/02_PMMA_PCUV_NUM2.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data81 = pd.read_csv(path +'PMMAP_PCUV_NUM2/03_PMMA_PCUV_NUM2.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data82 = pd.read_csv(path +'PMMAP_PCUV_NUM2/01_UV_PMMA_PCUV_NUM2.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data83 = pd.read_csv(path +'PMMAP_PCUV_NUM2/02_UV_PMMA_PCUV_NUM2.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data84 = pd.read_csv(path +'PMMAP_PCUV_NUM2/03_UV_PMMA_PCUV_NUM2.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) # "ABS_BLACK" data85 = pd.read_csv(path +'ABS_BLACK/01_ABS_BLACK.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data86 = pd.read_csv(path +'ABS_BLACK/02_ABS_BLACK.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data87 = pd.read_csv(path +'ABS_BLACK/03_ABS_BLACK.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data88 = pd.read_csv(path +'ABS_BLACK/01_UV_ABS_BLACK.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data89 = pd.read_csv(path +'ABS_BLACK/02_UV_ABS_BLACK.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data90 = pd.read_csv(path +'ABS_BLACK/03_UV_ABS_BLACK.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) # "ABS_WHITE" data91 = pd.read_csv(path +'ABS_WHITE/01_ABS_WHITE.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data92 = pd.read_csv(path +'ABS_WHITE/02_ABS_WHITE.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data93 = pd.read_csv(path +'ABS_WHITE/03_ABS_WHITE.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data94 = pd.read_csv(path +'ABS_WHITE/01_UV_ABS_WHITE.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data95 = pd.read_csv(path +'ABS_WHITE/02_UV_ABS_WHITE.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data96 = pd.read_csv(path +'ABS_WHITE/03_UV_ABS_WHITE.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) # "PA66GF30" data97 = pd.read_csv(path +'PA66GF30/01_PA66GF30_Black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data98 = pd.read_csv(path +'PA66GF30/02_PA66GF30_Black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data99 = pd.read_csv(path +'PA66GF30/03_PA66GF30_Black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data100 = pd.read_csv(path +'PA66GF30/01_UV_PA66GF30_Black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data101 = pd.read_csv(path +'PA66GF30/02_UV_PA66GF30_Black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data102 = pd.read_csv(path +'PA66GF30/03_UV_PA66GF30_Black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) # "PA66MOS2" data103 = pd.read_csv(path +'PA66MOS2/01_PA66MOS2_Black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data104 = pd.read_csv(path +'PA66MOS2/02_PA66MOS2_Black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data105 = pd.read_csv(path +'PA66MOS2/03_PA66MOS2_Black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data106 = pd.read_csv(path +'PA66MOS2/01_UV_PA66MOS2_Black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data107 = pd.read_csv(path +'PA66MOS2/02_UV_PA66MOS2_Black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data108 = pd.read_csv(path +'PA66MOS2/03_UV_PA66MOS2_Black.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) # "PA12G_NATURAL" data109 = pd.read_csv(path +'PA12G_NATURAL/01_PA12G_NATURAL.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data110 = pd.read_csv(path +'PA12G_NATURAL/02_PA12G_NATURAL.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data111 = pd.read_csv(path +'PA12G_NATURAL/03_PA12G_NATURAL.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data112 = pd.read_csv(path +'PA12G_NATURAL/01_UV_PA12G_NATURAL.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data113 = pd.read_csv(path +'PA12G_NATURAL/02_UV_PA12G_NATURAL.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data114 = pd.read_csv(path +'PA12G_NATURAL/03_UV_PA12G_NATURAL.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) # "C_REINFORCED_XY" data115 = pd.read_csv(path +'C_REINFORCED_XY/01_C_REINFORCED_XY.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data116 = pd.read_csv(path +'C_REINFORCED_XY/02_C_REINFORCED_XY.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data117 = pd.read_csv(path +'C_REINFORCED_XY/03_C_REINFORCED_XY.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data118 = pd.read_csv(path +'C_REINFORCED_XY/01_UV_C_REINFORCED_XY.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data119 = pd.read_csv(path +'C_REINFORCED_XY/02_UV_C_REINFORCED_XY.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) data120 = pd.read_csv(path +'C_REINFORCED_XY/03_UV_C_REINFORCED_XY.txt', skiprows = [0,1,2,3,4,6], encoding = "ISO-8859-1", error_bad_lines=False) # # # ####### FUNCTIONS ################# ## Max values and elongation (crosshead) at break: # # # def calc_max_values(data): # from a CSV file tracks the Stress and Load values and returns their maximum values. Then proceeds to output the # values for crosshead (extension) aka elongation at break at the breaking point # init values peak_stress = 0 peak_load = 0 elongation_at_break = 0 elongation_list = [] # Data prehandling, data len elongation_list = data['Crosshead (mm)'] stress_list = data['Stress (MPa)'] load_list = data['Load (kN)'] list_len = len(elongation_list) elongation_at_break = elongation_list[list_len-1] peak_stress = max(stress_list) peak_load = max(load_list) # find max stress #max_stress = max() #print('List len in notepad_plus_plus: ', (list_len + 7)) #print('Peak Stress (MPa): ', peak_stress) #print('Peak load (kN): ', peak_load) #print('Crosshead at break (mm): ', elongation_at_break) #print('\n') return peak_stress, peak_load, elongation_at_break ## Calculate Tensile Modulus # # # def tensile_mod(data): # Calculates the modulus value based on the extensometer and stress value max up to 0.25% extension # according to the ISO 527 standard # data prehandling extension_list = data['Extensometer (mm/mm)'] stress_list = data['Stress (MPa)'] # init values tensile_modulus = 0 # find the index for 0.25 % extension index = min(range(len(extension_list)), key=lambda i: abs(extension_list[i]-0.0025)) tensile_modulus = (stress_list[index] - stress_list[6]) / (extension_list[index] - extension_list[6]) print('Index closest to 0.0025 is :', index) print('The tensile modulus of the sample is (MPa): ', tensile_modulus) print('\n') return tensile_modulus ## Print all values # # # def print_set_values(data1, data2, data3): print('Sample 1') sample_1 = calc_max_values(data1) tensile_modulus_1 = tensile_mod(data1) print('Sample 2') sample_2 = calc_max_values(data2) tensile_modulus_2 = tensile_mod(data2) print('Sample 3') sample_3 = calc_max_values(data3) tensile_modulus_3 = tensile_mod(data3) Set_stresses = [sample_1[0], sample_2[0], sample_3[0]] Set_loads = [sample_1[1], sample_2[1], sample_3[1]] Set_elongation = [sample_1[2], sample_2[2], sample_3[2]] Set_modulus = [tensile_modulus_1, tensile_modulus_2, tensile_modulus_3] print('Mean Peak Stress:', statistics.mean(Set_stresses)) print('Mean Peak Load:', statistics.mean(Set_loads)) print('Mean elongation at break:', statistics.mean(Set_elongation)) print('Mean Elastic Modulus:', statistics.mean(Set_modulus)) print('\n') print('Stdev Peak Stress:', statistics.stdev(Set_stresses)) print('Stdev Peak Load:', statistics.stdev(Set_loads)) print('Stdev elongation at break:', statistics.stdev(Set_elongation)) print('Stdev Elastic Modulus:', statistics.stdev(Set_modulus)) print('\n') # # ### Average elongation to limit the polynomial fit range def average_elongation(data1, data2, data3): sample_1 = calc_max_values(data1) sample_2 = calc_max_values(data2) sample_3 = calc_max_values(data3) Set_elongation = [sample_1[2], sample_2[2], sample_3[2]] mean_elongation = statistics.mean(Set_elongation) return mean_elongation # # ## VALUE CALCULATIONS AND PRINTS # #print('SET 01') #print_set_values(data1, data2, data3) # # # #### PLOT FUNCTIONS def basic_plot(first_data, second_data, third_data, transp, linestyle, linecolor): plt.plot(first_data['Crosshead (mm)'], first_data['Stress (MPa)'], linestyle=linestyle, color= linecolor, alpha = transp) plt.plot(second_data['Crosshead (mm)'], second_data['Stress (MPa)'], linestyle=linestyle, color= linecolor, alpha = transp) plt.plot(third_data['Crosshead (mm)'], third_data['Stress (MPa)'], linestyle=linestyle, color= linecolor, alpha = transp) def polynomial_fit(first_data, second_data, third_data, degree, linestyle, linecolor, title): dataframes = [first_data, second_data, third_data] combined_data = pd.concat(dataframes) p = np.poly1d(np.polyfit(combined_data['Crosshead (mm)'], combined_data['Stress (MPa)'], degree)) t = np.linspace(0, average_elongation(first_data, second_data, third_data), 200) plt.plot(t, p(t), linestyle=linestyle, color= linecolor, label= title) # '-' removed after p(t), , # Curve fitting example: https://nagordon.github.io/mechpy/Curve_fitting_and_Optimization_with_python.html ########################################################### # # ## PLOTTING DATA # # # #### DEFINE PLOT OVERALL STYLE AND TITLE plt.figure(figsize=(15,10)) plt.xlabel('Crosshead (mm)', fontsize = 12) plt.ylabel('Stress (MPa)', fontsize = 12) plt.title('3D printed materials', fontsize = 18) plt.axis([0,10, 5, 35]) plt.grid(True) # # # ### PRE-DEFINED PLOT VISUALIZATIONS # COLORS # # BLUE: '#154360' # DARK RED: '#8b0000' # BLACK '#000000' # # "SLS_XY_BLACK" #basic_plot(data1, data2, data3, 0.2, '-', '#154360') #polynomial_fit(data1, data2, data3, 6, '-', '#154360', 'SLS PA2200, black, X, no coating') #basic_plot(data4, data5, data6, 0.2, '-', '#8b0000') #polynomial_fit(data4, data5, data6, 6, '-', '#8b0000', 'SLS PA2200, black, X, no coating, 1500h UV') # # "SLS_Z_BLACK" #basic_plot(data7, data8, data9, 0.2, ':', '#154360') #polynomial_fit(data7, data8, data9, 4, ':', '#154360', 'SLS PA2200, black, Z, no coating') #basic_plot(data10, data11, data12, 0.2, ':', '#8b0000') #polynomial_fit(data10, data11, data12, 6, ':', '#8b0000', 'SLS PA2200, black, Z, no coating, 1500h UV') # # "SLS_XY_BLACK_COATING_1" #basic_plot(data13, data14, data15, 0.2, '-', '#154360') #polynomial_fit(data13, data14, data15, 5, '-', '#154360', 'SLS PA2200, black, X, coating 1') #basic_plot(data16, data17, data18, 0.2, '-', '#8b0000') #polynomial_fit(data16, data17, data18, 6, '-', '#8b0000', 'SLS PA2200, black, X, coating 1, 1500h UV') # # "SLS_Z_BLACK_COATING_1" #basic_plot(data19, data20, data21, 0.2, ':', '#154360') #polynomial_fit(data19, data20, data21, 4, ':', '#154360', 'SLS PA2200, black, Z, coating 1') #basic_plot(data22, data23, data24, 0.2, ':', '#8b0000') #polynomial_fit(data22, data23, data24, 6, ':', '#8b0000', 'SLS PA2200, black, Z, coating 1, 1500h UV') # # "MJF_XY_BLACK" #basic_plot(data25, data26, data27, 0.2, '-', '#154360') #polynomial_fit(data25, data26, data27, 6, '-', '#154360', 'MJF PA12, black, X, no coating') #basic_plot(data28, data29, data30, 0.2, '-', '#8b0000') #polynomial_fit(data28, data29, data30, 6, '-', '#8b0000', 'MJF PA12, black, X, no coating, 1500h UV') # # "MJF_Z_BLACK" #basic_plot(data31, data32, data33, 0.2, ':', '#154360') #polynomial_fit(data31, data32, data33, 8, ':', '#154360', 'MJF PA12, black, Z, no coating') #basic_plot(data34, data35, data36, 0.2, ':', '#8b0000') #polynomial_fit(data34, data35, data36, 4, ':', '#8b0000', 'MJF PA12, black, Z, no coating, 1500h UV') # # "MJF_XY_BLACK_COATING_1" #basic_plot(data37, data38, data39, 0.2, '-', '#154360') #polynomial_fit(data37, data38, data39, 6, '-', '#154360', 'MJF PA12, black, X, coating 1') #basic_plot(data40, data41, data42, 0.2, '-', '#8b0000') #polynomial_fit(data40, data41, data42, 6, '-', '#8b0000', 'MJF PA12, black, X, coating 1, 1500h UV') # # "MJF_Z_BLACK_COATING_1" #basic_plot(data43, data44, data45, 0.2, ':', '#154360') #polynomial_fit(data43, data44, data45, 6, ':', '#154360', 'MJF PA12, black, Z, coating 1') #basic_plot(data46, data47, data48, 0.2, ':', '#8b0000') #polynomial_fit(data46, data47, data48, 6, ':', '#8b0000', 'MJF PA12, black, Z, coating 1, 1500h UV') # # "SLS_XY_BLACK_COATING_2" #basic_plot(data49, data50, data51, 0.2, '-', '#154360') #polynomial_fit(data49, data50, data51, 5, '-', '#154360', 'SLS PA2200, black, X, coating 2') #basic_plot(data52, data53, data54, 0.2, '-', '#8b0000') #polynomial_fit(data52, data53, data54, 5, '-', '#8b0000', 'SLS PA2200, black, X, coating 2, 1500h UV') # # "SLS_Z_BLACK_COATING_2" #basic_plot(data55, data56, data57, 0.2, ':', '#154360') #polynomial_fit(data55, data56, data57, 6, ':', '#154360', 'SLS PA2200, black, Z, coating 2') #basic_plot(data58, data59, data60, 0.2, ':', '#8b0000') #polynomial_fit(data58, data59, data60, 6, ':', '#8b0000', 'SLS PA2200, black, Z, coating 2, 1500h UV') # # "SLS_PA3200_XY" #basic_plot(data61, data62, data63, 0.2, '-', '#154360') #polynomial_fit(data61, data62, data63, 5, '-', '#154360', 'SLS PA3200GF, X, no coating') #basic_plot(data64, data65, data66, 0.2, '-', '#8b0000') #polynomial_fit(data64, data65, data66, 5, '-', '#8b0000', 'SLS PA3200GF, X, no coating, 1500h UV') # # "SLS_PA3200_Z" #basic_plot(data67, data68, data69, 0.2, ':', '#154360') #polynomial_fit(data67, data68, data69, 5, ':', '#154360', 'SLS PA3200GF, Z, no coating') #basic_plot(data70, data71, data72, 0.2, ':', '#8b0000') #polynomial_fit(data70, data71, data72, 5, ':', '#8b0000', 'SLS PA3200GF, Z, no coating, 1500h UV') # # "PC_PMMA_NUM1 = UV Resistant Polycarbonate" #basic_plot(data73, data74, data75, 0.2, '-', '#154360') #polynomial_fit(data73, data74, data75, 15, '-', '#154360', 'UV stabilized polycarbonate') #basic_plot(data76, data77, data78, 0.2, '-', '#8b0000') #polynomial_fit(data76, data77, data78, 5, '-', '#8b0000', 'UV stabilized polycarbonate, 1500h UV') # # "PC_PMMA_NUM2 = PMMA" #basic_plot(data79, data80, data81, 0.2, '-', '#154360') #polynomial_fit(data79, data80, data81, 6, '-', '#154360', 'Clear PMMA') #basic_plot(data82, data83, data84, 0.2, '-', '#8b0000') #polynomial_fit(data82, data83, data84, 5, '-', '#8b0000', 'Clear PMMA, 1500h UV') # # "ABS_BLACK" #basic_plot(data85, data86, data87, 0.2, '-', '#154360') #polynomial_fit(data85, data86, data87, 10, '-', '#154360', 'ABS black') #basic_plot(data88, data89, data90, 0.2, '-', '#8b0000') #polynomial_fit(data88, data89, data90, 10, '-', '#8b0000', 'ABS black, 1500h UV') # # "ABS_WHITE" #basic_plot(data91, data92, data93, 0.2, ':', '#154360') #polynomial_fit(data91, data92, data93, 10, ':', '#154360', 'ABS white') #basic_plot(data94, data95, data96, 0.2, ':', '#8b0000') #polynomial_fit(data94, data95, data96, 8, ':', '#8b0000', 'ABS white, 1500h UV') # # "PA66GF30" #basic_plot(data97, data98, data99, 0.2, '-', '#154360') #polynomial_fit(data97, data98, data99, 5, '-', '#154360', 'PA66GF') #basic_plot(data100, data101, data102, 0.2, '-', '#8b0000') #polynomial_fit(data100, data101, data102, 5, '-', '#8b0000', 'PA66GF, 1500h UV') # # "PA66MOS2" #basic_plot(data103, data104, data105, 0.2, '-', '#154360') #polynomial_fit(data103, data104, data105, 9, '-', '#154360', 'PA66MoS2') #basic_plot(data106, data107, data108, 0.2, '-', '#8b0000') #polynomial_fit(data106, data107, data108, 5, '-', '#8b0000', 'PA66MoS2, 1500h UV') # # "PA12_NATURAL" #basic_plot(data109, data110, data111, 0.2, '-', '#154360') #polynomial_fit(data109, data110, data111, 10, '-', '#154360', 'Cast PA12') #basic_plot(data112, data113, data114, 0.2, '-', '#8b0000') #polynomial_fit(data112, data113, data114, 5, '-', '#8b0000', 'Cast PA12, 1500h UV') # # "C_REINFORCED_X" #basic_plot(data115, data116, data117, 0.2, '-', '#154360') #polynomial_fit(data115, data116, data117, 5, '-', '#154360', 'Carbon filled and reinforced PA, X, UV varnish') #basic_plot(data118, data119, data120, 0.2, '-', '#8b0000') #polynomial_fit(data118, data119, data120, 5, '-', '#8b0000', 'Carbon filled and reinforced PA, X, UV varnish, 1500h UV') # # ################ COMPARISON PLOTS ############################ ############################################################## # Matplotlib linestyles : https://matplotlib.org/stable/gallery/lines_bars_and_markers/linestyles.html # # ALL MATERIALS - POLYNOMIAL FITS # "SLS_X_BLACK" #polynomial_fit(data1, data2, data3, 6, '-', '#154360', 'SLS PA2200, black, X, no coating') #polynomial_fit(data4, data5, data6, 6, '-', '#8b0000', '') # "SLS_Z_BLACK" #polynomial_fit(data7, data8, data9, 4, ':', '#154360', 'SLS PA2200, black, Z, no coating') #polynomial_fit(data10, data11, data12, 6, ':', '#8b0000', '') # "SLS_XY_BLACK_COATING_1" #polynomial_fit(data13, data14, data15, 5, '--', '#154360', 'SLS PA2200, black, X, coating 1') #polynomial_fit(data16, data17, data18, 6, '--', '#8b0000', '') # "SLS_Z_BLACK_COATING_1" #polynomial_fit(data19, data20, data21, 4, '-.', '#154360', 'SLS PA2200, black, Z, coating 1') #polynomial_fit(data22, data23, data24, 6, '-.', '#8b0000', '') # "MJF_XY_BLACK" #polynomial_fit(data25, data26, data27, 6, (0, (1, 10)), '#154360', 'MJF PA12, black, X, no coating') #polynomial_fit(data28, data29, data30, 6, (0, (1, 10)), '#8b0000', '') # "MJF_Z_BLACK" #polynomial_fit(data31, data32, data33, 8, (0, (1, 1)), '#154360', 'MJF PA12, black, Z, no coating') #polynomial_fit(data34, data35, data36, 4, (0, (1, 1)), '#8b0000', '') # "MJF_XY_BLACK_COATING_1" #polynomial_fit(data37, data38, data39, 6, (0, (5, 10)), '#154360', 'MJF PA12, black, X, coating 1') #polynomial_fit(data40, data41, data42, 6, (0, (5, 10)), '#8b0000', '') # "MJF_Z_BLACK_COATING_1" #polynomial_fit(data43, data44, data45, 6, (0, (5, 1)), '#154360', 'MJF PA12, black, Z, coating 1') #polynomial_fit(data46, data47, data48, 6, (0, (5, 1)), '#8b0000', '') # "SLS_XY_BLACK_COATING_2" #polynomial_fit(data49, data50, data51, 5, (0, (3, 10, 1, 10)), '#154360', 'SLS PA2200, black, X, coating 2') #polynomial_fit(data52, data53, data54, 5, (0, (3, 10, 1, 10)), '#8b0000', '') # "SLS_Z_BLACK_COATING_2" #polynomial_fit(data55, data56, data57, 6, (0, (3, 5, 1, 5)), '#154360', 'SLS PA2200, black, Z, coating 2') #polynomial_fit(data58, data59, data60, 6, (0, (3, 5, 1, 5)), '#8b0000', '') # "SLS_PA3200_XY" #polynomial_fit(data61, data62, data63, 5, (0, (3, 1, 1, 1)), '#154360', 'SLS PA3200GF, X, no coating') #polynomial_fit(data64, data65, data66, 5, (0, (3, 1, 1, 1)), '#8b0000', '') # "SLS_PA3200_Z" #polynomial_fit(data67, data68, data69, 5, (0, (3, 5, 1, 5, 1, 5)), '#154360', 'SLS PA3200GF, Z, no coating') #polynomial_fit(data70, data71, data72, 5, (0, (3, 5, 1, 5, 1, 5)), '#8b0000', '') # "C_REINFORCED_X" #polynomial_fit(data115, data116, data117, 5, (0, (3, 10, 1, 10, 1, 10)), '#154360', 'Carbon filled and reinforced PA, X, UV varnish') #polynomial_fit(data118, data119, data120, 5, (0, (3, 10, 1, 10, 1, 10)), '#8b0000', '') # "PC_PMMA_NUM1 = UV Resistant Polycarbonate" #polynomial_fit(data73, data74, data75, 15, '-', '#000000', 'UV stabilized polycarbonate') #polynomial_fit(data76, data77, data78, 5, '-', '#808080', 'UV stabilized polycarbonate, 1500h UV') # "PC_PMMA_NUM2 = PMMA" #polynomial_fit(data79, data80, data81, 6, '.', '#000000', 'Clear PMMA') #polynomial_fit(data82, data83, data84, 5, '.', '#808080', 'Clear PMMA, 1500h UV') # "ABS_BLACK" #polynomial_fit(data85, data86, data87, 10, '--', '#000000', 'ABS black') #polynomial_fit(data88, data89, data90, 10, '--', '#808080', 'ABS black, 1500h UV') # "ABS_WHITE" #polynomial_fit(data91, data92, data93, 10, '-.', '#000000', 'ABS white') #polynomial_fit(data94, data95, data96, 8, '-.', '#808080', 'ABS white, 1500h UV') # "PA66GF30" #polynomial_fit(data97, data98, data99, 5, (0, (1, 10)), '#000000', 'PA66GF') #polynomial_fit(data100, data101, data102, 5, (0, (1, 10)), '#808080', 'PA66GF, 1500h UV') # "PA66MOS2" #polynomial_fit(data103, data104, data105, 9, (0, (1, 1)), '#000000', 'PA66MoS2') #polynomial_fit(data106, data107, data108, 5, (0, (1, 1)), '#808080', 'PA66MoS2, 1500h UV') # "PA12_NATURAL" #polynomial_fit(data109, data110, data111, 10, (0, (5, 10)), '#000000', 'Cast PA12') #polynomial_fit(data112, data113, data114, 5, (0, (5, 10)), '#808080', 'Cast PA12, 1500h UV') ################################################################3 ################################################### # # SLS AND MJF, NO COATING # "SLS_X_BLACK" #polynomial_fit(data1, data2, data3, 6, '-', '#154360', 'SLS PA2200, black, X, no coating') #polynomial_fit(data4, data5, data6, 6, '-', '#8b0000', 'SLS PA2200, black, X, no coating, 1500h UV') # "SLS_Z_BLACK" #polynomial_fit(data7, data8, data9, 4, ':', '#154360', 'SLS PA2200, black, Z, no coating') #polynomial_fit(data10, data11, data12, 6, ':', '#8b0000', 'SLS PA2200, black, Z, no coating, 1500h UV') # "MJF_XY_BLACK" #polynomial_fit(data25, data26, data27, 6, '--', '#154360', 'MJF PA12, black, X, no coating') #polynomial_fit(data28, data29, data30, 6, '--', '#8b0000', 'MJF PA12, black, X, no coating, 1500h UV') # "MJF_Z_BLACK" #polynomial_fit(data31, data32, data33, 8, '-.', '#154360', 'MJF PA12, black, Z, no coating') #polynomial_fit(data34, data35, data36, 4, '-.', '#8b0000', 'MJF PA12, black, Z, no coating, 1500h UV') # # SLS AND MJF COATING 1 # "SLS_X_BLACK" #polynomial_fit(data1, data2, data3, 6, '-', '#154360', 'SLS PA2200, black, X, no coating') #polynomial_fit(data4, data5, data6, 6, '-', '#8b0000', 'SLS PA2200, black, X, no coating, 1500h UV') # "SLS_Z_BLACK" #polynomial_fit(data7, data8, data9, 4, ':', '#154360', 'SLS PA2200, black, Z, no coating') #polynomial_fit(data10, data11, data12, 6, ':', '#8b0000', 'SLS PA2200, black, Z, no coating, 1500h UV') # "SLS_XY_BLACK_COATING_1" #polynomial_fit(data13, data14, data15, 5, '--', '#154360', 'SLS PA2200, black, X, coating 1') #polynomial_fit(data16, data17, data18, 6, '--', '#8b0000', 'SLS PA2200, black, X, coating 1, 1500h UV') # "SLS_Z_BLACK_COATING_1" #polynomial_fit(data19, data20, data21, 4, '-.', '#154360', 'SLS PA2200, black, Z, coating 1') #polynomial_fit(data22, data23, data24, 6, '-.', '#8b0000', 'SLS PA2200, black, Z, coating 1, 1500h UV') # .......................... # "MJF_XY_BLACK" #polynomial_fit(data25, data26, data27, 6, ':', '#154360', 'MJF PA12, black, X, no coating') #polynomial_fit(data28, data29, data30, 6, ':', '#8b0000', 'MJF PA12, black, X, no coating, 1500h UV') # "MJF_Z_BLACK" #polynomial_fit(data31, data32, data33, 8, ':', '#154360', 'MJF PA12, black, Z, no coating') #polynomial_fit(data34, data35, data36, 4, ':', '#8b0000', 'MJF PA12, black, Z, no coating, 1500h UV') # "MJF_XY_BLACK_COATING_1" #polynomial_fit(data37, data38, data39, 6, '-.', '#154360', 'MJF PA12, black, X, coating 1') #polynomial_fit(data40, data41, data42, 6, '-.', '#8b0000', 'MJF PA12, black, X, coating 1, 1500h UV') # "MJF_Z_BLACK_COATING_1" #polynomial_fit(data43, data44, data45, 6, '-.', '#154360', 'MJF PA12, black, Z, coating 1') #polynomial_fit(data46, data47, data48, 6, '-.', '#8b0000', 'MJF PA12, black, Z, coating 1, 1500h UV') # # SLS COATING 2 # "SLS_X_BLACK" #polynomial_fit(data1, data2, data3, 6, '-', '#154360', 'SLS PA2200, black, X, no coating') #polynomial_fit(data4, data5, data6, 6, '-', '#8b0000', 'SLS PA2200, black, X, no coating, 1500h UV') # "SLS_Z_BLACK" #polynomial_fit(data7, data8, data9, 4, ':', '#154360', 'SLS PA2200, black, Z, no coating') #polynomial_fit(data10, data11, data12, 6, ':', '#8b0000', 'SLS PA2200, black, Z, no coating, 1500h UV') # "SLS_XY_BLACK_COATING_2" #polynomial_fit(data49, data50, data51, 5, '--', '#154360', 'SLS PA2200, black, X, coating 2') #polynomial_fit(data52, data53, data54, 5, '--', '#8b0000', 'SLS PA2200, black, X, coating 2, 1500h UV') # "SLS_Z_BLACK_COATING_2" #polynomial_fit(data55, data56, data57, 6, '-.', '#154360', 'SLS PA2200, black, Z, coating 2') #polynomial_fit(data58, data59, data60, 6, '-.', '#8b0000', 'SLS PA2200, black, Z, coating 2, 1500h UV') ################################################################## ################# TRADITIONAL MATERIALS ########################## # # ALL TRADITIONAL MATERIALS # "PC_PMMA_NUM1 = UV Resistant Polycarbonate" #polynomial_fit(data73, data74, data75, 15, '-', '#000000', 'UV stabilized polycarbonate') #polynomial_fit(data76, data77, data78, 5, '-', '#8b0000', 'UV stabilized polycarbonate, 1500h UV') # "PC_PMMA_NUM2 = PMMA" #polynomial_fit(data79, data80, data81, 6, ':', '#000000', 'Clear PMMA') #polynomial_fit(data82, data83, data84, 5, ':', '#8b0000', 'Clear PMMA, 1500h UV') # "ABS_BLACK" #polynomial_fit(data85, data86, data87, 10, '--', '#000000', 'ABS black') #polynomial_fit(data88, data89, data90, 10, '--', '#8b0000', 'ABS black, 1500h UV') # "ABS_WHITE" #polynomial_fit(data91, data92, data93, 10, '-.', '#000000', 'ABS white') #polynomial_fit(data94, data95, data96, 8, '-.', '#8b0000', 'ABS white, 1500h UV') # "PA66GF30" #polynomial_fit(data97, data98, data99, 5, (0, (1, 10)), '#000000', 'PA66GF') #polynomial_fit(data100, data101, data102, 5, (0, (1, 10)), '#8b0000', 'PA66GF, 1500h UV') # "PA66MOS2" #polynomial_fit(data103, data104, data105, 9, (0, (1, 1)), '#000000', 'PA66MoS2') #polynomial_fit(data106, data107, data108, 5, (0, (1, 1)), '#8b0000', 'PA66MoS2, 1500h UV') # "PA12_NATURAL" #polynomial_fit(data109, data110, data111, 10, (0, (5, 10)), '#000000', 'Cast PA12') #polynomial_fit(data112, data113, data114, 5, (0, (5, 10)), '#8b0000', 'Cast PA12, 1500h UV') ######################################################################### ####################### ALL PRINTED MATERIALS ########################### # "SLS_X_BLACK" #polynomial_fit(data1, data2, data3, 6, '-', '#154360', 'SLS PA2200, black, X, no coating') #polynomial_fit(data4, data5, data6, 6, '-', '#8b0000', 'SLS PA2200, black, X, no coating, 1500h UV') # "SLS_Z_BLACK" #polynomial_fit(data7, data8, data9, 4, ':', '#154360', 'SLS PA2200, black, Z, no coating') #polynomial_fit(data10, data11, data12, 6, ':', '#8b0000', 'SLS PA2200, black, Z, no coating, 1500h UV') # "MJF_XY_BLACK" #polynomial_fit(data25, data26, data27, 6, (0, (1, 10)), '#154360', 'MJF PA12, black, X, no coating') #polynomial_fit(data28, data29, data30, 6, (0, (1, 10)), '#8b0000', 'MJF PA12, black, X, no coating, 1500h UV') # "MJF_Z_BLACK" #polynomial_fit(data31, data32, data33, 8, (0, (1, 1)), '#154360', 'MJF PA12, black, Z, no coating') #polynomial_fit(data34, data35, data36, 4, (0, (1, 1)), '#8b0000', 'MJF PA12, black, Z, no coating, 1500h UV') # "SLS_PA3200_XY" #polynomial_fit(data61, data62, data63, 5, (0, (3, 1, 1, 1)), '#154360', 'SLS PA3200GF, X, no coating') #polynomial_fit(data64, data65, data66, 5, (0, (3, 1, 1, 1)), '#8b0000', 'SLS PA3200GF, X, no coating, 1500h UV') # "SLS_PA3200_Z" #polynomial_fit(data67, data68, data69, 5, (0, (3, 5, 1, 5, 1, 5)), '#154360', 'SLS PA3200GF, Z, no coating') #polynomial_fit(data70, data71, data72, 5, (0, (3, 5, 1, 5, 1, 5)), '#8b0000', 'SLS PA3200GF, Z, no coating, 1500h UV') # "C_REINFORCED_X" #polynomial_fit(data115, data116, data117, 5, (0, (3, 10, 1, 10, 1, 10)), '#154360', 'Carbon filled and reinforced PA, X, UV varnish') #polynomial_fit(data118, data119, data120, 5, (0, (3, 10, 1, 10, 1, 10)), '#8b0000', 'Carbon filled and reinforced PA, X, UV varnish, 1500h UV') # "SLS_X_BLACK" polynomial_fit(data1, data2, data3, 6, '-', '#154360', '') polynomial_fit(data4, data5, data6, 6, '-', '#8b0000', '') # "SLS_Z_BLACK" polynomial_fit(data7, data8, data9, 4, ':', '#154360', '') polynomial_fit(data10, data11, data12, 6, ':', '#8b0000', '') # "MJF_XY_BLACK" polynomial_fit(data25, data26, data27, 6, (0, (1, 10)), '#154360', '') polynomial_fit(data28, data29, data30, 6, (0, (1, 10)), '#8b0000', '') # "MJF_Z_BLACK" polynomial_fit(data31, data32, data33, 8, (0, (1, 1)), '#154360', '') polynomial_fit(data34, data35, data36, 4, (0, (1, 1)), '#8b0000', '') # "SLS_PA3200_XY" polynomial_fit(data61, data62, data63, 5, (0, (3, 1, 1, 1)), '#154360', '') polynomial_fit(data64, data65, data66, 5, (0, (3, 1, 1, 1)), '#8b0000', '') # "SLS_PA3200_Z" polynomial_fit(data67, data68, data69, 5, (0, (3, 5, 1, 5, 1, 5)), '#154360', '') polynomial_fit(data70, data71, data72, 5, (0, (3, 5, 1, 5, 1, 5)), '#8b0000', '') # "C_REINFORCED_X" polynomial_fit(data115, data116, data117, 5, (0, (3, 10, 1, 10, 1, 10)), '#154360', '') polynomial_fit(data118, data119, data120, 5, (0, (3, 10, 1, 10, 1, 10)), '#8b0000', '') ####################################################################### ##################### OTHER COMPARISONS ############################## # # PRINTED VS CAST PA12 # "SLS_X_BLACK" #polynomial_fit(data1, data2, data3, 6, '-', '#154360', '') #polynomial_fit(data4, data5, data6, 6, '-', '#8b0000', '') # "SLS_Z_BLACK" #polynomial_fit(data7, data8, data9, 4, ':', '#154360', '') #polynomial_fit(data10, data11, data12, 6, ':', '#8b0000', '') # "PA12_NATURAL" #polynomial_fit(data109, data110, data111, 12, '--', '#000000', '') #polynomial_fit(data112, data113, data114, 5, '--', '#8b0000', '') # # # PLOT LEGEND AND SAVING plt.legend() plt.savefig(save_path + 'Plots/SAVE_TITLE_ADD_HERE.png', bbox_inches='tight', Transparent = True, dpi = 600) plt.show()