def first_order_excitation(k, draft, radius, water_depth): """Returns F/(rho g a^2 A) -- from Drake, but adapted by me to integrate down to the draft depth only (not to the seabed)""" ka = k * radius kd = k * draft kh = k * water_depth # XXX check this! f1 = -1j * (jn(1, ka) - jnd(1, ka) * hankel2(1, ka) / hankel2d(1, ka)) #f1 = -1j * (jn(1, ka) - jnd(1, ka) * hankel1(1, ka) / hankel1d(1, ka)) M = (kd * sinh(kh - kd) + cosh(kh - kd) - cosh(kh)) / (k * cosh(kh)) F = (-sinh(kh - kd) + sinh(kh)) / cosh(kh) X = np.zeros(M.shape + (6, ), dtype=np.complex) X[..., 0] = (-2 * pi / ka) * f1 * F X[..., 4] = (-2 * pi / ka) * f1 * M return X
def excitation_force(w, draft, radius, water_depth): """Excitation force on cylinder using Drake's first_order_excitation""" k = w**2 / 9.81 ka = k * radius kd = k * draft kh = k * water_depth rho = 1025 g = 9.81 # XXX check this! f1 = -1j * (jn(1, ka) - jnd(1, ka) * hankel2(1, ka) / hankel2d(1, ka)) #f1 = -1j * (jn(1, ka) - jnd(1, ka) * hankel1(1, ka) / hankel1d(1, ka)) M = (kd * sinh(kh - kd) + cosh(kh - kd) - cosh(kh)) / (k**2 * cosh(kh)) F = (-sinh(kh - kd) + sinh(kh)) / (k * cosh(kh)) zs = zeros_like(F, dtype=np.complex) X = np.c_[F, zs, zs, zs, M, zs] X *= (-rho * g * pi * radius) * 2 * f1[:, newaxis] return X