In [ ]:
import numpy as np
g = 9.8
dt = 0.01
rel = np.arange(0.01, 0.6 + dt, dt)
err = 0.95
Cc = np.sqrt(np.tanh(2 * np.pi * rel))
Cl = np.sqrt((1 / (2 * np.pi * rel)) * np.tanh(2 * np.pi * rel))
In [ ]:
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.plot(rel, Cc, 'k')
ax.plot(rel, Cl, 'b')
ax.set_title('Velocity comparison by H/L [error > 5% in red]')
ax.set_xlabel('H/L')
ax.set_ylabel('C/Cc (preto) e C/Cl (Azul)')
errCc = Cc < err
errCl = Cl < err
ax.plot(rel[errCl], Cl[errCl], 'r')
_ = ax.plot(rel[errCc], Cc[errCc], 'r')
In [ ]:
print(rel[errCl].min())
print(rel[errCc].max())