clear;clc;
function F=PM1(omega)
u1=10;g = 9.81;alpha = 8.1*10^(-3);beta = 0.74;
F=(alpha.*g.^2./omega.^5).*exp(-beta.*(g./omega./u1).^4);
end
function G=K(theta)
thetam=0;s=70;
G=2^(2*s-1)*gamma(s+1)^2./(pi*gamma(2*s+1))*cos((theta-thetam)./2).^(2*s);
end
function C=c(theta)
thetam=pi;s=70;
C=2^(2*s-1)*gamma(s+1)^2./(pi*gamma(2*s+1))*cos((theta-thetam)./2).^(2*s);
end
theta=linspace(0,2.*pi,20);
delta_theta=2.*pi./20;
omega=linspace(0.5,4,20);%线性间距向量,范围为0.1到4,离散点数为1000
delta_omega=3.5/20;
phi=rand(20,20)*2*pi;%生成随机相位
Z=zeros(100,100);%生成100行100列的填充值为0的数组
Z2=zeros(100,100);
[X,Y]=meshgrid(1:2:200);
for t=0:0.1:100
for i = 1:20
for j=1:10
Z = Z+sqrt((9.81./omega(i).^2).*2*PM1(omega(i)).*K(theta(j)).*delta_theta.*delta_omega)*cos(omega(i).^2./9.81.*X.*cos(theta(j))+omega(i).^2./9.81.*Y.*sin(theta(j))-t.*omega(i)+phi(i,j));
Z2 = Z2+sqrt((9.81./omega(i).^2).*2*PM1(omega(i)).*c(theta(j)).*delta_theta.*delta_omega)*cos(omega(i).^2./9.81.*X.*cos(theta(j))+omega(i).^2./9.81.*Y.*sin(theta(j))-t.*omega(i)+phi(i,j));
end
end
subplot(2,2,1);mesh(X,Y,Z);
xlabel('x/m');
ylabel('y/m');
zlabel('h(x,y,1)');
Z=zeros(100,100);
subplot(2,2,2);mesh(X,Y,Z2);
xlabel('x/m');
ylabel('y/m');
zlabel('h(x,y,1)');
Z2=zeros(100,100);
pause(0.1);
end
海面几何建模-二维海面pm谱-动态-matlab
最新推荐文章于 2024-11-11 17:04:04 发布