Temperature
InĀ [1]:
Copied!
from PASCal.app import fit
import numpy as np
from PASCal.app import fit
import numpy as np
InĀ [2]:
Copied!
# Define example data from the app
data = np.loadtxt((line for line in """
#Variable Temperature Data for Ag3CoCN6 Phase II
95      5       6.6200  11.3500 6.6230  90.0000 78.5000 90.0000
120     5       6.6310  11.3622 6.6140  90.0000 78.4680 90.0000
145     5       6.6328  11.3643 6.6099  90.0000 78.4700 90.0000
170     5       6.6361  11.3759 6.6007  90.0000 78.4330 90.0000
195     5       6.6330  11.3829 6.6062  90.0000 78.3690 90.0000
220     5       6.6379  11.3883 6.6000  90.0000 78.3790 90.0000
245     5       6.6383  11.3969 6.5980  90.0000 78.3720 90.0000
270     5       6.6401  11.4091 6.5956  90.0000 78.3490 90.0000
300     5       6.6415  11.4251 6.5959  90.0000 78.2840 90.0000
""".splitlines()))
# Define example data from the app
data = np.loadtxt((line for line in """
#Variable Temperature Data for Ag3CoCN6 Phase II
95      5       6.6200  11.3500 6.6230  90.0000 78.5000 90.0000
120     5       6.6310  11.3622 6.6140  90.0000 78.4680 90.0000
145     5       6.6328  11.3643 6.6099  90.0000 78.4700 90.0000
170     5       6.6361  11.3759 6.6007  90.0000 78.4330 90.0000
195     5       6.6330  11.3829 6.6062  90.0000 78.3690 90.0000
220     5       6.6379  11.3883 6.6000  90.0000 78.3790 90.0000
245     5       6.6383  11.3969 6.5980  90.0000 78.3720 90.0000
270     5       6.6401  11.4091 6.5956  90.0000 78.3490 90.0000
300     5       6.6415  11.4251 6.5959  90.0000 78.2840 90.0000
""".splitlines()))
InĀ [3]:
Copied!
x = data[:, 0]
x_error = data[:, 1]
unit_cells = data[:, 2:]
x = data[:, 0]
x_error = data[:, 1]
unit_cells = data[:, 2:]
InĀ [4]:
Copied!
fit_results = fit(x, x_error, unit_cells, {"data_type": "temperature"})
fit_results = fit(x, x_error, unit_cells, {"data_type": "temperature"})
Performing fit with options=Options(data_type=<PASCalDataType.TEMPERATURE: 'Temperature'>, eulerian_strain=True, finite_strain=True, use_pc=False, pc_val=None, deg_poly_strain=5, deg_poly_vol=5)
InĀ [5]:
Copied!
fit_results.plot_strain()
fit_results.plot_strain()
InĀ [6]:
Copied!
fit_results.plot_volume()
fit_results.plot_volume()
InĀ [7]:
Copied!
fit_results.plot_indicatrix(plot_size=600)
fit_results.plot_indicatrix(plot_size=600)
InĀ [8]:
Copied!
import pprint
pprint.pprint(fit_results.named_coefficients)
import pprint
pprint.pprint(fit_results.named_coefficients)
{'CalAlphaErr': array([2.69714835, 1.59456213, 2.6701508 ]),
 'VolCoef': 20.432852108103567,
 'VolCoefErr': 2.6283507339240315,
 'VolLin': array([487.65053548, 487.89963352, 488.14873156, 488.39782961,
       488.64692765, 488.89602569, 489.14512373, 489.39422177,
       489.69313942]),
 'XCal': array([[-0.0858302 , -0.1424414 , -0.19905259, -0.25566378, -0.31227497,
        -0.36888616, -0.42549735, -0.48210854, -0.55004197],
       [-0.00436449,  0.0707205 ,  0.14580549,  0.22089048,  0.29597547,
         0.37106046,  0.44614545,  0.52123044,  0.61133243],
       [ 0.09194546,  0.1245851 ,  0.15722475,  0.18986439,  0.22250404,
         0.25514368,  0.28778333,  0.32042297,  0.35959055]])}