Ejemplo n.º 1
0
def radius(x, y):
    y1 = fv.sec_ord_fdd(x, y)
    y2 = fv.sec_ord_fdd(x, y1)
    a1 = 1 + (y1)**2
    a2 = np.abs(y2)
    radi = np.power(a1, 1.5) / a2
    return radi
Ejemplo n.º 2
0
def radius(x, y, opt='external'):
    y1 = fv.sec_ord_fdd(x, y)
    y2 = fv.sec_ord_fdd(x, y1)
    a1 = 1 + (y1)**2
    a2 = np.abs(y2)
    curva = curvature(x, y, opt=opt)
    radi = 1 / curva
    return radi
Ejemplo n.º 3
0
def curvature(x, y, opt='external'):
    if opt == 'internal':
        dydx = np.gradient(y, x)
        ddyddx = np.gradient(dydx, x)
    if opt == 'external':
        dydx = fv.sec_ord_fdd(x, y)  # y1, dydx; y2, ddyddx
        ddyddx = fv.sec_ord_fdd(x, dydx)
    a1 = 1 + (dydx)**2
    a2 = ddyddx
    curv = a2 / np.power(a1, 1.5)
    return curv
Ejemplo n.º 4
0
# %% alpha with x by time sequential data
# alpha_i
delta = 1e-3
lst = pd.read_csv(pathLB + 'LST_TS.dat',
                  sep=' ',
                  index_col=False,
                  skipinitialspace=True)
var = pd.read_csv(pathLB + varnm + '_freq_by_t_' + yloc + '.dat',
                  sep=' ',
                  skiprows=0,
                  index_col=False,
                  skipinitialspace=True)
var = var.iloc[2:].reset_index()
lst = lst.iloc[1:].reset_index()
alpha_i = va.sec_ord_fdd(var['x'], var['amplt'])
alpha_r = -va.sec_ord_fdd(var['x'], var['phase'])
alpha_i = alpha_i / var['amplt']
fig = plt.figure(figsize=(6.4, 3.2))
#fig, ax = plt.subplots(figsize=(3.2, 3.2))
matplotlib.rc("font", size=textsize)
ax1 = fig.add_subplot(121)
ax1.plot(var['x'], alpha_r * 2 * np.pi, 'k-', linewidth=1.2)
ax1.scatter(lst['x'],
            lst['alpha_r'] / lst['bl'] * delta,
            s=12,
            marker='o',
            facecolors='w',
            edgecolors='k',
            linewidths=0.8)
ax1.set_xlim([-40.0, -6.0])
Ejemplo n.º 5
0
ax.ticklabel_format(axis="y", style="sci", scilimits=(-1, 1))
ax.set_xlabel(r"$f\delta_0/u_\infty$", fontsize=textsize)
ax.set_ylabel(r"$f\ \mathcal{P}(f)$", fontsize=textsize)
ax.grid(b=True, which="both", linestyle=":")
Fre, FPSD = va.fw_psd(Xr, dt, 1 / dt, opt=1, seg=8, overlap=4)
ax.semilogx(Fre, FPSD, "k", linewidth=0.8)
ax.yaxis.offsetText.set_fontsize(numsize)
plt.tick_params(labelsize=numsize)
plt.tight_layout(pad=0.5, w_pad=0.8, h_pad=1)
plt.savefig(pathF + "XrFWPSD_zoom.svg", bbox_inches="tight", pad_inches=0.1)
plt.show()

# %% gradient of Xr
x1x2 = [-40, 10]
fig, ax = plt.subplots(figsize=(6.4, 3.0))
dxr = va.sec_ord_fdd(timezone, Xr)
ax.plot(timezone, dxr, "k-")
ax.set_xlim(x1x2)
ax.set_xlabel(r"$t u_\infty/\delta_0$", fontsize=textsize)
ax.set_ylabel(r"$\mathrm{d} x_r/\mathrm{d} t$", fontsize=textsize)
ax.grid(b=True, which="both", linestyle=":")
dx_pos = dxr[np.where(dxr > 0.0)]
mean_pos = np.mean(dx_pos)
dx_neg = dxr[np.where(dxr < 0.0)]
mean_neg = np.mean(dx_neg)
ax.axhline(y=mean_pos, color="k", linestyle="--", linewidth=1.0)
ax.axhline(y=mean_neg, color="k", linestyle="--", linewidth=1.0)
plt.tick_params(labelsize=numsize)
plt.savefig(pathF + "GradientXr.svg", bbox_inches="tight", pad_inches=0.1)
plt.show()