function [u,udot,w,wdot] = linwavKin(d,z,H,k,x,t) %linwavKin calculates the particle kinematics under a linear wave %according to the linear velocity potential for INTERMEDIATE depth. %Input: % d=h - [m] water depth (good to separate h from capital H if converting to other code language) % z - [m] vector of vertical positions (positive upwards, zero at still water level) % H - [m] wave height, m % k - [-] wave number, 2*pi/lambda % x - [m] position along wavelength, can only take a single value in this code % t - [s] wave phase period - can be single value or a vector set between 0:T s % Outputs: % u - [m/s] horizontal particle velocity % udot = dudt - [m/s^2] horizontal particle acceleration % w - [m/s] vertical particle velocity % wdot = dwdt - [m/s^2] vertical particle acceleration us = 0; % [m/s] stream velocity zero in this code. %%%%%%%%%%%%% g=9.81; % [m/s^2] gravitational acceleration omega=sqrt(g*k*tanh(k*d)); % [rad/s] angular wave frequency, zeta_a=H/2; % [m] wave amplitude u = (omega*zeta_a * cosh(k*(z+d))/sinh(k*d)) .* sin(omega.*t-k.*x)+us; w = omega*zeta_a*sinh(k*(z+d))/sinh(k*d) .* cos(omega.*t-k.*x); udot = omega^2*zeta_a*cosh(k*(z+d))/sinh(k*d) .* cos(omega*t-k.*x); wdot = -omega^2*zeta_a*sinh(k*(z+d))/sinh(k*d) .* sin(omega.*t-k.*x); end