FreezeCasting.net

An open-data initiative

*Data import using MySQLdb

Notebook set-up

In [1]:
%matplotlib inline
# interactictive plots
# %matplotlib notebook
%config InlineBackend.figure_formats = {'png', 'retina'}
# Utilized to create and work with dataframes
import pandas as pd
import numpy as np
import math as m
# MATPLOTLIB
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import matplotlib as mpl
import matplotlib.cm as cm
import matplotlib.colors as mcolors
from matplotlib import rc
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
from pylab import rcParams
from matplotlib.ticker import AutoMinorLocator
import scipy.stats as stats
import statsmodels.api as sm
%load_ext memory_profiler
# %memit
%load_ext autotime
from matplotlib.ticker import AutoMinorLocator
import matplotlib.ticker as ticker
from scipy.stats import gaussian_kde
import statsmodels.api as sm
In [2]:
#Prevent columns/rows from truncating
pd.set_option('display.max_columns', 1000)
pd.set_option('display.max_rows', 5000)
#print(data)
#data.columns.tolist()
time: 7 ms
In [3]:
#Use a function to set default plotting parameters; cuts down on extra code (if you don't want to use matplotlib defaults)
#Note: Running this cell will reset your matplotlib defaults (for this notebook, only)
def default_plotting():
    #fig
    plt.rcParams['savefig.dpi'] = '100'
    plt.rcParams['savefig.format'] = ('png')
    #font
    plt.rcParams['font.family'] = 'Georgia'
    #plt.rcParams['font.size'] = 22
    plt.rcParams['axes.labelsize'] = 18
    plt.rcParams['axes.titlesize'] = 18
    plt.rcParams['xtick.labelsize'] = 18
    plt.rcParams['ytick.labelsize'] = 18
    #legend
    #plt.rcParams['legend.fontsize'] = 12
    #axes
    plt.rcParams['axes.linewidth'] = 1
    plt.rcParams['axes.edgecolor'] = 'black'
    plt.rcParams['axes.facecolor'] = 'white'
    plt.rcParams['axes.grid'] = False
    plt.rcParams['axes.labelpad'] = 10
    plt.rcParams['axes.axisbelow'] = False
    #tick marks
    plt.gca().xaxis.set_ticks_position('bottom')
    plt.gca().yaxis.set_ticks_position('left')
    plt.rcParams['xtick.major.size'] = 7
    plt.rcParams['ytick.major.size'] = 7
    plt.rcParams['ytick.minor.size'] = 3
    plt.rcParams['xtick.minor.size'] = 3
    plt.rcParams['ytick.major.width'] = 1
    plt.rcParams['ytick.minor.width'] = 1
    plt.rcParams['xtick.major.width'] = 1
    plt.rcParams['xtick.minor.width'] = 1
    plt.rcParams['xtick.direction'] = 'in'
    plt.rcParams['ytick.direction'] = 'in'
default_plotting()
plt.close()
time: 535 ms

Connect to MySQL database

In [4]:
import MySQLdb
#command-line arguments
import sys
time: 161 ms
In [5]:
conn = MySQLdb.connect(host="localhost", #Replace with MySQL host name
    user="USERNAME", #Enter as it appears in MySQL database settings
    passwd="PASSWORD", #Replace with MySQL database password that you set when you imported the database to MySQL
    db="NAMEOFDATABASE") #Replace with the name you assigned to the database when you imported to MySQL
# Create proxy cursor to interact with the database
cursor = conn.cursor()
time: 534 ms

Data import

To import the database, we will need to import each table individually, then merge the tables at the end. This is a long process! We also drop MySQL ID columns that are unnecessary here.

In [6]:
cursor.execute('SELECT * FROM authors')
rows = cursor.fetchall()
time: 329 ms
In [7]:
authors = pd.DataFrame( [[ij for ij in i] for i in rows])
authors.rename(columns={0: 'authorID', 1: 'name', 2:'affiliation',
                3: 'city', 4: 'country', 5: 'long',
                6: 'lat', 7: 'email', 8: 'last_updated'}, 
               inplace=True);
# drop last_update column
authors = authors.drop('last_updated', axis = 1)
time: 29 ms
In [8]:
cursor.execute('SELECT * FROM papers')
rows = cursor.fetchall()
time: 374 ms
In [9]:
papers = pd.DataFrame( [[ij for ij in i] for i in rows])
papers.rename(columns={0: 'paperID', 1: 'authorID', 2:'authors',
                3: 'title', 4: 'journal', 5: 'volume',
                6: 'issue', 7: 'pages', 8: 'year',
                9: 'doi', 10: 'material', 11: 'material_group',
                12: 'last_updated'}, 
               inplace=True);
# drop last_update column
papers = papers.drop('last_updated', axis = 1)
time: 41 ms
In [10]:
papers = pd.merge(papers, authors, on = 'authorID', how = 'outer')
time: 126 ms
In [11]:
cursor.execute('SELECT * FROM props_adds')
rows = cursor.fetchall()
time: 145 ms
In [12]:
props_adds = pd.DataFrame( [[ij for ij in i] for i in rows])
props_adds.rename(columns={0: 'addID', 1: 'add_name', 2:'add_density',
                3: 'add_MW'}, 
               inplace=True);
time: 12 ms
In [13]:
cursor.execute('SELECT * FROM props_fluids')
rows = cursor.fetchall()
time: 95 ms
In [14]:
props_fluids = pd.DataFrame( [[ij for ij in i] for i in rows])
props_fluids.rename(columns={0: 'fluidID', 1: 'fluid', 2:'fluid_density_liq',
                3: 'fluid_density_sol', 4: 'fluid_therm_cond_liq', 
                          5: 'fluid_therm_cond_solid', 6: 'last_updated'}, 
               inplace=True);
# drop last_update column
props_fluids = props_fluids.drop('last_updated', axis = 1)
time: 18 ms
In [15]:
cursor.execute('SELECT * FROM props_mech_bulk')
rows = cursor.fetchall()
time: 76 ms
In [16]:
props_mech_bulk = pd.DataFrame( [[ij for ij in i] for i in rows])
props_mech_bulk.rename(columns={0: 'materialID', 1: 'props_material', 2:'material_density',
                3: 'props_compress_bulk', 4: 'props_youngs_bulk', 
                          5: 'props_flexion_bulk', 6: 'last_updated'}, 
               inplace=True);
# drop last_update column
props_mech_bulk = props_mech_bulk.drop('last_updated', axis = 1)
time: 21 ms
In [17]:
cursor.execute('SELECT * FROM props_mold')
rows = cursor.fetchall()
time: 95 ms
In [18]:
props_mold = pd.DataFrame( [[ij for ij in i] for i in rows])
props_mold.rename(columns={0: 'moldID', 1: 'material', 2:'mold_thermal_cond'}, 
               inplace=True);
time: 10 ms
In [19]:
cursor.execute('SELECT * FROM props_particles')
rows = cursor.fetchall()
time: 95 ms
In [20]:
props_particles = pd.DataFrame( [[ij for ij in i] for i in rows])
props_particles.rename(columns={0: 'particleID', 1: 'particle', 2:'description',
                3: 'particle_density', 4: 'particle_thermal_cond', 5: 'last_updated'}, 
               inplace=True);
# drop last_update column
props_particles = props_particles.drop('last_updated', axis = 1)
props_particles = props_particles.drop('description', axis = 1)
time: 23 ms
In [21]:
cursor.execute('SELECT * FROM samples')
rows = cursor.fetchall()
time: 127 ms
In [22]:
samples = pd.DataFrame( [[ij for ij in i] for i in rows])
samples.rename(columns={0: 'sampleID', 1: 'paperID', 2:'materialID',
                3: 'total_VF', 4: 'total_particles', 5: 'total_fluids',
                6: 'composite', 7: 'last_updated'}, 
               inplace=True);
# drop last_update column
samples = samples.drop('last_updated', axis = 1)
samples = pd.merge(props_mech_bulk, samples, on = 'materialID', how = 'outer')
samples.columns = ['materialID', 'props_material', 'bulk_material_density', 'bulk_material_compress', 
                  'bulk_material_youngs', 'bulk_material_flexion', 'sampleID', 'paperID', 
                  'total_VF', 'total_particles', 'total_fluids', 'composite']
samples = samples[['sampleID','paperID', 'materialID', 'props_material', 
                   'bulk_material_density', 'bulk_material_compress', 
                  'bulk_material_youngs', 'bulk_material_flexion', 
                  'total_VF', 'total_particles', 'total_fluids', 'composite']]
samples = samples[(samples['sampleID']) > 0]
time: 92 ms
In [23]:
cursor.execute('SELECT * FROM suspension')
rows = cursor.fetchall()
time: 328 ms
In [24]:
suspension = pd.DataFrame( [[ij for ij in i] for i in rows])
suspension.rename(columns={0: 'ID', 1: 'sampleID', 2:'ballTime',
                3: 'pH', 4: 'viscosity_100', 5: 'zeta', 6: 'last_updated'}, 
               inplace=True);
# drop last_update and suspensionID columns
suspension = suspension.drop('last_updated', axis = 1)
suspension = suspension.drop('ID', axis = 1)
time: 54 ms
In [25]:
cursor.execute('SELECT * FROM susp_fluid_1')
rows = cursor.fetchall()
time: 178 ms
In [26]:
fluid1 = pd.DataFrame( [[ij for ij in i] for i in rows])
fluid1.rename(columns={0: 'ID', 1: 'sampleID', 2:'fluidID',
                3: 'fluid1_vf', 4: 'last_updated'}, 
               inplace=True);
# drop last_update and fluid1ID columns
fluid1 = fluid1.drop('last_updated', axis = 1)
fluid1 = fluid1.drop('ID', axis = 1)
fluid1 = pd.merge(props_fluids, fluid1, on = 'fluidID', how = 'outer')
fluid1.columns = ['fluid1_ID', 'fluid1', 'fluid1_densityLiq', 'fluid1_densitySol', 
                  'fluid1_thermal_condLiq', 'fluid1_thermal_condSolid', 'sampleID', 'fluid1_vf']
fluid1 = fluid1[(fluid1['sampleID']) > 0]
time: 69 ms
In [27]:
cursor.execute('SELECT * FROM susp_fluid_2')
rows = cursor.fetchall()
time: 13 ms
In [28]:
fluid2 = pd.DataFrame( [[ij for ij in i] for i in rows])
fluid2.rename(columns={0: 'ID', 1: 'sampleID', 2:'fluidID',
                3: 'fluid2_vf', 4: 'last_updated'}, 
               inplace=True);
# drop last_update and fluid1ID columns
fluid2 = fluid2.drop('last_updated', axis = 1)
fluid2 = fluid2.drop('ID', axis = 1)
fluid2 = pd.merge(props_fluids, fluid2, on = 'fluidID', how = 'outer')
fluid2.columns = ['fluid2_ID', 'fluid2', 'fluid2_densityLiq', 'fluid2_densitySol', 
                  'fluid2_thermal_condLiq', 'fluid2_thermal_condSolid', 'sampleID', 'fluid2_vf']
fluid2 = fluid2[(fluid2['sampleID']) > 0]
time: 38 ms
In [29]:
cursor.execute('SELECT * FROM susp_part_1')
rows = cursor.fetchall()
time: 120 ms
In [30]:
particle1 = pd.DataFrame( [[ij for ij in i] for i in rows])
particle1.rename(columns={0: 'ID', 1: 'sampleID', 2:'particleID',
                3: 'shape', 4: 'diameter', 5: 'length',
                6: 'particle1_vf', 7: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
particle1 = particle1.drop('last_updated', axis = 1)
particle1 = particle1.drop('ID', axis = 1)
particle1 = pd.merge(props_particles, particle1, on = 'particleID', how = 'outer')
particle1.columns = ['particle1ID', 'particle1', 'particle1_density', 
                     'particle1_thermal_cond', 'sampleID', 'particle1_shape', 
                     'particle1_diameter', 'particle1_length', 'particle1_vf']
particle1 = particle1[(particle1['sampleID']) > 0]
time: 79 ms
In [31]:
cursor.execute('SELECT * FROM susp_part_2')
rows = cursor.fetchall()
time: 47 ms
In [32]:
particle2 = pd.DataFrame( [[ij for ij in i] for i in rows])
particle2.rename(columns={0: 'ID', 1: 'sampleID', 2:'particleID',
                3: 'shape', 4: 'diameter', 5: 'length',
                6: 'particle1_vf', 7: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
particle2 = particle2.drop('last_updated', axis = 1)
particle2 = particle2.drop('ID', axis = 1)
particle2 = pd.merge(props_particles, particle2, on = 'particleID', how = 'outer')
particle2.columns = ['particle2ID', 'particle2', 'particle2_density', 
                     'particle2_thermal_cond', 'sampleID', 'particle2_shape', 
                     'particle2_diameter', 'particle2_length', 'particle2_vf']
particle2 = particle2[(particle2['sampleID']) > 0]
time: 54 ms
In [33]:
cursor.execute('SELECT * FROM susp_part_3')
rows = cursor.fetchall()
time: 21 ms
In [34]:
particle3 = pd.DataFrame( [[ij for ij in i] for i in rows])
particle3.rename(columns={0: 'ID', 1: 'sampleID', 2:'particleID',
                3: 'shape', 4: 'diameter', 5: 'length',
                6: 'particle3_vf', 7: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
particle3 = particle3.drop('last_updated', axis = 1)
particle3 = particle3.drop('ID', axis = 1)
particle3 = pd.merge(props_particles, particle3, on = 'particleID', how = 'outer')
particle3.columns = ['particle3ID', 'particle3', 'particle3_density', 
                     'particle3_thermal_cond', 
                  'sampleID', 'particle3_shape', 'particle3_diameter', 
                     'particle3_length', 'particle3_vf']
particle3 = particle3[(particle3['sampleID']) > 0]
time: 48 ms
In [35]:
cursor.execute('SELECT * FROM susp_disp_1')
rows = cursor.fetchall()
time: 184 ms
In [36]:
dispersant1 = pd.DataFrame( [[ij for ij in i] for i in rows])
dispersant1.rename(columns={0: 'ID', 1: 'sampleID', 2:'addID',
                3: 'dispersant1_wf', 4: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
dispersant1 = dispersant1.drop('last_updated', axis = 1)
dispersant1 = dispersant1.drop('ID', axis = 1)
dispersant1 = pd.merge(props_adds, dispersant1, on = 'addID', how = 'outer')
dispersant1.columns = ['dispersant1ID', 'dispersant1', 'dispersant1_density', 'dispersant1MW', 
                  'sampleID', 'dispersant1_wf']
dispersant1 = dispersant1[(dispersant1['sampleID']) > 0]
time: 70 ms
In [37]:
cursor.execute('SELECT * FROM susp_disp_2')
rows = cursor.fetchall()
time: 34 ms
In [38]:
dispersant2 = pd.DataFrame( [[ij for ij in i] for i in rows])
dispersant2.rename(columns={0: 'ID', 1: 'sampleID', 2:'addID',
                3: 'dispersant2_wf', 4: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
dispersant2 = dispersant2.drop('last_updated', axis = 1)
dispersant2 = dispersant2.drop('ID', axis = 1)
dispersant2 = pd.merge(props_adds, dispersant2, on = 'addID', how = 'outer')
dispersant2.columns = ['dispersant2ID', 'dispersant2', 'dispersant2_density', 'dispersant2MW', 
                  'sampleID', 'dispersant2_wf']
dispersant2 = dispersant2[(dispersant2['sampleID']) > 0]
time: 37 ms
In [39]:
cursor.execute('SELECT * FROM susp_bind_1')
rows = cursor.fetchall()
time: 238 ms
In [40]:
binder1 = pd.DataFrame( [[ij for ij in i] for i in rows])
binder1.rename(columns={0: 'ID', 1: 'sampleID', 2:'addID',
                3: 'binder1_wf', 4: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
binder1 = binder1.drop('last_updated', axis = 1)
binder1 = binder1.drop('ID', axis = 1)
time: 33 ms
In [41]:
binder1 = pd.merge(props_adds, binder1, on = 'addID', how = 'outer')
binder1.columns = ['binder1ID', 'binder1', 'binder1_density', 'binder1_MW', 
                  'sampleID', 'binder1_wf']
binder1 = binder1[(binder1['sampleID']) > 0]
time: 22 ms
In [42]:
cursor.execute('SELECT * FROM susp_bind_2')
rows = cursor.fetchall()
time: 140 ms
In [43]:
binder2 = pd.DataFrame( [[ij for ij in i] for i in rows])
binder2.rename(columns={0: 'ID', 1: 'sampleID', 2:'addID',
                3: 'binder2_wf', 4: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
binder2 = binder2.drop('last_updated', axis = 1)
binder2 = binder2.drop('ID', axis = 1)
binder2 = pd.merge(props_adds, binder2, on = 'addID', how = 'outer')
binder2.columns = ['binder2ID', 'binder2', 'binder2_density', 'binder2_MW', 
                  'sampleID', 'binder2_wf']
binder2 = binder2[(binder2['sampleID']) > 0]
time: 39 ms
In [44]:
cursor.execute('SELECT * FROM susp_cryo')
rows = cursor.fetchall()
time: 152 ms
In [45]:
cryoprotectant = pd.DataFrame( [[ij for ij in i] for i in rows])
cryoprotectant.rename(columns={0: 'ID', 1: 'sampleID', 2:'addID',
                3: 'cryoprotectant_wf', 4: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
cryoprotectant = cryoprotectant.drop('last_updated', axis = 1)
cryoprotectant = cryoprotectant.drop('ID', axis = 1)
cryoprotectant = pd.merge(props_adds, cryoprotectant, on = 'addID', how = 'outer')
cryoprotectant.columns = ['cryoprotectantID', 'cryoprotectant', 'cryoprotectant_density', 'cryoprotectant_MW', 
                  'sampleID', 'cryoprotectant_wf']
cryoprotectant = cryoprotectant[(cryoprotectant['sampleID']) > 0]
time: 41 ms
In [46]:
cursor.execute('SELECT * FROM susp_add_ph')
rows = cursor.fetchall()
time: 123 ms
In [47]:
add_ph = pd.DataFrame( [[ij for ij in i] for i in rows])
add_ph.rename(columns={0: 'ID', 1: 'sampleID', 2:'addID',
                3: 'add_ph_wf', 4: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
add_ph = add_ph.drop('last_updated', axis = 1)
add_ph = add_ph.drop('ID', axis = 1)
add_ph = pd.merge(props_adds, add_ph, on = 'addID', how = 'outer')
add_ph.columns = ['add_phID', 'add_ph', 'add_ph_density', 'add_ph_MW', 
                  'sampleID', 'add_ph_wf']
add_ph = add_ph[(add_ph['sampleID']) > 0]
time: 41 ms
In [48]:
cursor.execute('SELECT * FROM susp_surfact')
rows = cursor.fetchall()
time: 23 ms
In [49]:
surfactant = pd.DataFrame( [[ij for ij in i] for i in rows])
surfactant.rename(columns={0: 'ID', 1: 'sampleID', 2:'addID',
                3: 'surfactant_wf', 4: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
surfactant = surfactant.drop('last_updated', axis = 1)
surfactant = surfactant.drop('ID', axis = 1)
surfactant = pd.merge(props_adds, surfactant, on = 'addID', how = 'outer')
surfactant.columns = ['surfactantID', 'surfactant', 'surfactant_density', 'surfactant_MW', 
                  'sampleID', 'surfactant_wf']
surfactant = surfactant[(surfactant['sampleID']) > 0]
time: 39 ms
In [50]:
cursor.execute('SELECT * FROM susp_init')
rows = cursor.fetchall()
time: 19 ms
In [51]:
initiator = pd.DataFrame( [[ij for ij in i] for i in rows])
initiator.rename(columns={0: 'ID', 1: 'sampleID', 2:'addID',
                3: 'initiator_wf', 4: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
initiator = initiator.drop('last_updated', axis = 1)
initiator = initiator.drop('ID', axis = 1)
initiator = pd.merge(props_adds, initiator, on = 'addID', how = 'outer')
initiator.columns = ['surfactantID', 'initiator', 'initiator_density', 'initiator_MW', 
                  'sampleID', 'initiator_wf']
initiator = initiator[(initiator['sampleID']) > 0]
time: 42 ms
In [52]:
cursor.execute('SELECT * FROM susp_mono')
rows = cursor.fetchall()
time: 20 ms
In [53]:
monomer = pd.DataFrame( [[ij for ij in i] for i in rows])
monomer.rename(columns={0: 'ID', 1: 'sampleID', 2:'addID',
                3: 'initiator_wf', 4: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
monomer = monomer.drop('last_updated', axis = 1)
monomer = monomer.drop('ID', axis = 1)
monomer = pd.merge(props_adds, monomer, on = 'addID', how = 'outer')
monomer.columns = ['monomerID', 'monomer', 'monomer_density', 'monomer_WF', 
                  'sampleID', 'monomer_wf']
monomer = monomer[(monomer['sampleID']) > 0]
time: 41 ms
In [54]:
cursor.execute('SELECT * FROM susp_catal')
rows = cursor.fetchall()
time: 145 ms
In [55]:
catalyst = pd.DataFrame( [[ij for ij in i] for i in rows])
catalyst.rename(columns={0: 'ID', 1: 'sampleID', 2:'addID',
                3: 'initiator_wf', 4: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
catalyst = catalyst.drop('last_updated', axis = 1)
catalyst = catalyst.drop('ID', axis = 1)
catalyst = pd.merge(props_adds, catalyst, on = 'addID', how = 'outer')
catalyst.columns = ['catalystID', 'catalyst', 'catalyst_density', 'catalyst_wf', 
                  'sampleID', 'catalyst_wf']
catalyst = catalyst[(catalyst['sampleID']) > 0]
time: 41 ms
In [56]:
cursor.execute('SELECT * FROM susp_cross')
rows = cursor.fetchall()
time: 156 ms
In [57]:
crosslinker = pd.DataFrame( [[ij for ij in i] for i in rows])
crosslinker.rename(columns={0: 'ID', 1: 'sampleID', 2:'addID',
                3: 'crosslinker_wf', 4: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
crosslinker = crosslinker.drop('last_updated', axis = 1)
crosslinker = crosslinker.drop('ID', axis = 1)
crosslinker = pd.merge(props_adds, crosslinker, on = 'addID', how = 'outer')
crosslinker.columns = ['crosslinkerID', 'crosslinker', 'crosslinker_density', 'crosslinker_wf', 
                  'sampleID', 'crosslinker_wf']
crosslinker = crosslinker[(crosslinker['sampleID']) > 0]
time: 56 ms
In [58]:
cursor.execute('SELECT * FROM susp_viscosity')
rows = cursor.fetchall()
time: 17 ms
In [59]:
viscosity = pd.DataFrame( [[ij for ij in i] for i in rows])
viscosity.rename(columns={0: 'ID', 1: 'sampleID', 2:'shearRate',
                3: 'viscosity', 4: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
viscosity = viscosity.drop('last_updated', axis = 1)
viscosity = viscosity.drop('ID', axis = 1)
time: 22 ms
In [60]:
cursor.execute('SELECT * FROM sublimation')
rows = cursor.fetchall()
time: 319 ms
In [61]:
sublimation = pd.DataFrame( [[ij for ij in i] for i in rows])
sublimation.rename(columns={0: 'ID', 1: 'sampleID', 2:'sublimated',
                3: 'sublimation_time', 4: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
sublimation = sublimation.drop('last_updated', axis = 1)
sublimation = sublimation.drop('ID', axis = 1)
time: 45 ms
In [62]:
cursor.execute('SELECT * FROM solidification')
rows = cursor.fetchall()
time: 328 ms
In [63]:
solidification = pd.DataFrame( [[ij for ij in i] for i in rows])
solidification.rename(columns={0: 'ID', 1: 'sampleID', 2:'technique',
                3: 'direction', 4: 'gravity', 5: 'refrigerant',
                6: 'cooling_rate', 7: 'T_Cold', 8: 'T_Hot', 9: 'T_constant',
                10: 'gradient', 11: 'velocity', 12: 'T_nuceation',
                13: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
solidification = solidification.drop('last_updated', axis = 1)
solidification = solidification.drop('ID', axis = 1)
time: 62 ms
In [64]:
cursor.execute('SELECT * FROM solid_mold')
rows = cursor.fetchall()
time: 448 ms
In [65]:
mold = pd.DataFrame( [[ij for ij in i] for i in rows])
mold.rename(columns={0: 'ID', 1: 'sampleID', 2:'mold_shape',
                3: 'mold_dia', 4: 'mold_height', 5: 'mold_l',
                6: 'mold_w', 7: 'mold_wall', 8: 'fill_height', 9: 'moldID',
                10: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
mold = mold.drop('last_updated', axis = 1)
mold = mold.drop('ID', axis = 1)
mold = pd.merge(props_mold, mold, on = 'moldID', how = 'outer')
mold.columns = ['moldID', 'mold_material', 'mold_thermal_cond', 'sampleID', 
                  'mold_shape', 'mold_dia', 'mold_height', 'mold_l',
               'mold_w', 'mold_wall', 'fill_height']
mold = mold[(mold['sampleID']) > 0]
time: 90 ms
In [66]:
cursor.execute('SELECT * FROM sinter1')
rows = cursor.fetchall()
time: 369 ms
In [67]:
sinter1 = pd.DataFrame( [[ij for ij in i] for i in rows])
sinter1.rename(columns={0: 'ID', 1: 'sampleID', 2:'sinter1_time',
                3: 'sinter1_temp', 4: 'sinter1_rampC', 5: 'sinter1_rampH',
                6: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
sinter1 = sinter1.drop('last_updated', axis = 1)
sinter1 = sinter1.drop('ID', axis = 1)
time: 39 ms
In [68]:
cursor.execute('SELECT * FROM sinter2')
rows = cursor.fetchall()
time: 366 ms
In [69]:
sinter2 = pd.DataFrame( [[ij for ij in i] for i in rows])
sinter2.rename(columns={0: 'ID', 1: 'sampleID', 2:'sinter2_time',
                3: 'sinter2_temp', 4: 'sinter2_rampC', 5: 'sinter2_rampH',
                6: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
sinter2 = sinter2.drop('last_updated', axis = 1)
sinter2 = sinter2.drop('ID', axis = 1)
time: 34 ms
In [70]:
cursor.execute('SELECT * FROM sinter3')
rows = cursor.fetchall()
time: 250 ms
In [71]:
sinter3 = pd.DataFrame( [[ij for ij in i] for i in rows])
sinter3.rename(columns={0: 'ID', 1: 'sampleID', 2:'sinter3_time',
                3: 'sinter3_temp', 4: 'sinter3_rampC', 5: 'sinter3_rampH',
                6: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
sinter3 = sinter3.drop('last_updated', axis = 1)
sinter3 = sinter3.drop('ID', axis = 1)
time: 55 ms
In [72]:
cursor.execute('SELECT * FROM shrinkage')
rows = cursor.fetchall()
time: 144 ms
In [73]:
shrinkage = pd.DataFrame( [[ij for ij in i] for i in rows])
shrinkage.rename(columns={0: 'ID', 1: 'sampleID', 2:'shrinkage_volumetric',
                3: 'shrinkage_diameter', 4: 'shrinkage_linear', 5: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
shrinkage = shrinkage.drop('last_updated', axis = 1)
shrinkage = shrinkage.drop('ID', axis = 1)
time: 24 ms
In [74]:
cursor.execute('SELECT * FROM microstructure')
rows = cursor.fetchall()
time: 393 ms
In [75]:
microstructure = pd.DataFrame( [[ij for ij in i] for i in rows])
microstructure.rename(columns={0: 'ID', 1: 'sampleID', 2:'pore_structure',
                3: 'porosity', 4: 'spacing', 5: 'pore',
                6: 'wall', 7: 'aspectPore', 8: 'aspectWall', 
                9: 'surfaceArea', 10: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
microstructure = microstructure.drop('last_updated', axis = 1)
microstructure = microstructure.drop('ID', axis = 1)
time: 55 ms
In [76]:
cursor.execute('SELECT * FROM composites')
rows = cursor.fetchall()
time: 312 ms
In [77]:
composite = pd.DataFrame( [[ij for ij in i] for i in rows])
composite.rename(columns={0: 'ID', 1: 'sampleID', 2:'compositeType',
                3: 'impregnate_material', 4: 'last_updated'}, 
               inplace=True);
# drop last_update and ID columns
composite = composite.drop('last_updated', axis = 1)
composite = composite.drop('ID', axis = 1)
time: 29 ms
In [78]:
cursor.execute('SELECT * FROM mechanical')
rows = cursor.fetchall()
time: 302 ms
In [79]:
mechanical = pd.DataFrame( [[ij for ij in i] for i in rows])
mechanical.rename(columns={0: 'ID', 1: 'sampleID', 2:'mech_shape',
                3: 'mech_height', 4: 'mech_dia', 5: 'mech_length',
                6: 'mech_width', 7: 'mech_ratio', 8: 'mech_volume', 
                9: 'compression', 10: 'flexural', 11: 'youngs',
                12: 'strainRate', 13: 'crossheadspeed', 14: 'last_updated'}, 
               inplace=True);
mechanical = mechanical.drop('ID', axis = 1)
# drop last_update and ID columns
mechanical = mechanical.drop('last_updated', axis = 1)
time: 45 ms

Dataframe merge

In [80]:
data = pd.merge(papers, samples, on = 'paperID', how = 'outer')
data = pd.merge(data, suspension, on = 'sampleID', how = 'outer')
data = pd.merge(data, fluid1, on = 'sampleID', how = 'outer')
data = pd.merge(data, fluid2, on = 'sampleID', how = 'outer')
data = pd.merge(data, particle1, on = 'sampleID', how = 'outer')
data = pd.merge(data, particle2, on = 'sampleID', how = 'outer')
data = pd.merge(data, particle3, on = 'sampleID', how = 'outer')
data = pd.merge(data, dispersant1, on = 'sampleID', how = 'outer')
data = pd.merge(data, dispersant2, on = 'sampleID', how = 'outer')
data = pd.merge(data, binder1, on = 'sampleID', how = 'outer')
data = pd.merge(data, binder2, on = 'sampleID', how = 'outer')
data = pd.merge(data, cryoprotectant, on = 'sampleID', how = 'outer')
data = pd.merge(data, surfactant, on = 'sampleID', how = 'outer')
data = pd.merge(data, add_ph, on = 'sampleID', how = 'outer')
data = pd.merge(data, initiator, on = 'sampleID', how = 'outer')
data = pd.merge(data, crosslinker, on = 'sampleID', how = 'outer')
data = pd.merge(data, monomer, on = 'sampleID', how = 'outer')
data = pd.merge(data, catalyst, on = 'sampleID', how = 'outer')
data = pd.merge(data, viscosity, on = 'sampleID', how = 'outer')
data = pd.merge(data, solidification, on = 'sampleID', how = 'outer')
data = pd.merge(data, sublimation, on = 'sampleID', how = 'outer')
data = pd.merge(data, mold, on = 'sampleID', how = 'outer')
data = pd.merge(data, sinter1, on = 'sampleID', how = 'outer')
data = pd.merge(data, sinter2, on = 'sampleID', how = 'outer')
data = pd.merge(data, sinter3, on = 'sampleID', how = 'outer')
data = pd.merge(data, shrinkage, on = 'sampleID', how = 'outer')
data = pd.merge(data, microstructure, on = 'sampleID', how = 'outer')
data = pd.merge(data, mechanical, on = 'sampleID', how = 'outer')
data = pd.merge(data, composite, on = 'sampleID', how = 'outer')
data = data[(data['sampleID']) > 0]
time: 2.08 s

Create columns for normalized mechanical values

In [81]:
data['norm_compress'] = (data['compression']/data['bulk_material_compress'])
data['norm_flexural'] = (data['flexural']/data['bulk_material_flexion'])
data['norm_youngs'] = (data['youngs']/data['bulk_material_youngs'])
time: 140 ms

Variable units

Variable(s) Units
Density kg/m3
Thermal conductivity W/m K
Compressive, flexural STRENGTH MPa
Strain rate mm/min
Young's modulus MPa
Ball mill, sintering, sublimation TIME hours
Viscosity Pa s
Velocity um//s
Diameter, length, width, etc. (molds, samples, particles) m
Pore, wall, spacing um
Temperature K
Gradient (thermal) K/m
Cooling/heating rate K/min
Zeta potential eV

Export dataframe to csv, txt

In [82]:
#Print the column values to ensure we've merged everything correctly
print(list(data.columns.values))
['paperID', 'authorID', 'authors', 'title', 'journal', 'volume', 'issue', 'pages', 'year', 'doi', 'material', 'material_group', 'name', 'affiliation', 'city', 'country', 'long', 'lat', 'email', 'sampleID', 'materialID', 'props_material', 'bulk_material_density', 'bulk_material_compress', 'bulk_material_youngs', 'bulk_material_flexion', 'total_VF', 'total_particles', 'total_fluids', 'composite', 'ballTime', 'pH', 'viscosity_100', 'zeta', 'fluid1_ID', 'fluid1', 'fluid1_densityLiq', 'fluid1_densitySol', 'fluid1_thermal_condLiq', 'fluid1_thermal_condSolid', 'fluid1_vf', 'fluid2_ID', 'fluid2', 'fluid2_densityLiq', 'fluid2_densitySol', 'fluid2_thermal_condLiq', 'fluid2_thermal_condSolid', 'fluid2_vf', 'particle1ID', 'particle1', 'particle1_density', 'particle1_thermal_cond', 'particle1_shape', 'particle1_diameter', 'particle1_length', 'particle1_vf', 'particle2ID', 'particle2', 'particle2_density', 'particle2_thermal_cond', 'particle2_shape', 'particle2_diameter', 'particle2_length', 'particle2_vf', 'particle3ID', 'particle3', 'particle3_density', 'particle3_thermal_cond', 'particle3_shape', 'particle3_diameter', 'particle3_length', 'particle3_vf', 'dispersant1ID', 'dispersant1', 'dispersant1_density', 'dispersant1MW', 'dispersant1_wf', 'dispersant2ID', 'dispersant2', 'dispersant2_density', 'dispersant2MW', 'dispersant2_wf', 'binder1ID', 'binder1', 'binder1_density', 'binder1_MW', 'binder1_wf', 'binder2ID', 'binder2', 'binder2_density', 'binder2_MW', 'binder2_wf', 'cryoprotectantID', 'cryoprotectant', 'cryoprotectant_density', 'cryoprotectant_MW', 'cryoprotectant_wf', 'surfactantID_x', 'surfactant', 'surfactant_density', 'surfactant_MW', 'surfactant_wf', 'add_phID', 'add_ph', 'add_ph_density', 'add_ph_MW', 'add_ph_wf', 'surfactantID_y', 'initiator', 'initiator_density', 'initiator_MW', 'initiator_wf', 'crosslinkerID', 'crosslinker', 'crosslinker_density', 'crosslinker_wf', 'crosslinker_wf', 'monomerID', 'monomer', 'monomer_density', 'monomer_WF', 'monomer_wf', 'catalystID', 'catalyst', 'catalyst_density', 'catalyst_wf', 'catalyst_wf', 'shearRate', 'viscosity', 'technique', 'direction', 'gravity', 'refrigerant', 'cooling_rate', 'T_Cold', 'T_Hot', 'T_constant', 'gradient', 'velocity', 'T_nuceation', 'sublimated', 'sublimation_time', 'moldID', 'mold_material', 'mold_thermal_cond', 'mold_shape', 'mold_dia', 'mold_height', 'mold_l', 'mold_w', 'mold_wall', 'fill_height', 'sinter1_time', 'sinter1_temp', 'sinter1_rampC', 'sinter1_rampH', 'sinter2_time', 'sinter2_temp', 'sinter2_rampC', 'sinter2_rampH', 'sinter3_time', 'sinter3_temp', 'sinter3_rampC', 'sinter3_rampH', 'shrinkage_volumetric', 'shrinkage_diameter', 'shrinkage_linear', 'pore_structure', 'porosity', 'spacing', 'pore', 'wall', 'aspectPore', 'aspectWall', 'surfaceArea', 'mech_shape', 'mech_height', 'mech_dia', 'mech_length', 'mech_width', 'mech_ratio', 'mech_volume', 'compression', 'flexural', 'youngs', 'strainRate', 'crossheadspeed', 'compositeType', 'impregnate_material', 'norm_compress', 'norm_flexural', 'norm_youngs']
time: 6 ms
In [83]:
#Replace "ENTERFILEPATH" with the filepath you'd like the csv or text file to be saved to.
data.to_csv(path_or_buf='C:/ENTERFILEPATH/data.txt', 
            header=True)
data.to_csv(path_or_buf='C:/ENTERFILEPATH/data.csv', 
            header=True)
time: 2.69 s

Function for: (1) printing number of papers corresponding to plot points, and (2) creating citations for data plotted.

In [84]:
papers = papers.set_index('paperID')
authors = papers['authors']
year = papers['year']
doi = papers['doi']
journal = papers['journal']
volume = papers['volume']
issue = papers['issue']
title = papers['title']
pages = papers['pages']
papers['citation'] = (
    authors.str.cat(year.astype(str), sep = ' (').str.cat(
        title, sep = '). "').str.cat(journal, sep = '." ').str.cat(
        volume.astype(str), sep = ', ').str.cat(
        issue.astype(str), sep = '(').str.cat(
        pages, sep = '), ').str.cat(doi, sep = '. doi: '))

# define function to return citation information
# for specified paperID
def citations(FigRef):
    for i in FigRef:
        i = index
def Refs(index):
    for i in papers.index:
        return (papers.loc[index,'citation'])
def printPapers(df, FigX):
    #num_Papers = list(df['paperID'].unique())
    #num_Papers = num_Papers.count(num_Papers)
    set_Papers = set(df['paperID'])
    num_Papers = len(set_Papers)
    print 'Number of papers', '(', FigX, '):', num_Papers
time: 234 ms

Freeze-casting growth

In [85]:
# For the following plots, you'll need wordcloud and basemap. Uncomment the lines below and run the cell to install via pip
# ! pip install wordcloud
# ! pip install wordcloud --upgrade
# ! pip install basemap
# ! pip install basemap --upgrade
time: 1 ms

The following plot uses corresponding author location (longitude/latitude) from the authors table to plot author geolocations. Change "FILEPATH" to the filepath you are using to save your figures.

In [87]:
from mpl_toolkits.basemap import Basemap
fig = plt.figure(figsize=(10,10))
fig = Basemap(projection = 'robin', resolution = "l", area_thresh=100000.0, lon_0 = 0, lat_0 = 0)
fig.drawcoastlines(linewidth=0.9)
fig.drawcountries(linewidth=0.9)
fig.fillcontinents(color = 'lightsage', lake_color='#7777ff')
fig.drawmapboundary(fill_color='#f4f4f4')
fig.drawmeridians(np.arange(0, 360, 30), linewidth=0.8)
fig.drawparallels(np.arange(-90, 90, 30), linewidth=0.8)
fig.drawmapboundary(fill_color="#7777ff")
x,y = fig(authors['long'].values, authors['lat'].values)
fig.plot(x, y, 'ro', markersize=4)
plt.savefig('FILEPATH/map.png')
time: 3.35 s

Here, we plot the number of papers published on freeze-casting per year since year 2000. Change "FILEPATH" to the filepath you are using to save your figures. You do not need Seaborn for this plot, you can use matplotlib. However, if you do use Seaborn, you'll need to install it.

In [88]:
import seaborn as sns
sns.set(font_scale=1.75)
sns.set_style("white")
Fig = sns.factorplot("year", data=papers, kind = "count",
                      color = 'b', alpha = 0.6, aspect = 2.2,
                      size = 5)
Fig.set_xticklabels(rotation=30)
Fig.set(xlim=(1.5, 18))
Fig.set_axis_labels("Year", "Number of papers published")
plt.savefig('FILEPATH/papers.png')
plt.savefig('FILEPATH/.png Figures/papers.png')
#reset rc_params (sns resets)
sns.reset_orig()
default_plotting()
time: 823 ms

You'll need to install WordCloud to run this plot. Change "FILEPATH" to the filepath you are using to save your figures.

In [89]:
material_words = papers
material_words = material_words[material_words.material != 'Review']
material_words = material_words[material_words.material != 'Model']
material_words = material_words['material'].str.cat(sep = ' ')
# display(material_words)
from wordcloud import WordCloud
import re
wordcloud = WordCloud(
    background_color = 'black',
    width = 2000,
    height = 1400
                    ).generate(material_words)
plt.imshow(wordcloud)
plt.axis("off");
plt.savefig('FILEPATH/materials.png')
default_plotting()
time: 6.88 s

General microstructure trends

Change filepaths for all of the plots below to the filepath that corresponds to the folder you'd like to save your figures. You'll need to install the statistics packages referenced in the notebook set-up cell, if you'd like the linear regression stats to print with the plot. Otherwise, you can just delete those lines of code prior to running.

We are using the "Number of Papers" function we wrote in the set-up section (function 1) to print the number of papers that correspond to the grouped data points. You can run the citation function (function 2) to print citations for each data point.

In [85]:
porosity_micro = data[(data['porosity']) > 0]
porosity_pore = porosity_micro[(porosity_micro['pore']) > 0]
porosity_wall = porosity_micro[(porosity_micro['wall']) > 0]
porosity_spacing = porosity_micro[(porosity_micro['spacing']) > 0]
X1 = porosity_pore['porosity']*100
X1 = sm.add_constant(X1)
y1 = porosity_pore['pore']
linear_regression_porosity_pore = sm.OLS(y1, X1)
fitted_model_porosity_pore = linear_regression_porosity_pore.fit()
#print(fitted_model_porosityWater.summary())
betas = np.array(fitted_model_porosity_pore.params)
fitted_values_porosity_pore = fitted_model_porosity_pore.predict(X1)
print('porosity_pore: ', fitted_model_porosity_pore.params)
X2 = porosity_wall['porosity']*100
X2 = sm.add_constant(X2)
y2 = porosity_wall['wall']
linear_regression_porosity_wall = sm.OLS(y2, X2)
fitted_model_porosity_wall = linear_regression_porosity_wall.fit()
#print(fitted_model_porosityWater.summary())
betas = np.array(fitted_model_porosity_wall.params)
fitted_values_porosity_wall = fitted_model_porosity_wall.predict(X2)
print('porosity_wall: ', fitted_model_porosity_wall.params)
X3 = porosity_spacing['porosity']*100
X3 = sm.add_constant(X3)
y3 = porosity_spacing['spacing']
linear_regression_porosity_spacing = sm.OLS(y3, X3)
fitted_model_porosity_spacing = linear_regression_porosity_spacing.fit()
#print(fitted_model_porosityWater.summary())
betas = np.array(fitted_model_porosity_spacing.params)
fitted_values_porosity_spacing = fitted_model_porosity_spacing.predict(X3)
print('TBA: ', fitted_model_porosity_spacing.params)

fig = plt.figure(figsize = (6,15))
ax1 = fig.add_subplot(3, 1, 1)
ax2 = fig.add_subplot(3, 1, 2)
ax3 = fig.add_subplot(3, 1, 3)
minorLocator = AutoMinorLocator()
x1 = porosity_pore['porosity']*100
x2 = porosity_wall['porosity']*100
x3 = porosity_spacing['porosity']*100
y1 = porosity_pore['pore']
y2 = porosity_wall['wall']
y3 = porosity_spacing['spacing']
#fit1 = 1.719334*z + -50.374846
#fit2 = -0.713651*xz2 + 73.522240
#fit3 = -0.026450*x3 + 55.109607
ax1.set(xlim = [0, 100])
ax1.set(ylim = [0.1, 1000])
ax2.set(xlim = [0, 100])
ax2.set(ylim = [0.1, 1000])
ax3.set(xlim = [0, 100])
ax3.set(ylim = [0.1, 1000])
ax1.xaxis.set_minor_locator(minorLocator)
ax2.xaxis.set_minor_locator(minorLocator)
ax3.xaxis.set_minor_locator(minorLocator)
ax1.set_ylabel('Pore width (${\mu}$m)', fontsize = 20)
ax2.set_ylabel('Wall width (${\mu}$m)', fontsize = 20)
ax3.set_ylabel('Primary spacing (${\mu}$m)', fontsize = 20)
ax3.set_xlabel('Porosity (%)', fontsize = 20)
ax1.set_yscale('log')
ax2.set_yscale('log')
ax3.set_yscale('log')
ax1.set_xticklabels([])
ax2.set_xticklabels([])
ax1.scatter(x1, y1, color = 'black', s = 20, edgecolor = 'none')
ax2.scatter(x2, y2, color = 'black', s = 20, edgecolor = 'none')
ax3.scatter(x3, y3, color = 'black', s = 20, edgecolor = 'none')
ax1.xaxis.set_ticks_position('bottom')
ax2.xaxis.set_ticks_position('bottom')
ax3.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')
ax2.yaxis.set_ticks_position('left')
ax3.yaxis.set_ticks_position('left')
plt.subplots_adjust(hspace=0, wspace=0)
ax3.xaxis.set_ticks(np.arange(0, 120, 20))
ax1.yaxis.set_major_locator(ticker.LogLocator(base = 10.0))
ax2.yaxis.set_major_locator(ticker.LogLocator(base = 100.0))
ax3.yaxis.set_major_locator(ticker.LogLocator(base = 100.0))
printPapers(porosity_pore, 'fig')
printPapers(porosity_wall, 'fig')
printPapers(porosity_spacing, 'fig')
plt.savefig('FILEPATH/micro.png')
('porosity_pore: ', const      -40.277028
porosity     1.503179
dtype: float64)
('porosity_wall: ', const       75.319176
porosity    -0.763653
dtype: float64)
('TBA: ', const       66.259107
porosity    -0.239520
dtype: float64)
Number of papers ( fig ): 145
Number of papers ( fig ): 43
Number of papers ( fig ): 28
time: 3.1 s

Effect of solid loading

Here, we are using a point density plot to find the trend. You don't need a special library for this, we're just using numpy.

In [86]:
porosity = data[(data['porosity']) > 0]
porosity = porosity[(porosity['total_VF']) > 0]
porosity_water = porosity[(porosity['fluid1_ID']) == 1]
porosity_camphene = porosity[(porosity['fluid1_ID']) == 2]
porosity_tba = porosity[(porosity['fluid1_ID']) == 3]
porosity_other = porosity[(porosity['fluid1_ID']) > 3]


minorLocator1 = AutoMinorLocator()
minorLocator2 = AutoMinorLocator()
x = porosity['total_VF']*100
y = porosity['porosity']*100

# Calculate the point density
xy = np.vstack([x,y])
z = gaussian_kde(xy)(xy)

fig, ax = plt.subplots(figsize = (7,8))
ax.scatter(x, y, c=z, s=25, edgecolor='')
ax.set(xlim = [0, 60])
ax.set(ylim = [0, 100])
ax.yaxis.set_minor_locator(minorLocator1)
ax.xaxis.set_minor_locator(minorLocator2)
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
ax.set_ylabel('Porosity (%)', fontsize = 20)
ax.set_xlabel('Solid loading (vol.%)', fontsize = 20)
printPapers(porosity, 'fig')
plt.savefig('C:FILEPATH/porosity_solid_densityplot.png')
Number of papers ( fig ): 255
time: 1.3 s

Instead of just printing the linear regression statistics, we'll print the linear regression lines to the subplots here. We still print out the statistics so we have the coefficient values.

In [87]:
X1 = porosity_water['total_VF']*100
X1 = sm.add_constant(X1)
y1 = porosity_water['porosity']*100
linear_regression_porosityWater = sm.OLS(y1, X1)
fitted_model_porosityWater = linear_regression_porosityWater.fit()
#print(fitted_model_porosityWater.summary())
betas = np.array(fitted_model_porosityWater.params)
fitted_values_porosityWater = fitted_model_porosityWater.predict(X1)
print('water: ', fitted_model_porosityWater.params)

X2 = porosity_camphene['total_VF']*100
X2 = sm.add_constant(X2)
y2 = porosity_camphene['porosity']*100
linear_regression_porosityCamphene = sm.OLS(y2, X2)
fitted_model_porosityCamphene = linear_regression_porosityCamphene.fit()
#print(fitted_model_porosityWater.summary())
betas = np.array(fitted_model_porosityCamphene.params)
fitted_values_porosityCamphene = fitted_model_porosityCamphene.predict(X2)
print('Camphene: ', fitted_model_porosityCamphene.params)

X3 = porosity_tba['total_VF']*100
X3 = sm.add_constant(X3)
y3 = porosity_tba['porosity']*100
linear_regression_porosityTBA = sm.OLS(y3, X3)
fitted_model_porosityTBA = linear_regression_porosityTBA.fit()
#print(fitted_model_porosityWater.summary())
betas = np.array(fitted_model_porosityTBA.params)
fitted_values_porosityTBA = fitted_model_porosityTBA.predict(X3)
print('TBA: ', fitted_model_porosityTBA.params)

fig = plt.figure(figsize = (10,5))
ax1 = fig.add_subplot(1, 3, 1)
ax2 = fig.add_subplot(1, 3, 2)
ax3 = fig.add_subplot(1, 3, 3)
minorLocator1 = AutoMinorLocator()
minorLocator2 = AutoMinorLocator()
x1 = porosity_water['total_VF']*100
x2 = porosity_camphene['total_VF']*100
x3 = porosity_tba['total_VF']*100
y1 = porosity_water['porosity']*100
y2 = porosity_camphene['porosity']*100
y3 = porosity_tba['porosity']*100
fit1 = -1.073029*x1 + 81.413699
fit2 = -1.120717*x2 + 80.029084
fit3 = -0.615286*x3 + 72.318229
ax1.set(xlim = [0, 60])
ax1.set(ylim = [0, 100])
ax2.set(xlim = [0, 60])
ax2.set(ylim = [0, 100])
ax3.set(xlim = [0, 60])
ax3.set(ylim = [0, 100])
ax1.yaxis.set_minor_locator(minorLocator1)
ax1.xaxis.set_minor_locator(minorLocator2)
ax2.yaxis.set_minor_locator(minorLocator1)
ax2.xaxis.set_minor_locator(minorLocator2)
ax3.yaxis.set_minor_locator(minorLocator1)
ax3.xaxis.set_minor_locator(minorLocator2)
ax1.set_ylabel('Porosity', fontsize = 20)
ax2.set_xlabel('Solid loading (vol.%)', fontsize = 20)
ax1.scatter(x1, y1, color = 'blue', s = 10, edgecolor = 'none')
ax1.plot(x1, fit1, color = 'black')
ax2.scatter(x2, y2, color = 'red', s = 10, edgecolor = 'none')
ax2.plot(x2, fit2, color = 'black')
ax3.scatter(x3, y3, color = 'green', s = 10, edgecolor = 'none')
ax3.plot(x3, fit3, color = 'black')
ax1.xaxis.set_ticks_position('bottom')
ax2.xaxis.set_ticks_position('bottom')
ax3.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')
ax2.yaxis.set_ticks_position('left')
ax3.yaxis.set_ticks_position('left')
ax1.xaxis.set_ticks(np.arange(0, 60, 10))
ax1.yaxis.set_ticks(np.arange(20, 100, 20))
ax2.xaxis.set_ticks(np.arange(10, 60, 10))
ax3.xaxis.set_ticks(np.arange(10, 70, 10))            
ax2.set_yticklabels([])
ax3.set_yticklabels([])
ax1.set_title("Water")
ax2.set_title("Camphene")
ax3.set_title("TBA")
plt.subplots_adjust(hspace=0, wspace=0)
printPapers(porosity_water, 'fig')
printPapers(porosity_camphene, 'fig')
printPapers(porosity_tba, 'fig')
plt.savefig('FILEPATH/porosity_solidload_fluids.png')
('water: ', const       78.310307
total_VF    -0.742944
dtype: float64)
('Camphene: ', const       80.911048
total_VF    -1.121719
dtype: float64)
('TBA: ', const       72.820124
total_VF    -0.621322
dtype: float64)
Number of papers ( fig ): 170
Number of papers ( fig ): 45
Number of papers ( fig ): 37
time: 1.66 s
In [88]:
porosityCera = porosity[(porosity['material_group']) == 'Ceramic']
porosityMetal = porosity[(porosity['material_group']) == 'Metal']
porosityPoly = porosity[(porosity['material_group']) == 'Polymer']
porosityCera_water = porosityCera[(porosityCera['fluid1_ID']) == 1]
porosityCera_camphene = porosityCera[(porosityCera['fluid1_ID']) == 2]
porosityCera_TBA = porosityCera[(porosityCera['fluid1_ID']) == 3]
porosityMetal_water = porosityMetal[(porosityMetal['fluid1_ID']) == 1]
porosityMetal_camphene = porosityMetal[(porosityMetal['fluid1_ID']) == 2]
porosityMetal_TBA = porosityMetal[(porosityMetal['fluid1_ID']) == 3]
porosityPoly_water = porosityPoly[(porosityPoly['fluid1_ID']) == 1]
porosityPoly_camphene = porosityPoly[(porosityPoly['fluid1_ID']) == 2]
porosityPoly_TBA = porosityPoly[(porosityPoly['fluid1_ID']) == 3]
fig = plt.figure(figsize = (12,12))
ax1 = fig.add_subplot(3, 3, 1)
ax2 = fig.add_subplot(3, 3, 2)
ax3 = fig.add_subplot(3, 3, 3)
ax4 = fig.add_subplot(3, 3, 4)
ax5 = fig.add_subplot(3, 3, 5)
ax6 = fig.add_subplot(3, 3, 6)
ax7 = fig.add_subplot(3, 3, 7)
ax8 = fig.add_subplot(3, 3, 8)
ax9 = fig.add_subplot(3, 3, 9)
minorLocator1 = AutoMinorLocator()
minorLocator2 = AutoMinorLocator()
x1 = porosityCera_water['total_VF']*100
y1 = porosityCera_water['porosity']*100
x2 = porosityMetal_water['total_VF']*100
y2 = porosityMetal_water['porosity']*100
x3 = porosityPoly_water['total_VF']*100
y3 = porosityPoly_water['porosity']*100
x4 = porosityCera_camphene['total_VF']*100
y4 = porosityCera_camphene['porosity']*100
x5 = porosityMetal_camphene['total_VF']*100
y5 = porosityMetal_camphene['porosity']*100
x6 = porosityPoly_camphene['total_VF']*100
y6 = porosityPoly_camphene['porosity']*100
x7 = porosityCera_TBA['total_VF']*100
y7 = porosityCera_TBA['porosity']*100
x8 = porosityMetal_TBA['total_VF']*100
y8 = porosityMetal_TBA['porosity']*100
x9 = porosityPoly_TBA['total_VF']*100
y9 = porosityPoly_TBA['porosity']*100
ax1.scatter(x1, y1, color = 'blue', s = 10)
ax2.scatter(x2, y2, color = 'blue', s = 10)
ax3.scatter(x3, y3, color = 'blue', s = 10)
ax4.scatter(x4, y4, color = 'red', s = 10)
ax5.scatter(x5, y5, color = 'red', s = 10)
ax6.scatter(x6, y6, color = 'red', s = 10)
ax7.scatter(x7, y7, color = 'green', s = 10)
ax8.scatter(x8, y8, color = 'green', s = 10)
ax9.scatter(x9, y9, color = 'green', s = 10)
ax1.set(xlim = [0, 60])
ax1.set(ylim = [0, 100])
ax2.set(xlim = [0, 60])
ax2.set(ylim = [0, 100])
ax3.set(xlim = [0, 60])
ax3.set(ylim = [0, 100])
ax4.set(xlim = [0, 60])
ax4.set(ylim = [0, 100])
ax5.set(xlim = [0, 60])
ax5.set(ylim = [0, 100])
ax6.set(xlim = [0, 60])
ax6.set(ylim = [0, 100])
ax7.set(xlim = [0, 60])
ax7.set(ylim = [0, 100])
ax8.set(xlim = [0, 60])
ax8.set(ylim = [0, 100])
ax9.set(xlim = [0, 60])
ax9.set(ylim = [0, 100])
ax1.set_xticklabels([])
ax2.set_xticklabels([])
ax3.set_xticklabels([])
ax4.set_xticklabels([])
ax5.set_xticklabels([])
ax6.set_xticklabels([])
ax2.set_yticklabels([])
ax3.set_yticklabels([])
ax5.set_yticklabels([])
ax6.set_yticklabels([])
ax8.set_yticklabels([])
ax9.set_yticklabels([])
ax1.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')
ax2.xaxis.set_ticks_position('bottom')
ax2.yaxis.set_ticks_position('left')
ax3.xaxis.set_ticks_position('bottom')
ax3.yaxis.set_ticks_position('left')
ax4.xaxis.set_ticks_position('bottom')
ax4.yaxis.set_ticks_position('left')
ax5.xaxis.set_ticks_position('bottom')
ax5.yaxis.set_ticks_position('left')
ax6.xaxis.set_ticks_position('bottom')
ax6.yaxis.set_ticks_position('left')
ax7.xaxis.set_ticks_position('bottom')
ax7.yaxis.set_ticks_position('left')
ax8.xaxis.set_ticks_position('bottom')
ax8.yaxis.set_ticks_position('left')
ax9.xaxis.set_ticks_position('bottom')
ax9.yaxis.set_ticks_position('left')
ax7.xaxis.set_ticks(np.arange(10, 60, 10))
ax8.xaxis.set_ticks(np.arange(10, 60, 10))
ax9.xaxis.set_ticks(np.arange(10, 70, 10))
ax1.yaxis.set_ticks(np.arange(20, 120, 20))
ax3.yaxis.set_ticks(np.arange(20, 100, 20))
ax7.yaxis.set_ticks(np.arange(0, 100, 20))
ax3.yaxis.set_label_position("right")
ax6.yaxis.set_label_position("right")
ax9.yaxis.set_label_position("right")
ax3.yaxis.labelpad = 20
ax6.yaxis.labelpad = 20
ax9.yaxis.labelpad = 20
ax1.yaxis.set_minor_locator(minorLocator1)
ax1.xaxis.set_minor_locator(minorLocator2)
ax2.yaxis.set_minor_locator(minorLocator1)
ax2.xaxis.set_minor_locator(minorLocator2)
ax3.yaxis.set_minor_locator(minorLocator1)
ax3.xaxis.set_minor_locator(minorLocator2)
ax4.yaxis.set_minor_locator(minorLocator1)
ax4.xaxis.set_minor_locator(minorLocator2)
ax5.yaxis.set_minor_locator(minorLocator1)
ax5.xaxis.set_minor_locator(minorLocator2)
ax6.yaxis.set_minor_locator(minorLocator1)
ax6.xaxis.set_minor_locator(minorLocator2)
ax7.yaxis.set_minor_locator(minorLocator1)
ax7.xaxis.set_minor_locator(minorLocator2)
ax8.yaxis.set_minor_locator(minorLocator1)
ax8.xaxis.set_minor_locator(minorLocator2)
ax9.yaxis.set_minor_locator(minorLocator1)
ax9.xaxis.set_minor_locator(minorLocator2)
fig.subplots_adjust(wspace = 0, hspace = 0)
ax4.set_ylabel('Porosity (%)')
ax8.set_xlabel('Solid loading (vol.%)')
w = ax3.set_ylabel('Water')
c = ax6.set_ylabel('Camphene')
t = ax9.set_ylabel('TBA')
w.set_rotation(-90)
c.set_rotation(-90)
t.set_rotation(-90)
ax1.set_axis_bgcolor('aliceblue')
ax2.set_axis_bgcolor('aliceblue')
ax3.set_axis_bgcolor('aliceblue')
ax4.set_axis_bgcolor('mistyrose')
ax5.set_axis_bgcolor('mistyrose')
ax6.set_axis_bgcolor('mistyrose')
ax7.set_axis_bgcolor('honeydew')
ax8.set_axis_bgcolor('honeydew')
ax9.set_axis_bgcolor('honeydew')
ax1.set_title("Ceramic")
ax2.set_title("Metal")
ax3.set_title("Polymer")
printPapers(porosityCera_water, 'fig')
printPapers(porosityMetal_water, 'fig')
printPapers(porosityPoly_water, 'fig')
printPapers(porosityCera_camphene, 'fig')
printPapers(porosityMetal_camphene, 'fig')
printPapers(porosityPoly_camphene, 'fig')
printPapers(porosityCera_TBA, 'fig')
printPapers(porosityMetal_TBA, 'fig')
printPapers(porosityPoly_TBA, 'fig')
plt.savefig('FILEPATH/porosity_groups.png')
Number of papers ( fig ): 139
Number of papers ( fig ): 10
Number of papers ( fig ): 6
Number of papers ( fig ): 37
Number of papers ( fig ): 8
Number of papers ( fig ): 0
Number of papers ( fig ): 36
Number of papers ( fig ): 0
Number of papers ( fig ): 1
time: 4.05 s
In [89]:
Al2O3_porosity = porosity[(porosity['materialID']) == 1]
x = Al2O3_porosity['total_VF']*100
y = Al2O3_porosity['porosity']*100
minorLocator1 = AutoMinorLocator()
minorLocator2 = AutoMinorLocator()
# Calculate the point density
xy = np.vstack([x,y])
z = gaussian_kde(xy)(xy)
fig, ax = plt.subplots(figsize = (5,6))
ax.scatter(x, y, c=z, s=25, edgecolor='')
ax.set(xlim = [0, 60])
ax.set(ylim = [0, 100])
ax.yaxis.set_minor_locator(minorLocator1)
ax.xaxis.set_minor_locator(minorLocator2)
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
ax.set_ylabel('Porosity (%)', fontsize = 20)
ax.set_xlabel('Solid loading (vol.% Al2O3)', fontsize = 20)
printPapers(Al2O3_porosity, 'fig')
plt.savefig('FILEPATH/Al2O3porosity_solid_densityplot.png')
Number of papers ( fig ): 47
time: 727 ms
In [90]:
pore = data[(data['pore']) > 0]
pore = pore[(pore['total_VF']) > 0]
wall = data[(data['wall']) > 0]
wall = wall[(wall['total_VF']) > 0]
pore_water = pore[(pore['fluid1_ID']) == 1]
pore_camphene = pore[(pore['fluid1_ID']) == 2]
pore_tba = pore[(pore['fluid1_ID']) == 3]
wall_water = wall[(wall['fluid1_ID']) == 1]
wall_camphene = wall[(wall['fluid1_ID']) == 2]
wall_tba = wall[(wall['fluid1_ID']) == 3]
fig = plt.figure(figsize = (10,12))
minorLocator = AutoMinorLocator()
ax1 = fig.add_subplot(3, 2, 1)
ax4 = fig.add_subplot(3, 2, 2)
ax2 = fig.add_subplot(3, 2, 3)
ax5 = fig.add_subplot(3, 2, 4)
ax3 = fig.add_subplot(3, 2, 5)
ax6 = fig.add_subplot(3, 2, 6)
x1 = pore_water['total_VF']*100
x2 = pore_camphene['total_VF']*100
x3 = pore_tba['total_VF']*100
y1 = pore_water['pore']
y2 = pore_camphene['pore']
y3 = pore_tba['pore']
x4 = wall_water['total_VF']*100
x5 = wall_camphene['total_VF']*100
x6 = wall_tba['total_VF']*100
y4 = wall_water['wall']
y5 = wall_camphene['wall']
y6 = wall_tba['wall']
ax1.scatter(x1, y1, color = 'blue', s = 10)
ax2.scatter(x2, y2, color = 'red', s = 10)
ax3.scatter(x3, y3, color = 'green', s = 10)
ax4.scatter(x4, y4, color = 'blue', s = 10)
ax5.scatter(x5, y5, color = 'red', s = 10)
ax6.scatter(x6, y6, color = 'green', s = 10)
ax1.set_yscale('log')
ax2.set_yscale('log')
ax3.set_yscale('log')
ax4.set_yscale('log')
ax5.set_yscale('log')
ax6.set_yscale('log')
ax1.set(xlim = [0, 50])
ax1.set(ylim = [0.1, 1000])
ax2.set(xlim = [0, 50])
ax2.set(ylim = [0.1, 1000])
ax3.set(xlim = [0, 50])
ax3.set(ylim = [0.1, 1000])
ax4.set(xlim = [0, 50])
ax4.set(ylim = [0.1, 1000])
ax5.set(xlim = [0, 50])
ax5.set(ylim = [0.1, 1000])
ax6.set(xlim = [0, 50])
ax6.set(ylim = [0.1, 1000])
ax1.yaxis.set_ticks_position('left')
ax2.yaxis.set_ticks_position('left')
ax3.yaxis.set_ticks_position('left')
ax1.xaxis.set_ticks_position('none')
ax2.xaxis.set_ticks_position('none')
ax4.yaxis.set_ticks_position('left')
ax5.yaxis.set_ticks_position('left')
ax6.yaxis.set_ticks_position('left')
ax4.xaxis.set_ticks_position('none')
ax5.xaxis.set_ticks_position('none')
ax3.xaxis.set_ticks_position('bottom')
ax6.xaxis.set_ticks_position('bottom')
ax3.xaxis.set_minor_locator(minorLocator)
ax6.xaxis.set_minor_locator(minorLocator)
ax2.set_ylabel('Pore width (${\mu}$m)')
ax5.set_ylabel('Wall width (${\mu}$m)')
ax3.set_xlabel('Solid loading (vol.%)')
ax6.set_xlabel('Solid loading (vol.%)')
ax1.set_xticklabels([])
ax2.set_xticklabels([])
ax4.set_xticklabels([])
ax5.set_xticklabels([])
ax3.xaxis.set_ticks(np.arange(10, 50, 10))
ax6.xaxis.set_ticks(np.arange(10, 50, 10))
fig.subplots_adjust(wspace = 0.4, hspace = 0)
ax1.yaxis.set_major_locator(ticker.LogLocator(base = 100.0))
ax2.yaxis.set_major_locator(ticker.LogLocator(base = 100.0))
ax3.yaxis.set_major_locator(ticker.LogLocator(base = 10.0))
ax4.yaxis.set_major_locator(ticker.LogLocator(base = 100.0))
ax5.yaxis.set_major_locator(ticker.LogLocator(base = 100.0))
ax6.yaxis.set_major_locator(ticker.LogLocator(base = 10.0))
printPapers(pore_water, 'fig_porewater')
printPapers(pore_camphene, 'fig_porecamphene')
printPapers(pore_tba, 'fig_poretba')
printPapers(wall_water, 'fig_wallwater')
printPapers(wall_camphene, 'fig_wallcamphene')
printPapers(wall_tba, 'fig_walltba')
plt.savefig('FILEPATH/walls_pores_fluids.png')
Number of papers ( fig_porewater ): 111
Number of papers ( fig_porecamphene ): 27
Number of papers ( fig_poretba ): 23
Number of papers ( fig_wallwater ): 34
Number of papers ( fig_wallcamphene ): 5
Number of papers ( fig_walltba ): 6
time: 3.73 s

Solidification

In [92]:
TConstant = data[(data['T_constant']) > 0]
TConstant = TConstant[(TConstant['fluid1_ID']) == 1]
TConstant_spacing = TConstant[(TConstant['spacing']) > 0]
TConstant_pore = TConstant[(TConstant['pore']) > 0]
TConstant_wall = TConstant[(TConstant['wall']) > 0]

fig = plt.figure(figsize = (7,10))
ax1 = fig.add_subplot(3, 1, 1)
ax2 = fig.add_subplot(3, 1, 2)
ax3 = fig.add_subplot(3, 1, 3)

x1 = TConstant_spacing['T_constant']
x2 = TConstant_pore['T_constant']
x3 = TConstant_wall['T_constant']
y1 = TConstant_spacing['spacing']
y2 = TConstant_pore['pore']
y3 = TConstant_wall['wall']



minorLocator = AutoMinorLocator()

ax1.set(xlim = [50, 275])
ax2.set(xlim = [50, 275])
ax3.set(xlim = [50, 275])
ax1.set(ylim = [1, 1000])
ax2.set(ylim = [1, 1000])
ax3.set(ylim = [1, 1000])
ax1.xaxis.set_minor_locator(minorLocator)

ax3.set_xlabel('Constant substrate temperature (K)', fontsize = 16)
ax1.set_ylabel('Primary spacing (${\mu}$m)', fontsize = 16)
ax2.set_ylabel('Pore width (${\mu}$m)', fontsize = 16)
ax3.set_ylabel('Wall width (${\mu}$m)', fontsize = 16)

ax1.scatter(x1, y1, color = 'blue', s = 30, edgecolor = 'black')
ax3.scatter(x3, y3, color = 'blue', s = 30, edgecolor = 'black')
ax2.scatter(x2, y2, color = 'blue', s = 30, edgecolor = 'black')

ax1.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')
ax2.xaxis.set_ticks_position('bottom')
ax2.yaxis.set_ticks_position('left')
ax3.xaxis.set_ticks_position('bottom')
ax3.yaxis.set_ticks_position('left')
ax1.set_yscale('log')
ax2.set_yscale('log')
ax3.set_yscale('log')

plt.tight_layout()


printPapers(TConstant_spacing, 'fig')
printPapers(TConstant_pore, 'fig')
printPapers(TConstant_wall, 'fig')
plt.savefig('FILEPATH/coldconstant.png')
Number of papers ( fig ): 11
Number of papers ( fig ): 61
Number of papers ( fig ): 14
time: 2.44 s

Mechanical properties

In [93]:
compressPorosity = data[(data['porosity']) > 0]
compressPorosity = compressPorosity[(compressPorosity['norm_compress']) > 0]
compressPorosity_water = compressPorosity[(compressPorosity['fluid1_ID']) == 1]
compressPorosity_camphene = compressPorosity[(compressPorosity['fluid1_ID']) == 2]
compressPorosity_tba = compressPorosity[(compressPorosity['fluid1_ID']) == 3]

x1 = compressPorosity_water['porosity']*100
x2 = compressPorosity_camphene['porosity']*100
x3 = compressPorosity_tba['porosity']*100

y1 = compressPorosity_water['norm_compress']
y2 = compressPorosity_camphene['norm_compress']
y3 = compressPorosity_tba['norm_compress']

fig = plt.figure(figsize = (7,7))
ax1 = fig.add_subplot(1, 1, 1)
ax2 = fig.add_subplot(1, 1, 1)
ax3 = fig.add_subplot(1, 1, 1)
minorLocator = AutoMinorLocator()

ax1.set(xlim = [1, 100])
ax1.set(ylim = [0.00001, 1])
ax1.xaxis.set_minor_locator(minorLocator)

ax1.set_ylabel('Normalized compressive strength', fontsize = 20)
ax1.set_xlabel('Porosity (%)', fontsize = 20)

ax1.set_yscale('log')

ax1.scatter(x1, y1, color = 'blue', s = 40, edgecolor = 'black')
ax3.scatter(x3, y3, color = 'green', s = 40, edgecolor = 'black')
ax2.scatter(x2, y2, color = 'red', s = 40, edgecolor = 'black')

ax1.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')

printPapers(compressPorosity_water, 'fig')
printPapers(compressPorosity_camphene, 'fig')
printPapers(compressPorosity_tba, 'fig')
plt.savefig('FILEPATH/porosityCompress.png')
Number of papers ( fig ): 69
Number of papers ( fig ): 27
Number of papers ( fig ): 17
time: 1.65 s
In [94]:
x1 = compressPorosity_water['porosity']*100
x2 = compressPorosity_camphene['porosity']*100
x3 = compressPorosity_tba['porosity']*100

y1 = compressPorosity_water['norm_compress']
y2 = compressPorosity_camphene['norm_compress']
y3 = compressPorosity_tba['norm_compress']

fig = plt.figure(figsize = (12,7))
ax1 = fig.add_subplot(1, 3, 1)
ax2 = fig.add_subplot(1, 3, 2)
ax3 = fig.add_subplot(1, 3, 3)
minorLocator = AutoMinorLocator()

ax1.set(xlim = [1, 100])
ax1.set(ylim = [0.00001, 1])
ax1.xaxis.set_minor_locator(minorLocator)
ax2.set(xlim = [1, 100])
ax2.set(ylim = [0.00001, 1])
ax2.xaxis.set_minor_locator(minorLocator)
ax3.set(xlim = [1, 100])
ax3.set(ylim = [0.00001, 1])
ax3.xaxis.set_minor_locator(minorLocator)

ax1.set_ylabel('Normalized compressive strength', fontsize = 20)
ax2.set_xlabel('Porosity (%)', fontsize = 20)

ax1.set_yscale('log')
ax2.set_yscale('log')
ax3.set_yscale('log')

ax1.scatter(x1, y1, color = 'blue', s = 40, edgecolor = 'black')
ax3.scatter(x3, y3, color = 'green', s = 40, edgecolor = 'black')
ax2.scatter(x2, y2, color = 'red', s = 40, edgecolor = 'black')

ax1.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')
fig.subplots_adjust(wspace = 0, hspace = 0)
ax2.set_yticklabels([])
ax3.set_yticklabels([])


ax1.xaxis.set_ticks(np.arange(20, 100, 20))
ax2.xaxis.set_ticks(np.arange(20, 100, 20))
ax3.xaxis.set_ticks(np.arange(20, 100, 20))
printPapers(compressPorosity_water, 'fig')
printPapers(compressPorosity_camphene, 'fig')
printPapers(compressPorosity_tba, 'fig')
plt.savefig('FILEPATH')
Number of papers ( fig ): 69
Number of papers ( fig ): 27
Number of papers ( fig ): 17
time: 2.79 s
In [95]:
compressPore = data[(data['pore']) > 0]
compressPore = compressPore[(compressPore['norm_compress']) > 0]
compressPore_water = compressPore[(compressPore['fluid1_ID']) == 1]
compressPore_camphene = compressPore[(compressPore['fluid1_ID']) == 2]
compressPore_water_tba = compressPore[(compressPore['fluid1_ID']) == 3]

x1 = compressPore_water['pore']
x2 = compressPore_camphene['pore']
x3 = compressPore_water_tba['pore']

y1 = compressPore_water['norm_compress']
y2 = compressPore_camphene['norm_compress']
y3 = compressPore_water_tba['norm_compress']

fig = plt.figure(figsize = (7,7))
ax1 = fig.add_subplot(1, 1, 1)
ax2 = fig.add_subplot(1, 1, 1)
ax3 = fig.add_subplot(1, 1, 1)
#minorLocator = AutoMinorLocator()

ax1.set(xlim = [0.1, 1000])
ax1.set(ylim = [0.00001, 1])
ax1.xaxis.set_minor_locator(minorLocator)

ax1.set_ylabel('Normalized compressive strength', fontsize = 20)
ax1.set_xlabel('Pore size (${\mu}$m)', fontsize = 20)

ax1.set_yscale('log')
ax1.set_xscale('log')

ax1.scatter(x1, y1, color = 'blue', s = 40, edgecolor = 'black')
ax3.scatter(x3, y3, color = 'green', s = 40, edgecolor = 'black')
ax2.scatter(x2, y2, color = 'red', s = 40, edgecolor = 'black')

ax1.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')

printPapers(compressPore_water, 'fig')
printPapers(compressPore_camphene, 'fig')
printPapers(compressPore_water_tba, 'fig')
plt.savefig('FILEPATH')
Number of papers ( fig ): 32
Number of papers ( fig ): 16
Number of papers ( fig ): 8
time: 1.63 s
In [96]:
compressWall = data[(data['wall']) > 0]
compressWall = compressWall[(compressWall['norm_compress']) > 0]
compressWall_water = compressWall[(compressWall['fluid1_ID']) == 1]
compressWall_camphene = compressWall[(compressWall['fluid1_ID']) == 2]
compressWall_water_tba = compressWall[(compressWall['fluid1_ID']) == 3]

x1 = compressWall_water['wall']
x2 = compressWall_camphene['wall']
x3 = compressWall_water_tba['wall']

y1 = compressWall_water['norm_compress']
y2 = compressWall_camphene['norm_compress']
y3 = compressWall_water_tba['norm_compress']

fig = plt.figure(figsize = (7,7))
ax1 = fig.add_subplot(1, 1, 1)
ax2 = fig.add_subplot(1, 1, 1)
ax3 = fig.add_subplot(1, 1, 1)
#minorLocator = AutoMinorLocator()

ax1.set(xlim = [1, 400])
ax1.set(ylim = [0.00001, 1])
ax1.xaxis.set_minor_locator(minorLocator)

ax1.set_ylabel('Normalized compressive strength', fontsize = 20)
ax1.set_xlabel('Wall width (${\mu}$m)', fontsize = 20)

ax1.set_yscale('log')
ax1.set_xscale('log')

ax1.scatter(x1, y1, color = 'blue', s = 40, edgecolor = 'black')
ax3.scatter(x3, y3, color = 'green', s = 40, edgecolor = 'black')
ax2.scatter(x2, y2, color = 'red', s = 40, edgecolor = 'black')

ax1.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')

printPapers(compressWall_water, 'fig')
printPapers(compressWall_camphene, 'fig')
printPapers(compressWall_water_tba, 'fig')
plt.savefig('FILEPATH')
Number of papers ( fig ): 14
Number of papers ( fig ): 3
Number of papers ( fig ): 1
time: 1.45 s
In [97]:
compressShrink = data[(data['norm_compress']) > 0]
compressShrink_dia = compressShrink[(compressShrink['shrinkage_diameter']) > 0]
compressShrink_vol = compressShrink[(compressShrink['shrinkage_volumetric']) > 0]
compressShrink_lin = compressShrink[(compressShrink['shrinkage_linear']) > 0]

x1 = compressShrink_dia['shrinkage_diameter']*100
x2 = compressShrink_vol['shrinkage_volumetric']*100
x3 = compressShrink_lin['shrinkage_linear']*100
y1 = compressShrink_dia['norm_compress']
y2 = compressShrink_vol['norm_compress']
y3 = compressShrink_lin['norm_compress']


fig = plt.figure(figsize = (12,7))
ax1 = fig.add_subplot(1, 3, 2)
ax2 = fig.add_subplot(1, 3, 3)
ax3 = fig.add_subplot(1, 3, 1)
minorLocator = AutoMinorLocator()

ax1.set(xlim = [1, 100])
ax2.set(xlim = [1, 100])
ax3.set(xlim = [1, 100])
ax1.set(ylim = [0.00001, 1])
ax2.set(ylim = [0.00001, 1])
ax3.set(ylim = [0.00001, 1])
ax1.xaxis.set_minor_locator(minorLocator)

ax1.set_xlabel('Shrinkage (%diameter)', fontsize = 16)
ax2.set_xlabel('Volumetric shrinkage (%)', fontsize = 16)
ax3.set_xlabel('Linear shrinkage (%)', fontsize = 16)
ax3.set_ylabel('Normalized compressive strength', fontsize = 20)

ax1.set_yscale('log')
ax2.set_yscale('log')
ax3.set_yscale('log')
ax1.set_xscale('log')
ax2.set_xscale('log')
ax3.set_xscale('log')
ax1.scatter(x1, y1, color = 'blue', s = 40, edgecolor = 'black')
ax3.scatter(x3, y3, color = 'blue', s = 40, edgecolor = 'black')
ax2.scatter(x2, y2, color = 'blue', s = 40, edgecolor = 'black')

ax1.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')
ax2.xaxis.set_ticks_position('bottom')
ax2.yaxis.set_ticks_position('left')
ax3.xaxis.set_ticks_position('bottom')
ax3.yaxis.set_ticks_position('left')
fig.subplots_adjust(wspace = 0, hspace = 0)
ax1.set_yticklabels([])
ax2.set_yticklabels([])
#ax1.xaxis.set_ticks(np.arange(20, 100, 20))
#ax2.xaxis.set_ticks(np.arange(20, 100, 20))
#ax3.xaxis.set_ticks(np.arange(20, 100, 20))

printPapers(compressShrink_dia, 'fig')
printPapers(compressShrink_vol, 'fig')
printPapers(compressShrink_lin, 'fig')
plt.savefig('FILEPATH')
Number of papers ( fig ): 4
Number of papers ( fig ): 1
Number of papers ( fig ): 22
time: 2.24 s
In [98]:
flexuralPorosity = data[(data['porosity']) > 0]
flexuralPorosity = flexuralPorosity[(flexuralPorosity['norm_flexural']) > 0]
flexuralPorosity_water = flexuralPorosity[(flexuralPorosity['fluid1_ID']) == 1]
flexuralPorosity_camphene = flexuralPorosity[(flexuralPorosity['fluid1_ID']) == 2]
flexuralPorosity_tba = flexuralPorosity[(flexuralPorosity['fluid1_ID']) == 3]

x1 = flexuralPorosity_water['porosity']*100
x2 = flexuralPorosity_camphene['porosity']*100
x3 = flexuralPorosity_tba['porosity']*100

y1 = flexuralPorosity_water['norm_flexural']
y2 = flexuralPorosity_camphene['norm_flexural']
y3 = flexuralPorosity_tba['norm_flexural']

fig = plt.figure(figsize = (7,7))
ax1 = fig.add_subplot(1, 1, 1)
ax2 = fig.add_subplot(1, 1, 1)
ax3 = fig.add_subplot(1, 1, 1)
minorLocator = AutoMinorLocator()

ax1.set(xlim = [1, 100])
ax1.set(ylim = [0.001, 1])
ax1.xaxis.set_minor_locator(minorLocator)

ax1.set_ylabel('Normalized flexural strength', fontsize = 20)
ax1.set_xlabel('Porosity (%)', fontsize = 20)

ax1.set_yscale('log')

ax1.scatter(x1, y1, color = 'blue', s = 40, edgecolor = 'black')
ax3.scatter(x3, y3, color = 'green', s = 40, edgecolor = 'black')
ax2.scatter(x2, y2, color = 'red', s = 40, edgecolor = 'black')

ax1.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')

printPapers(flexuralPorosity_water, 'fig')
printPapers(flexuralPorosity_camphene, 'fig')
printPapers(flexuralPorosity_tba, 'fig')
Number of papers ( fig ): 6
Number of papers ( fig ): 2
Number of papers ( fig ): 2
time: 1.1 s
In [99]:
youngsPorosity = data[(data['porosity']) > 0]
youngsPorosity = youngsPorosity[(youngsPorosity['norm_youngs']) > 0]
youngsPorosity_water = youngsPorosity[(youngsPorosity['fluid1_ID']) == 1]
youngsPorosity_camphene = youngsPorosity[(youngsPorosity['fluid1_ID']) == 2]
youngsPorosity_tba = youngsPorosity[(youngsPorosity['fluid1_ID']) == 3]

x1 = youngsPorosity_water['porosity']*100
x2 = youngsPorosity_camphene['porosity']*100
x3 = youngsPorosity_tba['porosity']*100

y1 = youngsPorosity_water['norm_youngs']
y2 = youngsPorosity_camphene['norm_youngs']
y3 = youngsPorosity_tba['norm_youngs']

fig = plt.figure(figsize = (7,7))
ax1 = fig.add_subplot(1, 1, 1)
ax2 = fig.add_subplot(1, 1, 1)
ax3 = fig.add_subplot(1, 1, 1)
minorLocator = AutoMinorLocator()

ax1.set(xlim = [1, 100])
ax1.set(ylim = [0.00001, 1])
ax1.xaxis.set_minor_locator(minorLocator)

ax1.set_ylabel("Normalized Young's modulus", fontsize = 20)
ax1.set_xlabel('Porosity (%)', fontsize = 20)

ax1.set_yscale('log')

ax1.scatter(x1, y1, color = 'blue', s = 40, edgecolor = 'black')
ax3.scatter(x3, y3, color = 'green', s = 40, edgecolor = 'black')
ax2.scatter(x2, y2, color = 'red', s = 40, edgecolor = 'black')

ax1.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')

printPapers(youngsPorosity_water, 'fig')
printPapers(youngsPorosity_camphene, 'fig')
printPapers(youngsPorosity_tba, 'fig')
Number of papers ( fig ): 10
Number of papers ( fig ): 4
Number of papers ( fig ): 0
time: 1.16 s

Correlation matrices

In [100]:
print(list(data.columns.values))
['paperID', 'authorID', 'authors', 'title', 'journal', 'volume', 'issue', 'pages', 'year', 'doi', 'material', 'material_group', 'name', 'affiliation', 'city', 'country', 'long', 'lat', 'email', 'sampleID', 'materialID', 'props_material', 'bulk_material_density', 'bulk_material_compress', 'bulk_material_youngs', 'bulk_material_flexion', 'total_VF', 'total_particles', 'total_fluids', 'composite', 'ballTime', 'pH', 'viscosity_100', 'zeta', 'fluid1_ID', 'fluid1', 'fluid1_densityLiq', 'fluid1_densitySol', 'fluid1_thermal_condLiq', 'fluid1_thermal_condSolid', 'fluid1_vf', 'fluid2_ID', 'fluid2', 'fluid2_densityLiq', 'fluid2_densitySol', 'fluid2_thermal_condLiq', 'fluid2_thermal_condSolid', 'fluid2_vf', 'particle1ID', 'particle1', 'particle1_density', 'particle1_thermal_cond', 'particle1_shape', 'particle1_diameter', 'particle1_length', 'particle1_vf', 'particle2ID', 'particle2', 'particle2_density', 'particle2_thermal_cond', 'particle2_shape', 'particle2_diameter', 'particle2_length', 'particle2_vf', 'particle3ID', 'particle3', 'particle3_density', 'particle3_thermal_cond', 'particle3_shape', 'particle3_diameter', 'particle3_length', 'particle3_vf', 'dispersant1ID', 'dispersant1', 'dispersant1_density', 'dispersant1MW', 'dispersant1_wf', 'dispersant2ID', 'dispersant2', 'dispersant2_density', 'dispersant2MW', 'dispersant2_wf', 'binder1ID', 'binder1', 'binder1_density', 'binder1_MW', 'binder1_wf', 'binder2ID', 'binder2', 'binder2_density', 'binder2_MW', 'binder2_wf', 'cryoprotectantID', 'cryoprotectant', 'cryoprotectant_density', 'cryoprotectant_MW', 'cryoprotectant_wf', 'surfactantID_x', 'surfactant', 'surfactant_density', 'surfactant_MW', 'surfactant_wf', 'add_phID', 'add_ph', 'add_ph_density', 'add_ph_MW', 'add_ph_wf', 'surfactantID_y', 'initiator', 'initiator_density', 'initiator_MW', 'initiator_wf', 'crosslinkerID', 'crosslinker', 'crosslinker_density', 'crosslinker_wf', 'crosslinker_wf', 'monomerID', 'monomer', 'monomer_density', 'monomer_WF', 'monomer_wf', 'catalystID', 'catalyst', 'catalyst_density', 'catalyst_wf', 'catalyst_wf', 'shearRate', 'viscosity', 'technique', 'direction', 'gravity', 'refrigerant', 'cooling_rate', 'T_Cold', 'T_Hot', 'T_constant', 'gradient', 'velocity', 'T_nuceation', 'sublimated', 'sublimation_time', 'moldID', 'mold_material', 'mold_thermal_cond', 'mold_shape', 'mold_dia', 'mold_height', 'mold_l', 'mold_w', 'mold_wall', 'fill_height', 'sinter1_time', 'sinter1_temp', 'sinter1_rampC', 'sinter1_rampH', 'sinter2_time', 'sinter2_temp', 'sinter2_rampC', 'sinter2_rampH', 'sinter3_time', 'sinter3_temp', 'sinter3_rampC', 'sinter3_rampH', 'shrinkage_volumetric', 'shrinkage_diameter', 'shrinkage_linear', 'pore_structure', 'porosity', 'spacing', 'pore', 'wall', 'aspectPore', 'aspectWall', 'surfaceArea', 'mech_shape', 'mech_height', 'mech_dia', 'mech_length', 'mech_width', 'mech_ratio', 'mech_volume', 'compression', 'flexural', 'youngs', 'strainRate', 'crossheadspeed', 'compositeType', 'impregnate_material', 'norm_compress', 'norm_flexural', 'norm_youngs']
time: 1e+03 µs

Using the column values above as a reminder, pick the variables you'd like to run a correlation matrix with. Replace the column values below with your values, and run the cell below to create the corresponding correlation matrix.

In [101]:
X = (data[['materialID', 'material_group', 'total_VF', 'composite', 
           'ballTime', 'fluid1_ID', 'particle1ID', 'particle1_diameter',
           'particle1_density', 'particle1_thermal_cond', 
           'dispersant1_wf', 'binder1_wf', 'cooling_rate',
          'T_Cold', 'T_constant', 'velocity', 
          'mold_shape', 'mold_dia', 'mold_height',
           'shrinkage_volumetric', 'shrinkage_diameter',
           'shrinkage_linear',
          'porosity', 'spacing', 'pore', 'wall', 'compositeType', 
           'norm_compress', 'norm_flexural', 'norm_youngs']].copy())
time: 5 ms
In [102]:
print(X.corr())
                      materialID  total_VF  ballTime  fluid1_ID  particle1ID  \
materialID              1.000000 -0.390734 -0.233845   0.130464     0.878439   
total_VF               -0.390734  1.000000  0.141338  -0.096202    -0.300087   
ballTime               -0.233845  0.141338  1.000000  -0.096403    -0.199890   
fluid1_ID               0.130464 -0.096202 -0.096403   1.000000     0.173519   
particle1ID             0.878439 -0.300087 -0.199890   0.173519     1.000000   
particle1_diameter      0.031891 -0.001637 -0.017660  -0.017850     0.035172   
particle1_density      -0.304772  0.261846  0.129022  -0.012153    -0.122849   
dispersant1_wf         -0.009067  0.023004 -0.031350  -0.004596    -0.002564   
binder1_wf              0.443053 -0.411994 -0.268022  -0.115346     0.228210   
cooling_rate            0.178814 -0.152158 -0.025487  -0.107868     0.092509   
T_Cold                 -0.429298  0.284607  0.183294  -0.071334    -0.218531   
T_constant             -0.496623  0.296373  0.188431  -0.066053    -0.245593   
velocity                0.208802 -0.039631 -0.128370   0.030319     0.356724   
mold_dia                0.176475 -0.037337 -0.008004   0.094064     0.128579   
mold_height            -0.003005  0.017984 -0.006215   0.031738    -0.022280   
shrinkage_volumetric    0.005568  0.321478       NaN        NaN     0.470741   
shrinkage_diameter     -0.261084  0.098830 -0.101574        NaN    -0.001268   
shrinkage_linear       -0.031478 -0.043732  0.140198  -0.165811     0.110280   
porosity                0.219109 -0.520692 -0.148334   0.040568     0.141417   
spacing                -0.107475  0.134401  0.010379  -0.101830    -0.103473   
pore                    0.084431 -0.108989  0.014432  -0.055886     0.030246   
wall                    0.005141  0.446797 -0.147788  -0.016881     0.047091   
norm_compress           0.137269  0.176166 -0.043297  -0.037288     0.067891   
norm_flexural          -0.168980 -0.290684 -0.052006  -0.105188    -0.125616   
norm_youngs            -0.110275  0.019764 -0.036464   0.555887    -0.103154   

                      particle1_diameter  particle1_density  dispersant1_wf  \
materialID                      0.031891          -0.304772       -0.009067   
total_VF                       -0.001637           0.261846        0.023004   
ballTime                       -0.017660           0.129022       -0.031350   
fluid1_ID                      -0.017850          -0.012153       -0.004596   
particle1ID                     0.035172          -0.122849       -0.002564   
particle1_diameter              1.000000          -0.046361       -0.024417   
particle1_density              -0.046361           1.000000       -0.016023   
dispersant1_wf                 -0.024417          -0.016023        1.000000   
binder1_wf                      0.067989          -0.476142        0.210577   
cooling_rate                   -0.029623          -0.074796       -0.019497   
T_Cold                         -0.005401           0.298553       -0.025547   
T_constant                     -0.003825           0.304831       -0.044410   
velocity                        0.006984           0.218263        0.216822   
mold_dia                        0.118937           0.079534       -0.018844   
mold_height                    -0.028808          -0.054458        0.197283   
shrinkage_volumetric            0.701466           0.675782       -0.819820   
shrinkage_diameter             -0.021352           0.659147        0.268139   
shrinkage_linear               -0.036337           0.353605        0.296909   
porosity                       -0.008817          -0.212608       -0.045606   
spacing                        -0.016817           0.091352       -0.149046   
pore                           -0.032363          -0.128266       -0.090011   
wall                            0.015787           0.083850        0.308362   
norm_compress                   0.209484          -0.014733       -0.074573   
norm_flexural                  -0.117300          -0.246687        0.050021   
norm_youngs                     0.021857          -0.409682       -0.091648   

                      binder1_wf  cooling_rate    T_Cold  T_constant  \
materialID              0.443053      0.178814 -0.429298   -0.496623   
total_VF               -0.411994     -0.152158  0.284607    0.296373   
ballTime               -0.268022     -0.025487  0.183294    0.188431   
fluid1_ID              -0.115346     -0.107868 -0.071334   -0.066053   
particle1ID             0.228210      0.092509 -0.218531   -0.245593   
particle1_diameter      0.067989     -0.029623 -0.005401   -0.003825   
particle1_density      -0.476142     -0.074796  0.298553    0.304831   
dispersant1_wf          0.210577     -0.019497 -0.025547   -0.044410   
binder1_wf              1.000000      0.241040 -0.498055   -0.491625   
cooling_rate            0.241040      1.000000  0.024231   -0.013630   
T_Cold                 -0.498055      0.024231  1.000000    1.000000   
T_constant             -0.491625     -0.013630  1.000000    1.000000   
velocity               -0.034292     -0.040153 -0.058400   -0.048304   
mold_dia               -0.143447      0.028368  0.119749    0.082986   
mold_height             0.330478     -0.037644 -0.109352   -0.102855   
shrinkage_volumetric    0.042436      0.220579  0.386051    0.371160   
shrinkage_diameter      0.158201      0.171088  0.615134    0.615134   
shrinkage_linear        0.325986      0.126623  0.145531    0.153123   
porosity                0.096235      0.087945 -0.161594   -0.170626   
spacing                 0.076851     -0.164419  0.198174    0.229860   
pore                    0.073904     -0.106584  0.103127    0.093315   
wall                    0.055292     -0.206020  0.232865    0.246020   
norm_compress          -0.156803      0.071465  0.098525    0.098761   
norm_flexural          -0.526390      0.004037  0.176303    0.176303   
norm_youngs            -0.203287     -0.346060  0.868939   -0.986735   

                      velocity  mold_dia  mold_height  shrinkage_volumetric  \
materialID            0.208802  0.176475    -0.003005              0.005568   
total_VF             -0.039631 -0.037337     0.017984              0.321478   
ballTime             -0.128370 -0.008004    -0.006215                   NaN   
fluid1_ID             0.030319  0.094064     0.031738                   NaN   
particle1ID           0.356724  0.128579    -0.022280              0.470741   
particle1_diameter    0.006984  0.118937    -0.028808              0.701466   
particle1_density     0.218263  0.079534    -0.054458              0.675782   
dispersant1_wf        0.216822 -0.018844     0.197283             -0.819820   
binder1_wf           -0.034292 -0.143447     0.330478              0.042436   
cooling_rate         -0.040153  0.028368    -0.037644              0.220579   
T_Cold               -0.058400  0.119749    -0.109352              0.386051   
T_constant           -0.048304  0.082986    -0.102855              0.371160   
velocity              1.000000 -0.047899    -0.071494                   NaN   
mold_dia             -0.047899  1.000000     0.279640             -0.256481   
mold_height          -0.071494  0.279640     1.000000                   NaN   
shrinkage_volumetric       NaN -0.256481          NaN              1.000000   
shrinkage_diameter         NaN  0.612908     0.982264                   NaN   
shrinkage_linear      0.263434 -0.032221    -0.591404              0.018716   
porosity              0.003472 -0.005288    -0.043395             -0.679590   
spacing              -0.328584 -0.007729     0.154457                   NaN   
pore                 -0.126493 -0.053752    -0.109893              0.341582   
wall                 -0.312863 -0.079594    -0.011628                   NaN   
norm_compress        -0.001618  0.090455    -0.016612             -0.961282   
norm_flexural              NaN -0.779977     0.035236                   NaN   
norm_youngs          -0.047485 -0.546355    -0.751484              0.881380   

                      shrinkage_diameter  shrinkage_linear  porosity  \
materialID                     -0.261084         -0.031478  0.219109   
total_VF                        0.098830         -0.043732 -0.520692   
ballTime                       -0.101574          0.140198 -0.148334   
fluid1_ID                            NaN         -0.165811  0.040568   
particle1ID                    -0.001268          0.110280  0.141417   
particle1_diameter             -0.021352         -0.036337 -0.008817   
particle1_density               0.659147          0.353605 -0.212608   
dispersant1_wf                  0.268139          0.296909 -0.045606   
binder1_wf                      0.158201          0.325986  0.096235   
cooling_rate                    0.171088          0.126623  0.087945   
T_Cold                          0.615134          0.145531 -0.161594   
T_constant                      0.615134          0.153123 -0.170626   
velocity                             NaN          0.263434  0.003472   
mold_dia                        0.612908         -0.032221 -0.005288   
mold_height                     0.982264         -0.591404 -0.043395   
shrinkage_volumetric                 NaN          0.018716 -0.679590   
shrinkage_diameter              1.000000          0.701857  0.092316   
shrinkage_linear                0.701857          1.000000 -0.219325   
porosity                        0.092316         -0.219325  1.000000   
spacing                         0.364946         -0.330496 -0.076042   
pore                           -0.193729         -0.272067  0.274823   
wall                            0.396438         -0.649657 -0.249562   
norm_compress                   0.792868          0.354448 -0.301261   
norm_flexural                        NaN         -0.152162  0.062396   
norm_youngs                          NaN          0.812250 -0.502857   

                       spacing      pore      wall  norm_compress  \
materialID           -0.107475  0.084431  0.005141       0.137269   
total_VF              0.134401 -0.108989  0.446797       0.176166   
ballTime              0.010379  0.014432 -0.147788      -0.043297   
fluid1_ID            -0.101830 -0.055886 -0.016881      -0.037288   
particle1ID          -0.103473  0.030246  0.047091       0.067891   
particle1_diameter   -0.016817 -0.032363  0.015787       0.209484   
particle1_density     0.091352 -0.128266  0.083850      -0.014733   
dispersant1_wf       -0.149046 -0.090011  0.308362      -0.074573   
binder1_wf            0.076851  0.073904  0.055292      -0.156803   
cooling_rate         -0.164419 -0.106584 -0.206020       0.071465   
T_Cold                0.198174  0.103127  0.232865       0.098525   
T_constant            0.229860  0.093315  0.246020       0.098761   
velocity             -0.328584 -0.126493 -0.312863      -0.001618   
mold_dia             -0.007729 -0.053752 -0.079594       0.090455   
mold_height           0.154457 -0.109893 -0.011628      -0.016612   
shrinkage_volumetric       NaN  0.341582       NaN      -0.961282   
shrinkage_diameter    0.364946 -0.193729  0.396438       0.792868   
shrinkage_linear     -0.330496 -0.272067 -0.649657       0.354448   
porosity             -0.076042  0.274823 -0.249562      -0.301261   
spacing               1.000000  0.850952  0.635204       0.021851   
pore                  0.850952  1.000000  0.457786       0.010842   
wall                  0.635204  0.457786  1.000000       0.375342   
norm_compress         0.021851  0.010842  0.375342       1.000000   
norm_flexural              NaN -0.363226       NaN            NaN   
norm_youngs          -0.154486  0.112458  0.084315       0.316850   

                      norm_flexural  norm_youngs  
materialID                -0.168980    -0.110275  
total_VF                  -0.290684     0.019764  
ballTime                  -0.052006    -0.036464  
fluid1_ID                 -0.105188     0.555887  
particle1ID               -0.125616    -0.103154  
particle1_diameter        -0.117300     0.021857  
particle1_density         -0.246687    -0.409682  
dispersant1_wf             0.050021    -0.091648  
binder1_wf                -0.526390    -0.203287  
cooling_rate               0.004037    -0.346060  
T_Cold                     0.176303     0.868939  
T_constant                 0.176303    -0.986735  
velocity                        NaN    -0.047485  
mold_dia                  -0.779977    -0.546355  
mold_height                0.035236    -0.751484  
shrinkage_volumetric            NaN     0.881380  
shrinkage_diameter              NaN          NaN  
shrinkage_linear          -0.152162     0.812250  
porosity                   0.062396    -0.502857  
spacing                         NaN    -0.154486  
pore                      -0.363226     0.112458  
wall                            NaN     0.084315  
norm_compress                   NaN     0.316850  
norm_flexural              1.000000          NaN  
norm_youngs                     NaN     1.000000  
time: 36 ms
In [106]:
X.describe()
Out[106]:
materialID total_VF ballTime fluid1_ID particle1ID particle1_diameter particle1_density dispersant1_wf binder1_wf cooling_rate T_Cold T_constant velocity mold_dia mold_height shrinkage_volumetric shrinkage_diameter shrinkage_linear porosity spacing pore wall norm_compress norm_flexural norm_youngs
count 3226.000000 3594.000000 3803.000000 3821.000000 3800.000000 2969.000000 3753.000000 2232.000000 1552.000000 3314.000000 1874.000000 1794.000000 604.000000 2054.000000 1690.000000 34.000000 61.000000 358.000000 2109.000000 433.000000 1042.000000 373.00000 909.000000 92.000000 95.000000
mean 19.246125 0.213014 10.968972 1.500916 21.148158 0.000009 3768.064482 0.022564 0.058528 1.347486 213.833031 212.319677 43.570068 0.022395 0.022398 0.288403 0.163516 0.231415 0.622235 63.222055 58.969582 23.16496 0.046939 0.094610 0.057915
std 16.767915 0.135071 12.846669 1.203534 19.747082 0.000101 1425.196924 0.044413 0.103674 4.242954 73.450585 74.640841 119.041102 0.017818 0.032713 0.217525 0.145027 0.153925 0.204124 83.164450 92.774925 43.87160 0.103124 0.135411 0.133198
min 1.000000 0.000000 0.000000 1.000000 1.000000 0.000000 965.000000 0.001000 0.001000 0.000000 73.000000 73.000000 0.160000 0.000100 0.000003 0.000000 0.007000 0.000000 0.010000 1.750000 0.000000 0.20000 0.000038 0.000046 0.000007
25% NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
50% NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
75% NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
max 68.000000 3.000000 72.000000 14.000000 89.000000 0.002000 10500.000000 0.800000 0.500000 59.800000 319.000000 319.000000 1000.000000 0.130000 0.380000 0.683300 0.830000 0.900000 0.996000 785.000000 1200.000000 500.00000 1.071429 0.614000 0.833333
time: 55 ms

If you'd like to see a correlation matrix for a subset of the matrix above, create a new matrix using the grouping variable of interest, as shown below.

In [104]:
X_water = X[(X['fluid1_ID']) == 1]
print(X_water.corr())
                      materialID  total_VF  ballTime  fluid1_ID  particle1ID  \
materialID              1.000000 -0.422843 -0.276940        NaN     0.908528   
total_VF               -0.422843  1.000000  0.138094        NaN    -0.344309   
ballTime               -0.276940  0.138094  1.000000        NaN    -0.243259   
fluid1_ID                    NaN       NaN       NaN        NaN          NaN   
particle1ID             0.908528 -0.344309 -0.243259        NaN     1.000000   
particle1_diameter      0.033042 -0.006670 -0.027170        NaN     0.049470   
particle1_density      -0.423592  0.311151  0.203762        NaN    -0.262766   
dispersant1_wf         -0.005980  0.064630 -0.079609        NaN     0.014304   
binder1_wf              0.484553 -0.421528 -0.299760        NaN     0.305894   
cooling_rate            0.197869 -0.190869 -0.026857        NaN     0.143094   
T_Cold                 -0.486795  0.316659  0.243022        NaN    -0.329556   
T_constant             -0.586570  0.334154  0.251105        NaN    -0.381260   
velocity                0.162620 -0.040142 -0.139775        NaN     0.352243   
mold_dia                0.124704 -0.044324 -0.022688        NaN     0.055207   
mold_height            -0.038486  0.013984  0.017952        NaN    -0.040336   
shrinkage_volumetric    0.005568  0.321478       NaN        NaN     0.470741   
shrinkage_diameter     -0.261084  0.098830 -0.101574        NaN    -0.001268   
shrinkage_linear       -0.077506 -0.004631  0.090425        NaN     0.105682   
porosity                0.217283 -0.535641 -0.125393        NaN     0.213667   
spacing                -0.105942  0.162367 -0.062417        NaN    -0.126820   
pore                    0.118801 -0.085614 -0.081212        NaN     0.094184   
wall                    0.047403  0.426703 -0.204347        NaN     0.091972   
norm_compress           0.096584  0.160450 -0.119261        NaN     0.008195   
norm_flexural          -0.699901 -0.358196 -0.260416        NaN    -0.600946   
norm_youngs             0.090987  0.190533 -0.135884        NaN     0.093742   

                      particle1_diameter  particle1_density  dispersant1_wf  \
materialID                      0.033042          -0.423592       -0.005980   
total_VF                       -0.006670           0.311151        0.064630   
ballTime                       -0.027170           0.203762       -0.079609   
fluid1_ID                            NaN                NaN             NaN   
particle1ID                     0.049470          -0.262766        0.014304   
particle1_diameter              1.000000          -0.046618       -0.024915   
particle1_density              -0.046618           1.000000        0.014199   
dispersant1_wf                 -0.024915           0.014199        1.000000   
binder1_wf                      0.080613          -0.517220        0.228145   
cooling_rate                   -0.035136          -0.065551       -0.015483   
T_Cold                         -0.007555           0.339991       -0.092911   
T_constant                     -0.005743           0.349388       -0.138797   
velocity                        0.005474           0.240505        0.223599   
mold_dia                        0.135998           0.075054       -0.022403   
mold_height                    -0.032510          -0.007620        0.172679   
shrinkage_volumetric            0.701466           0.675782       -0.819820   
shrinkage_diameter             -0.021352           0.659147        0.268139   
shrinkage_linear               -0.055631           0.400401        0.386951   
porosity                       -0.012729          -0.237299       -0.123588   
spacing                         0.050760           0.069162       -0.136840   
pore                           -0.045226          -0.084454       -0.076523   
wall                            0.143469           0.076794        0.389712   
norm_compress                   0.160006          -0.055875       -0.064863   
norm_flexural                  -0.181162          -0.175365        0.369143   
norm_youngs                     0.291902          -0.191981       -0.089434   

                      binder1_wf  cooling_rate    T_Cold  T_constant  \
materialID              0.484553      0.197869 -0.486795   -0.586570   
total_VF               -0.421528     -0.190869  0.316659    0.334154   
ballTime               -0.299760     -0.026857  0.243022    0.251105   
fluid1_ID                    NaN           NaN       NaN         NaN   
particle1ID             0.305894      0.143094 -0.329556   -0.381260   
particle1_diameter      0.080613     -0.035136 -0.007555   -0.005743   
particle1_density      -0.517220     -0.065551  0.339991    0.349388   
dispersant1_wf          0.228145     -0.015483 -0.092911   -0.138797   
binder1_wf              1.000000      0.224548 -0.592367   -0.585230   
cooling_rate            0.224548      1.000000  0.031468   -0.010328   
T_Cold                 -0.592367      0.031468  1.000000    1.000000   
T_constant             -0.585230     -0.010328  1.000000    1.000000   
velocity               -0.070757     -0.024660 -0.044590   -0.034741   
mold_dia               -0.096267      0.072419  0.235809    0.205807   
mold_height             0.535637     -0.031943 -0.090837   -0.083816   
shrinkage_volumetric    0.042436      0.220579  0.386051    0.371160   
shrinkage_diameter      0.158201      0.171088  0.615134    0.615134   
shrinkage_linear        0.297365      0.073847  0.310547    0.316684   
porosity                0.139756      0.057353 -0.241663   -0.256477   
spacing                 0.072404     -0.161297  0.316086    0.361784   
pore                    0.019754     -0.132691  0.060052    0.053362   
wall                    0.054098     -0.188129  0.205711    0.223344   
norm_compress          -0.167352      0.065952  0.105156    0.105508   
norm_flexural          -0.526390     -0.032558 -0.297861   -0.297861   
norm_youngs            -0.203287     -0.216315  0.999217         NaN   

                      velocity  mold_dia  mold_height  shrinkage_volumetric  \
materialID            0.162620  0.124704    -0.038486              0.005568   
total_VF             -0.040142 -0.044324     0.013984              0.321478   
ballTime             -0.139775 -0.022688     0.017952                   NaN   
fluid1_ID                  NaN       NaN          NaN                   NaN   
particle1ID           0.352243  0.055207    -0.040336              0.470741   
particle1_diameter    0.005474  0.135998    -0.032510              0.701466   
particle1_density     0.240505  0.075054    -0.007620              0.675782   
dispersant1_wf        0.223599 -0.022403     0.172679             -0.819820   
binder1_wf           -0.070757 -0.096267     0.535637              0.042436   
cooling_rate         -0.024660  0.072419    -0.031943              0.220579   
T_Cold               -0.044590  0.235809    -0.090837              0.386051   
T_constant           -0.034741  0.205807    -0.083816              0.371160   
velocity              1.000000 -0.035909    -0.050993                   NaN   
mold_dia             -0.035909  1.000000     0.136503             -0.256481   
mold_height          -0.050993  0.136503     1.000000                   NaN   
shrinkage_volumetric       NaN -0.256481          NaN              1.000000   
shrinkage_diameter         NaN  0.612908     0.982264                   NaN   
shrinkage_linear      0.199362 -0.040395    -0.719592              0.018716   
porosity             -0.011533 -0.016188    -0.129103             -0.679590   
spacing              -0.462184 -0.014253     0.145549                   NaN   
pore                 -0.093853 -0.027406    -0.249385              0.341582   
wall                 -0.320456 -0.051322     0.009125                   NaN   
norm_compress         0.008510  0.124789    -0.007456             -0.961282   
norm_flexural              NaN -0.918596     0.250918                   NaN   
norm_youngs           0.298708 -0.415536    -0.841610              0.881380   

                      shrinkage_diameter  shrinkage_linear  porosity  \
materialID                     -0.261084         -0.077506  0.217283   
total_VF                        0.098830         -0.004631 -0.535641   
ballTime                       -0.101574          0.090425 -0.125393   
fluid1_ID                            NaN               NaN       NaN   
particle1ID                    -0.001268          0.105682  0.213667   
particle1_diameter             -0.021352         -0.055631 -0.012729   
particle1_density               0.659147          0.400401 -0.237299   
dispersant1_wf                  0.268139          0.386951 -0.123588   
binder1_wf                      0.158201          0.297365  0.139756   
cooling_rate                    0.171088          0.073847  0.057353   
T_Cold                          0.615134          0.310547 -0.241663   
T_constant                      0.615134          0.316684 -0.256477   
velocity                             NaN          0.199362 -0.011533   
mold_dia                        0.612908         -0.040395 -0.016188   
mold_height                     0.982264         -0.719592 -0.129103   
shrinkage_volumetric                 NaN          0.018716 -0.679590   
shrinkage_diameter              1.000000          0.701857  0.092316   
shrinkage_linear                0.701857          1.000000 -0.235879   
porosity                        0.092316         -0.235879  1.000000   
spacing                         0.364946         -0.495399 -0.163665   
pore                           -0.193729         -0.234054  0.305350   
wall                            0.396438         -0.524057 -0.265743   
norm_compress                   0.792868          0.327036 -0.257260   
norm_flexural                        NaN          0.140117  0.093606   
norm_youngs                          NaN          0.812250 -0.267388   

                       spacing      pore      wall  norm_compress  \
materialID           -0.105942  0.118801  0.047403       0.096584   
total_VF              0.162367 -0.085614  0.426703       0.160450   
ballTime             -0.062417 -0.081212 -0.204347      -0.119261   
fluid1_ID                  NaN       NaN       NaN            NaN   
particle1ID          -0.126820  0.094184  0.091972       0.008195   
particle1_diameter    0.050760 -0.045226  0.143469       0.160006   
particle1_density     0.069162 -0.084454  0.076794      -0.055875   
dispersant1_wf       -0.136840 -0.076523  0.389712      -0.064863   
binder1_wf            0.072404  0.019754  0.054098      -0.167352   
cooling_rate         -0.161297 -0.132691 -0.188129       0.065952   
T_Cold                0.316086  0.060052  0.205711       0.105156   
T_constant            0.361784  0.053362  0.223344       0.105508   
velocity             -0.462184 -0.093853 -0.320456       0.008510   
mold_dia             -0.014253 -0.027406 -0.051322       0.124789   
mold_height           0.145549 -0.249385  0.009125      -0.007456   
shrinkage_volumetric       NaN  0.341582       NaN      -0.961282   
shrinkage_diameter    0.364946 -0.193729  0.396438       0.792868   
shrinkage_linear     -0.495399 -0.234054 -0.524057       0.327036   
porosity             -0.163665  0.305350 -0.265743      -0.257260   
spacing               1.000000  0.861481  0.733525       0.080536   
pore                  0.861481  1.000000  0.401958       0.007030   
wall                  0.733525  0.401958  1.000000       0.475257   
norm_compress         0.080536  0.007030  0.475257       1.000000   
norm_flexural              NaN -0.431056       NaN            NaN   
norm_youngs           0.875674  0.927265  0.084315       0.323428   

                      norm_flexural  norm_youngs  
materialID                -0.699901     0.090987  
total_VF                  -0.358196     0.190533  
ballTime                  -0.260416    -0.135884  
fluid1_ID                       NaN          NaN  
particle1ID               -0.600946     0.093742  
particle1_diameter        -0.181162     0.291902  
particle1_density         -0.175365    -0.191981  
dispersant1_wf             0.369143    -0.089434  
binder1_wf                -0.526390    -0.203287  
cooling_rate              -0.032558    -0.216315  
T_Cold                    -0.297861     0.999217  
T_constant                -0.297861          NaN  
velocity                        NaN     0.298708  
mold_dia                  -0.918596    -0.415536  
mold_height                0.250918    -0.841610  
shrinkage_volumetric            NaN     0.881380  
shrinkage_diameter              NaN          NaN  
shrinkage_linear           0.140117     0.812250  
porosity                   0.093606    -0.267388  
spacing                         NaN     0.875674  
pore                      -0.431056     0.927265  
wall                            NaN     0.084315  
norm_compress                   NaN     0.323428  
norm_flexural              1.000000          NaN  
norm_youngs                     NaN     1.000000  
time: 45 ms
In [105]:
X_water_cera = X_water[(X_water['material_group']) == 'Ceramic']
print(X_water_cera.corr())
                      materialID  total_VF  ballTime  fluid1_ID  particle1ID  \
materialID              1.000000 -0.320813 -0.107104        NaN     0.895393   
total_VF               -0.320813  1.000000 -0.004097        NaN    -0.297930   
ballTime               -0.107104 -0.004097  1.000000        NaN    -0.101124   
fluid1_ID                    NaN       NaN       NaN        NaN          NaN   
particle1ID             0.895393 -0.297930 -0.101124        NaN     1.000000   
particle1_diameter      0.035346 -0.019779 -0.020285        NaN     0.023992   
particle1_density      -0.201785  0.238761  0.118252        NaN    -0.046271   
dispersant1_wf         -0.007530  0.093319 -0.084157        NaN     0.025708   
binder1_wf              0.002320 -0.175025 -0.084599        NaN     0.069140   
cooling_rate            0.097003 -0.174458  0.062448        NaN     0.132314   
T_Cold                 -0.292649  0.113963  0.103193        NaN    -0.224137   
T_constant             -0.406652  0.130615  0.108922        NaN    -0.292506   
velocity                0.039092 -0.129728  0.004733        NaN    -0.003396   
mold_dia                0.252606 -0.127819 -0.131326        NaN     0.184936   
mold_height            -0.109664  0.000778 -0.022072        NaN    -0.116834   
shrinkage_volumetric    0.980658  0.121477       NaN        NaN     0.503658   
shrinkage_diameter     -0.555442  0.098830  0.059344        NaN    -0.189947   
shrinkage_linear       -0.266653 -0.100104  0.312812        NaN     0.063271   
porosity                0.145504 -0.623111  0.063843        NaN     0.164211   
spacing                -0.098445  0.206796 -0.093591        NaN    -0.094306   
pore                    0.174617 -0.040337  0.016588        NaN     0.100609   
wall                    0.159697  0.536820 -0.302621        NaN     0.167668   
norm_compress           0.095614 -0.037103 -0.091365        NaN     0.005617   
norm_flexural          -0.699901 -0.358196 -0.260416        NaN    -0.600946   
norm_youngs             0.116413  0.307332 -0.065150        NaN     0.087851   

                      particle1_diameter  particle1_density  dispersant1_wf  \
materialID                      0.035346          -0.201785       -0.007530   
total_VF                       -0.019779           0.238761        0.093319   
ballTime                       -0.020285           0.118252       -0.084157   
fluid1_ID                            NaN                NaN             NaN   
particle1ID                     0.023992          -0.046271        0.025708   
particle1_diameter              1.000000          -0.032177       -0.028240   
particle1_density              -0.032177           1.000000        0.020973   
dispersant1_wf                 -0.028240           0.020973        1.000000   
binder1_wf                      0.064967          -0.280887        0.211009   
cooling_rate                   -0.031403           0.206851       -0.017246   
T_Cold                         -0.032485           0.208420       -0.108376   
T_constant                     -0.031411           0.210293       -0.159999   
velocity                        0.007363          -0.021645        0.240677   
mold_dia                        0.153098          -0.026912       -0.021057   
mold_height                    -0.022297          -0.019218        0.177919   
shrinkage_volumetric           -0.750390           0.734487       -0.819820   
shrinkage_diameter              0.409293           0.192071        0.268139   
shrinkage_linear               -0.028666           0.136553        0.400285   
porosity                        0.016681          -0.194424       -0.135203   
spacing                         0.129158           0.000738       -0.135433   
pore                           -0.025085           0.019213       -0.077887   
wall                            0.597402           0.015542        0.389767   
norm_compress                   0.152558          -0.055902       -0.060835   
norm_flexural                  -0.181162          -0.175365        0.369143   
norm_youngs                     0.304216          -0.180158       -0.078595   

                      binder1_wf  cooling_rate    T_Cold  T_constant  \
materialID              0.002320      0.097003 -0.292649   -0.406652   
total_VF               -0.175025     -0.174458  0.113963    0.130615   
ballTime               -0.084599      0.062448  0.103193    0.108922   
fluid1_ID                    NaN           NaN       NaN         NaN   
particle1ID             0.069140      0.132314 -0.224137   -0.292506   
particle1_diameter      0.064967     -0.031403 -0.032485   -0.031411   
particle1_density      -0.280887      0.206851  0.208420    0.210293   
dispersant1_wf          0.211009     -0.017246 -0.108376   -0.159999   
binder1_wf              1.000000     -0.112962 -0.239206   -0.225849   
cooling_rate           -0.112962      1.000000 -0.021953   -0.072406   
T_Cold                 -0.239206     -0.021953  1.000000    1.000000   
T_constant             -0.225849     -0.072406  1.000000    1.000000   
velocity               -0.079877      0.059023 -0.292049   -0.293552   
mold_dia               -0.091836      0.047515  0.029182   -0.060572   
mold_height             0.603921     -0.035414 -0.059937   -0.054856   
shrinkage_volumetric    0.395201      0.128715  0.976413         NaN   
shrinkage_diameter      0.158201      0.542747 -0.201185   -0.201185   
shrinkage_linear        0.310085      0.193830  0.123407    0.123966   
porosity                0.135493      0.094457  0.049288    0.032816   
spacing                 0.085516     -0.179913  0.286250    0.337140   
pore                    0.029451     -0.091806  0.200079    0.153059   
wall                    0.052348     -0.243761  0.182665    0.217670   
norm_compress          -0.151377      0.028635  0.077865    0.078269   
norm_flexural          -0.526390     -0.032558 -0.297861   -0.297861   
norm_youngs            -0.143975     -0.246063  0.999217         NaN   

                      velocity  mold_dia  mold_height  shrinkage_volumetric  \
materialID            0.039092  0.252606    -0.109664              0.980658   
total_VF             -0.129728 -0.127819     0.000778              0.121477   
ballTime              0.004733 -0.131326    -0.022072                   NaN   
fluid1_ID                  NaN       NaN          NaN                   NaN   
particle1ID          -0.003396  0.184936    -0.116834              0.503658   
particle1_diameter    0.007363  0.153098    -0.022297             -0.750390   
particle1_density    -0.021645 -0.026912    -0.019218              0.734487   
dispersant1_wf        0.240677 -0.021057     0.177919             -0.819820   
binder1_wf           -0.079877 -0.091836     0.603921              0.395201   
cooling_rate          0.059023  0.047515    -0.035414              0.128715   
T_Cold               -0.292049  0.029182    -0.059937              0.976413   
T_constant           -0.293552 -0.060572    -0.054856                   NaN   
velocity              1.000000 -0.170600    -0.107126                   NaN   
mold_dia             -0.170600  1.000000     0.082226             -0.819820   
mold_height          -0.107126  0.082226     1.000000                   NaN   
shrinkage_volumetric       NaN -0.819820          NaN              1.000000   
shrinkage_diameter         NaN -0.090029     0.573514                   NaN   
shrinkage_linear      0.199362  0.115987    -0.719592              0.018716   
porosity              0.094682  0.181064    -0.010668             -0.410732   
spacing              -0.470013 -0.069175     0.125686                   NaN   
pore                 -0.254705  0.085149    -0.238662                   NaN   
wall                 -0.308876 -0.174667    -0.129231                   NaN   
norm_compress         0.011200  0.121931    -0.007456             -0.961282   
norm_flexural              NaN -0.918596     0.250918                   NaN   
norm_youngs           0.298708 -0.415536    -0.841610              0.881380   

                      shrinkage_diameter  shrinkage_linear  porosity  \
materialID                     -0.555442         -0.266653  0.145504   
total_VF                        0.098830         -0.100104 -0.623111   
ballTime                        0.059344          0.312812  0.063843   
fluid1_ID                            NaN               NaN       NaN   
particle1ID                    -0.189947          0.063271  0.164211   
particle1_diameter              0.409293         -0.028666  0.016681   
particle1_density               0.192071          0.136553 -0.194424   
dispersant1_wf                  0.268139          0.400285 -0.135203   
binder1_wf                      0.158201          0.310085  0.135493   
cooling_rate                    0.542747          0.193830  0.094457   
T_Cold                         -0.201185          0.123407  0.049288   
T_constant                     -0.201185          0.123966  0.032816   
velocity                             NaN          0.199362  0.094682   
mold_dia                       -0.090029          0.115987  0.181064   
mold_height                     0.573514         -0.719592 -0.010668   
shrinkage_volumetric                 NaN          0.018716 -0.410732   
shrinkage_diameter              1.000000          0.701857  0.251402   
shrinkage_linear                0.701857          1.000000 -0.084668   
porosity                        0.251402         -0.084668  1.000000   
spacing                         0.364946         -0.495399 -0.152532   
pore                           -0.060121         -0.234054  0.181374   
wall                            0.396438         -0.543326 -0.325859   
norm_compress                   0.792868          0.327036 -0.261075   
norm_flexural                        NaN          0.140117  0.093606   
norm_youngs                          NaN          0.812250 -0.199260   

                       spacing      pore      wall  norm_compress  \
materialID           -0.098445  0.174617  0.159697       0.095614   
total_VF              0.206796 -0.040337  0.536820      -0.037103   
ballTime             -0.093591  0.016588 -0.302621      -0.091365   
fluid1_ID                  NaN       NaN       NaN            NaN   
particle1ID          -0.094306  0.100609  0.167668       0.005617   
particle1_diameter    0.129158 -0.025085  0.597402       0.152558   
particle1_density     0.000738  0.019213  0.015542      -0.055902   
dispersant1_wf       -0.135433 -0.077887  0.389767      -0.060835   
binder1_wf            0.085516  0.029451  0.052348      -0.151377   
cooling_rate         -0.179913 -0.091806 -0.243761       0.028635   
T_Cold                0.286250  0.200079  0.182665       0.077865   
T_constant            0.337140  0.153059  0.217670       0.078269   
velocity             -0.470013 -0.254705 -0.308876       0.011200   
mold_dia             -0.069175  0.085149 -0.174667       0.121931   
mold_height           0.125686 -0.238662 -0.129231      -0.007456   
shrinkage_volumetric       NaN       NaN       NaN      -0.961282   
shrinkage_diameter    0.364946 -0.060121  0.396438       0.792868   
shrinkage_linear     -0.495399 -0.234054 -0.543326       0.327036   
porosity             -0.152532  0.181374 -0.325859      -0.261075   
spacing               1.000000  0.867673  0.861376      -0.160163   
pore                  0.867673  1.000000  0.199777      -0.068464   
wall                  0.861376  0.199777  1.000000      -0.070977   
norm_compress        -0.160163 -0.068464 -0.070977       1.000000   
norm_flexural              NaN -0.431056       NaN            NaN   
norm_youngs          -0.691791  0.863534 -0.372929       0.236389   

                      norm_flexural  norm_youngs  
materialID                -0.699901     0.116413  
total_VF                  -0.358196     0.307332  
ballTime                  -0.260416    -0.065150  
fluid1_ID                       NaN          NaN  
particle1ID               -0.600946     0.087851  
particle1_diameter        -0.181162     0.304216  
particle1_density         -0.175365    -0.180158  
dispersant1_wf             0.369143    -0.078595  
binder1_wf                -0.526390    -0.143975  
cooling_rate              -0.032558    -0.246063  
T_Cold                    -0.297861     0.999217  
T_constant                -0.297861          NaN  
velocity                        NaN     0.298708  
mold_dia                  -0.918596    -0.415536  
mold_height                0.250918    -0.841610  
shrinkage_volumetric            NaN     0.881380  
shrinkage_diameter              NaN          NaN  
shrinkage_linear           0.140117     0.812250  
porosity                   0.093606    -0.199260  
spacing                         NaN    -0.691791  
pore                      -0.431056     0.863534  
wall                            NaN    -0.372929  
norm_compress                   NaN     0.236389  
norm_flexural              1.000000          NaN  
norm_youngs                     NaN     1.000000  
time: 35 ms

See a correlation value that looks promising? Create a new variable and plot the data!

In [120]:
sub = data[(data['velocity']) > 0]
sub = sub[(sub['fluid1_ID']) == 1]
subP = sub[(sub['pore']) > 0]
subW = sub[(sub['wall']) > 0]


x1 = subP['velocity']
x2 = subW['velocity']

y1 = subP['pore']
y2 = subW['wall']

fig = plt.figure(figsize = (10,5))
ax1 = fig.add_subplot(1, 2, 1)
ax2 = fig.add_subplot(1, 2, 2)
minorLocator = AutoMinorLocator()

ax1.set(xlim = [1, 100])
ax1.set(ylim = [1, 500])
ax2.set(xlim = [1, 100])
ax2.set(ylim = [1, 500])

ax1.set_ylabel("Pore width", fontsize = 20)
ax1.set_xlabel('Velocity (um/s)', fontsize = 20)
ax2.set_ylabel("Wall width (um)", fontsize = 20)
ax2.set_xlabel('Velocity (um/s)', fontsize = 20)

ax1.set_yscale('log')
ax1.set_xscale('log')
ax2.set_yscale('log')
ax2.set_xscale('log')

ax1.scatter(x1, y1, color = 'blue', s = 40, edgecolor = 'black')
ax2.scatter(x2, y2, color = 'blue', s = 40, edgecolor = 'black')

ax1.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')
plt.tight_layout()

#printPapers(youngsPorosity_water, 'fig')
#printPapers(youngsPorosity_camphene, 'fig')
#printPapers(youngsPorosity_tba, 'fig')
time: 998 ms
In [139]:
sub1 = data[(data['T_constant']) > 0]
sub1 = sub1[(sub1['fluid1_ID']) == 1]
subP = sub1[(sub1['pore']) > 0]
subW = sub1[(sub1['wall']) > 0]


x1 = subP['T_constant']
x2 = subW['T_constant']

y1 = subP['pore']
y2 = subW['wall']
x = [263, 258, 253, 243]
y = [51, 41, 18, 16]
x3 = [263, 258, 253, 243]
y3 = [29, 27, 19, 20]

fig = plt.figure(figsize = (10,5))
ax1 = fig.add_subplot(1, 2, 1)
ax3 = fig.add_subplot(1, 2, 1)
ax2 = fig.add_subplot(1, 2, 2)
ax4 = fig.add_subplot(1, 2, 2)
minorLocator = AutoMinorLocator()

ax1.set(xlim = [100, 1000])
ax1.set(ylim = [1, 500])
ax2.set(xlim = [100, 1000])
ax2.set(ylim = [1, 500])
#ax1.xaxis.set_minor_locator(minorLocator)

ax1.set_ylabel("Pore width", fontsize = 20)
ax1.set_xlabel('Substrate temperature (K)', fontsize = 20)
ax2.set_ylabel("Wall width (um)", fontsize = 20)
ax2.set_xlabel('Substrate temperature (K)', fontsize = 20)

ax1.set_yscale('log')
ax1.set_xscale('log')
ax2.set_yscale('log')
ax2.set_xscale('log')

ax1.scatter(x1, y1, color = 'blue', s = 40, edgecolor = 'black')
ax3.scatter(x, y, color = 'red')
ax2.scatter(x2, y2, color = 'blue', s = 40, edgecolor = 'black')
ax4.scatter(x3, y3, color = 'red')
ax1.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')
plt.tight_layout()

#Uncomment to print the number of references
#printPapers(youngsPorosity_water, 'fig')
#printPapers(youngsPorosity_camphene, 'fig')
#printPapers(youngsPorosity_tba, 'fig')
time: 962 ms
In [ ]:
 

FreezeCasting.net

An open-data initiative

info@freezecasting.net