scan['k_{24}'] = k24 scan['\\Lambda'] = Lambda scan['\\omega'] = omega loadsuf=["K_{33}","k_{24}","\\Lambda","\\omega","\\gamma_s"] psistuff = PsiData(scan=scan,loadsuf=loadsuf,savesuf=loadsuf) rs = psistuff.r()/8.0*1000 psis = psistuff.psi() observablestuff = ObservableData(scan=scan,loadsuf=loadsuf,savesuf=loadsuf) print(observablestuff.surfacetwist()) R = observablestuff.R()/8.0*1000 fig = plt.figure() width = 3.487 height = width fig.set_size_inches(2*width,height) ax1 = fig.add_subplot(1,2,1) ax1.plot(rs,psis,'.',label=rf'$\Lambda={Lambda}$')
savesuf=savesuf) if not obsfwd.file_exists: continue obsfwd.sort_observables() obsfwd.remove_duplicates() Lambdas = obsfwd.data[:,0] #obsbkwd = ObservableData(["\\Lambda"],scan_dir='scanbackward',scan=scan,loadsuf=loadsuf, # savesuf=savesuf) #obsbkwd.sort_observables() ysfwd = [obsfwd.E(),obsfwd.R(),obsfwd.eta(),obsfwd.delta(),obsfwd.surfacetwist()] #ysbkwd = [obsbkwd.E(),obsbkwd.R(),obsbkwd.eta(),obsbkwd.delta(),obsbkwd.surfacetwist()] for i,observable in enumerate(observable_list): if observable == 'surfacetwist': ylabel = r'$\psi(R)$' elif observable == 'eta': ylabel = r'$2\pi/\eta$' ysfwd[i] = 2*np.pi/ysfwd[i] elif observable == 'delta': ylabel = r'$\delta/\delta_0$' ysfwd[i] = ysfwd[i]/np.sqrt(2/3) elif len(observable) > 1:
k24 = pair[1] scan = {} scan['\\gamma_s'] = gamma scan['k_{24}'] = k24 scan['\\omega'] = str(omega) obsfwd = ObservableData(["\\Lambda"], scan_dir='scanforward', scan=scan, loadsuf=loadsuf, savesuf=savesuf) Lambdas = obsfwd.data[:, 0] x, y = obsfwd.surfacetwist()[1:], 2 * np.pi / obsfwd.eta()[1:] ax.plot(x, y, '.', color=colors[js]) ax.plot(x[-1], y[-1], 'rs') dums = np.linspace(0.05, 0.25, num=150, endpoint=True) ax.plot(dums, np.cos(dums), '--') ax.set_xlabel(r"$\psi(R)$", fontsize=10) ax.set_ylabel(r"$2\pi/\eta$", fontsize=10) fig.subplots_adjust(left=0.1, right=0.9, bottom=0.15, top=0.95) fig.savefig(obsfwd.observable_sname("twistvsdband", plot_format="pdf")) plt.show()
k24 = pair[1] scan = {} scan['\\gamma_s'] = gamma scan['k_{24}'] = k24 scan['\\omega'] = str(omega) obsfwd = ObservableData(["\\Lambda"], scan_dir='scanforward', scan=scan, loadsuf=loadsuf, savesuf=savesuf) Lambdas = obsfwd.data[:, 0] ysfwd = [obsfwd.R(), obsfwd.surfacetwist()] if js == 1: obsbkwd = ObservableData(["\\Lambda"], scan_dir='scanbackward', scan=scan, loadsuf=loadsuf, savesuf=savesuf) obsbkwd.sort_observables() ysbkwd = [obsbkwd.R(), obsbkwd.surfacetwist()] for i, observable in enumerate(observable_list): if observable == 'surfacetwist': ylabel = r'$\psi(R)$' else:
scan['\\omega'] = omega obsfwd = ObservableData(["\\gamma_s"], scan_dir='scanforward', scan=scan, loadsuf=loadsuf, savesuf=savesuf) gammas = obsfwd.data[:, 0] ysfwd = [ obsfwd.E(), obsfwd.R(), obsfwd.eta(), obsfwd.delta(), obsfwd.surfacetwist() ] """ obsbkwd = ObservableData(["\\gamma_s"],scan_dir='scanbackward',scan=scan,loadsuf=loadsuf, savesuf=savesuf) ysbkwd = [obsbkwd.R(),obsbkwd.surfacetwist()] g_small,g_large,g_eq = find_metastable(obsfwd.R(),obsbkwd.R(), obsfwd.E(),obsbkwd.E()) print(g_small,g_large,g_eq) """ for i, observable in enumerate(observable_list):
scan['\\Lambda'] = Lambda print(Lambda) obsfwd = ObservableData(["strain"], scan_dir='scanforward', scan=scan, loadsuf=loadsuf, savesuf=savesuf) #obsfwd.sort_observables() #obsfwd.remove_duplicates() strains = obsfwd.data[:, 0] stresses = np.gradient(obsfwd.E(), strains) stresses[0] = 0.0 #ysfwd = [obsfwd.E(),obsfwd.R(),obsfwd.delta(),obsfwd.surfacetwist(),stresses] ysfwd = [stresses, obsfwd.delta(), obsfwd.surfacetwist()] if obsfwd.E()[0] > 1e299: print("bad calculation at Lambda = ", Lambda) continue for i, observable in enumerate(observable_list): if observable == 'surfacetwist': ylabel = r'$\psi(R)$' elif observable == "stress": ylabel = r"$\sigma$" elif observable == 'delta': ylabel = r'$\delta/\delta_0$' ysfwd[i] = ysfwd[i] / np.sqrt(2 / 3) elif len(observable) > 1: ylabel = fr'$\{observable}$'
loadsuf=loadsuf, savesuf=savesuf) obsbkwd = ObservableData(["\\Lambda"], scan_dir='scanbackward', scan=scan, loadsuf=loadsuf, savesuf=savesuf) obsbkwd.sort_observables() observable_list = ['E', 'R', 'eta', 'delta', 'surfacetwist'] ysfwd = [ obsfwd.E(), obsfwd.R(), obsfwd.eta(), obsfwd.delta(), obsfwd.surfacetwist() ] ysbkwd = [ obsbkwd.E(), obsbkwd.R(), obsbkwd.eta(), obsbkwd.delta(), obsbkwd.surfacetwist() ] for i, observable in enumerate(observable_list): fig[observable] = plt.figure() ax[observable] = fig[observable].add_subplot(1, 1, 1) fig[observable].set_size_inches(width, height)
for j,Lambda in enumerate(Lambdas): scan = {} scan['\\Lambda']=Lambda scan['k_{24}']=k24 scan['\\omega']=omega obsfwd = ObservableData(["\\gamma_s"],scan_dir='scanforward',scan=scan,loadsuf=loadsuf, savesuf=savesuf) gammas = obsfwd.data[:,0] ysfwd = [obsfwd.E(),obsfwd.R(),obsfwd.eta(), obsfwd.delta(),obsfwd.surfacetwist()] """ obsbkwd = ObservableData(["\\gamma_s"],scan_dir='scanbackward',scan=scan,loadsuf=loadsuf, savesuf=savesuf) ysbkwd = [obsbkwd.R(),obsbkwd.surfacetwist()] g_small,g_large,g_eq = find_metastable(obsfwd.R(),obsbkwd.R(), obsfwd.E(),obsbkwd.E()) print(g_small,g_large,g_eq) """ for i,observable in enumerate(observable_list):