This notebook computes the variation of the shape factor of the Hartree profile for a given variation of the outer velocity. For verification we first consider a power-law variation of the outer velocity, such that the Hartree profiles should be exact.

In [121]:
import numpy             as np
import matplotlib.pyplot as plt

Parameters¶

In [122]:
N = 101 # number of data points

# Exponent of the outer velocity variation ~ x^m
beta = 0.5        # wedge angle [multiples of pi/2 rad]
m = beta / (2-beta)  # exponent

# Shift and scale the outer velocity
x0 = 1.0*(beta<=0)   # x-shift
B  = 1               # u-scale

# Linear approximation of F_2(Gamma) = a - b * Gamma
a = 0.441
b = lambda gamma: 4.165*(gamma>=0) + 4.579*(gamma<0)

Outer velocity variation¶

In [123]:
Ue = lambda x: B*(x+x0)**m

Produce discrete data¶

In [124]:
x  = np.linspace(0,1,N)
U  = Ue(x)
In [125]:
plt.plot(x,U,'.-')
plt.xlabel(r'$x$')
plt.ylabel(r'$U$')
plt.xlim(0,1)
plt.show()
No description has been provided for this image

Compute Z(x) recursively¶

In [126]:
Z    = np.zeros(N)
G    = np.zeros(N)
bip1 = b(0)

dU   = np.diff(U)
dx   = np.diff(x)
dUdx = dU/dx

for i in range(N-1):
    num    = Z[i] + a*dx[i]
    den    = 1 + bip1/U[i+1]*dU[i]
    Z[i+1] = num / den
    G[i+1] = Z[i+1]/U[i+1]*dUdx[i]
    
    if np.sign(G[i+1]) != np.sign(G[i]):
        bip1 = b(G[i+1])
        den = 1 + bi/U[i+1]*dU[i]
        Z[i+1] = num / den
        G[i+1] = Z[i+1]/U[i+1]*dUdx[i]

G[0] = np.nan
In [127]:
plt.plot(x,Z)
plt.xlabel(r'$x$')
plt.ylabel(r'$Z$')
plt.xlim(0,1)
plt.show()
No description has been provided for this image
In [128]:
plt.plot(x,G)
plt.xlabel(r'$x$')
plt.ylabel(r'$\Gamma$')
plt.xlim(0,1)
plt.ticklabel_format(axis='y',useOffset=False)
plt.show()
No description has been provided for this image

Compare to Table 8.1 in Schlichting and Gersten (2017), p. 197.

In [129]:
print('Gamma(1) = ', G[-1])
Gamma(1) =  0.061547784136039445
In [ ]: