import os.path import sys sys.path.append('/home/tom/Documents/skola/bakalarka/python/') from derivatives import Frad, Fconv from scipy.interpolate import UnivariateSpline from EOS import rho, cp from const import * from ext_data import opac for i in range(0, z.size): FconvArr[i] = Fconv(T[i], P[i], z[i]) FradArr[i] = Frad(T[i], P[i], z[i]) rhoArr[i] = rho(T[i], P[i], z[i]) cpArr[i] = cp(T[i], P[i]) opacArr[i] = opac(T[i], rhoArr[i]) F = FconvArr + FradArr F_spline = UnivariateSpline(z, F, s=0) dFdz = F_spline.derivative() dFdz = dFdz(z) #dFdz = np.diff(F)/h #dFdz = np.append(dFdz, dFdz[dFdz.size-1]) # semi-implicitni metoda pro casovy prirustek #d_main = np.empty(500) #d_sub = np.zeros(500) #d_sup = np.zeros(500) #b = np.zeros(500)
def opac(T, P, z): opac0 = ext.opac(T, rho(T,P,z), z) return opac0[0,0]
import sys sys.path.append('/home/tom/Documents/skola/bakalarka/python/') from derivatives import Frad, Fconv from scipy.interpolate import UnivariateSpline from EOS import rho, cp from const import * from ext_data import opac for i in range (0, z.size): FconvArr[i] = Fconv(T[i], P[i], z[i]) FradArr[i] = Frad(T[i], P[i], z[i]) rhoArr[i] = rho(T[i], P[i], z[i]) cpArr[i] = cp(T[i], P[i]) opacArr[i] = opac(T[i],rhoArr[i]) F = FconvArr+FradArr F_spline = UnivariateSpline(z, F, s=0) dFdz = F_spline.derivative() dFdz = dFdz(z) #dFdz = np.diff(F)/h #dFdz = np.append(dFdz, dFdz[dFdz.size-1]) # semi-implicitni metoda pro casovy prirustek #d_main = np.empty(500) #d_sub = np.zeros(500) #d_sup = np.zeros(500) #b = np.zeros(500)
def opac(T, P, z): opac0 = ext.opac(T, rho(T, P, z), z) return opac0[0, 0]