def linFit(x,y): ''' Deprecated. Please update yr code to call this from NumUtils.py ''' print('Deprecated. Please update yr code to call this from NumUtils.py') import NumUtils as nu model, R_out = nu.linFit(x,y) return model, R_out
def upperYieldStress(rheoData, rheoInfo): import numpy as np import NumUtils as nu g, t, gd = (rheoData['gamma'], rheoData['tau'], rheoData['gammadot']) UI = rheoInfo['upperN'] # upper yield stress gdU1 = gd[UI[0,0]:UI[0,1]] tU1 = t[UI[0,0]:UI[0,1]] gdU2 = gd[UI[1,0]:UI[1,1]] tU2 = t[UI[1,0]:UI[1,1]] mU1, rU1 = nu.linFit(gdU1, tU1) m1, b1 = (mU1[0], mU1[1]) mU2, rU2 = nu.linFit(gdU2, tU2) m2, b2 = (mU2[0], mU2[1]) tau_y = (b2-b1)/(m1-m2) uys = {'upperYS' : tau_y, 'gammadot_y' : (tau_y-b1)/m1, 'fit' : np.array([[m1,b1],[m2,b2]])}