% Oving morison forelesning clear all, close all, clc format compact, format shortg marineconst; rho_s=1.025; CD=1; CM=2; D=2; d=1; hs=25; zb=-60 zt=-35; zeta_a=16/2; % half wave height T=12; hv=[150]; % Water depth 350 30 5 for i=1:length(hv) h=hv(i); [lambda,depth]=lambda_cal(T,h); omega=2*pi/T; % Vinkel acceleration k=2*pi/lambda; z=[-60 -47.5 -35]; % z positiv opp %z=-60:0.5:-35; x=0; % lar bolgen gå forbi, (t=0 fryser bolgen) Dz=(d-D)/hs*z+D-(d-D)/hs*zb; Az=pi*Dz.^2/4; % Horisontal hastighet storst ved pi/2 omegat_u=pi/2; u(i,:)=(omega*zeta_a * cosh(k*(z+h))/sinh(k*h)) * sin(omegat_u-k*x); % Vertikal hastighet storst ved 0, 3pi omegat_w=0; w(i,:)=omega*zeta_a*sinh(k*(z+h))/sinh(k*h)*cos(omegat_w-k*x); % Horisontal acceleration storst ved maks vertikal hastighet omegat_udot=omegat_w; udot(i,:)=omega^2*zeta_a*cosh(k*(z+h))/sinh(k*h)*cos(omegat_udot-k*x); omegat_wdot=omegat_u; wdot(i,:)=-omega^2*zeta_a*sinh(k*(z+h))/sinh(k*h)*sin(omegat_wdot-k*x); % t=T/4; %omega=2*pi/T % Horisontal acceleration storst ved maks vertikal hastighet % [u(i,:),wnan(i,:),udotnan(i,:),wdot(i,:)]=particlemotion(t,x,omega,k,h,z,zeta_a,0); % t=0; %omega=2*pi/T % Vertikal acceleration storst ved maks horisontal hastighet % [unan(i,:),w(i,:),udot(i,:),wdotnan(i,:)]=particlemotion(t,x,omega,k,h,z,zeta_a,0); dFD(i,:)=CD*0.5*rho_s*Dz.*abs(u).*u; dFM(i,:)=CM*rho_s*Az.*udot; end u udot dFD dFM FD=trapz(z,dFD(1,:)) % [N] FM=trapz(z,dFM(1,:)) % [N] FD2=0.5*trapz(dFD(1,:)) return % Inte rätt än MD=sum(dFD.*z) zD=MD/sum(dFD(1,:)) aD=zD-zD MM=sum(dFM.*z) zM=MM/FM aM=zM-zb