In [1]:
%pylab inline
%load_ext autoreload
%autoreload 2
from matmodlab2 import *
from matmodlab2.fitting.mcgen import *
In [2]:
mc = MasterCurve.Import('mcgen.csv', yvar='E_r', yunits='psi')
mc.plot(raw=True)
In [3]:
mc.fit()
mc.plot()
The master curve fit is plotted by setting the keyword show_fit=True
In [4]:
mc.plot(show_fit=True)
A description of the fit is printed to the screen with the MasterCurve.description
property
In [5]:
mc.description
The optimized $C_1$ and $C_2$ WLF coefficients are in the MasterCurve.wlf_opt
attribute
In [6]:
mc.wlf_opt
Out[6]:
It is often necessary to supply initial guesses to the WLF coefficients, do so by passing to MasterCurve.fit
the wlf_coeffs
keyword
In [7]:
mc.fit(wlf_coeffs=[2, 300])
mc.plot(show_fit=True)
Other master curve fit types are available
In [8]:
mc.fit(fitter=MODIFIED_POWER)
mc.plot(show_fit=True)
mc.fiterr
Out[8]:
In [9]:
mc.fit(fitter=POLYNOMIAL, order=4)
mc.plot(show_fit=True)
mc.fiterr
Out[9]:
In [10]:
mc.fit(fitter=POWER)
mc.plot(show_fit=True)
mc.fiterr
Out[10]:
In [11]:
mc.fit()
mc.Export('foo.csv')
#mc.Export('foo.xlsx')