示例#1
0
print "At m=m:"
print "    r = %10.6e cm" % rs
print "    l = %10.6e erg/s" % ls
print "    P = %10.6e Dyne/cm^2" % Ps
print "    T = %10.6e K" % Ts
print "    -- Initial ---------------- | -- 1st Step -------------- | -- Delta --------| "
print u"    R = %10.6e cm,        | R = %10.6e cm        | ΔR = %11.4e |" % (
    rs, rc, abs(rs - rc) / rs)
print u"    L = %10.6e erg/s,     | L = %10.6e erg/s     | ΔL = %11.4e |" % (
    ls, lc, abs(ls - lc) / ls)
print u"    P = %10.6e Dyne/cm^2, | P = %10.6e Dyne/cm^2 | ΔP = %11.4e |" % (
    Ps, Pc, abs(Ps - Pc) / Ps)
print u"    T = %10.6e K,         | T = %10.6e K         | ΔT = %11.4e |" % (
    Ts, Tc, abs(Ts - Tc) / Ts)

print "Derivatives"
print "Testing in Array Mode"
dT, dP, dl, dr = derivatives(np.array([m]),
                             np.atleast_2d([[ri, li, Pi, Ti], [rs, ls, Ps,
                                                               Ts]]),
                             mu=mmw(X=X, Y=Y),
                             optable=Opacity,
                             epsilon=epsilon)
# print derivs
print "    dr = [%14.6e,%14.6e]" % tuple(dr)
print "    dl = [%14.6e,%14.6e]" % tuple(dl)
print "    dP = [%14.6e,%14.6e]" % tuple(dP)
print "    dT = [%14.6e,%14.6e]" % tuple(dT)
# print ""

Opacity.stop()
示例#2
0
Opacity.start()

print ""

print "Settings for the Sun"
print "M = %10.6g g" % Ms
print "X = %10.3f" % X
print "Y = %10.3f" % Y
print u"μ = %10.3f" % mmw(X=X,Y=Y)
print ""

m = 1.9890999983295044e+33

print "Inner Boundary Conditions"
print "    Initial Step:"
print "    m = %10.6e g" % m
(r,l,P,T) = [  6.96000000e+10,   2.13492744e+33,   3.64246107e+27,  5.77489402e+03]
print "At m=m:"
print "    r = %10.6e cm" % r
print "    l = %10.6e erg/s" % l
print "    P = %10.6e Dyne/cm^2" % P
print "    T = %10.6e K" % T
print u"      = %10.6e " % density(P=P,T=T,X=X,Y=Y)
print "Derivatives"
(dr,dl,dP,dT) = derivatives(np.array([m]),np.atleast_2d([r,l,P,T]),mu=mmw(X=X,Y=Y),optable=Opacity,X=X,XCNO=(1-X-Y),cfg=Config["Data.Energy"])
print "    dr = %10.6e" % dr
print "    dl = %10.6e" % dl
print "    dP = %10.6e" % dP
print "    dT = %10.6e" % dT
print ""
Opacity.stop()
示例#3
0
print "    Initial Step:"
print "    m = %10.6e g" % m
(rs,ls,Ps,Ts) = inner_boundary(Pc=Pc,Tc=Tc,M=Ms,mu=mmw(X=X,Y=Y),m=m,epsilon=epsilon,optable=Opacity)
(rc,lc,Pc,Tc) = (0,0,Pc,Tc)
print "At m=m:"
print "    r = %10.6e cm" % rs
print "    l = %10.6e erg/s" % ls
print "    P = %10.6e Dyne/cm^2" % Ps
print "    T = %10.6e K" % Ts
print "    -- Initial ---------------- | -- 1st Step -------------- | -- Delta --------| "
print u"    R = %10.6e cm,        | R = %10.6e cm        | ΔR = %11.4e |" % (rs,rc,abs(rs-rc)/rs)
print u"    L = %10.6e erg/s,     | L = %10.6e erg/s     | ΔL = %11.4e |" % (ls,lc,abs(ls-lc)/ls)
print u"    P = %10.6e Dyne/cm^2, | P = %10.6e Dyne/cm^2 | ΔP = %11.4e |" % (Ps,Pc,abs(Ps-Pc)/Ps)
print u"    T = %10.6e K,         | T = %10.6e K         | ΔT = %11.4e |" % (Ts,Tc,abs(Ts-Tc)/Ts)




print "Derivatives"
print "Testing in Array Mode"
dT, dP, dl, dr = derivatives(np.array([m]),np.atleast_2d([[ri,li,Pi,Ti],[rs,ls,Ps,Ts]]),mu=mmw(X=X,Y=Y),optable=Opacity,epsilon=epsilon)
# print derivs
print "    dr = [%14.6e,%14.6e]" % tuple(dr)
print "    dl = [%14.6e,%14.6e]" % tuple(dl)
print "    dP = [%14.6e,%14.6e]" % tuple(dP)
print "    dT = [%14.6e,%14.6e]" % tuple(dT)
# print ""



Opacity.stop()