关键字:
海浪模拟,频谱,长峰波,小振幅波理论,平稳正态随机过程,能量等分法,线性叠加法
(源程序打包了,这是本人本科阶段的毕业论文,涉及到到版权我只将摘要和关键字写上,正文内容没有提供,只提供了源程序;注意,下载后:文中的两个word分别是在二维和三维下海浪的波形图(有所提供的matlab源程序生成)
bopu.m是标准的p-m谱,输入风级数和频率数得到该风级下的p-m谱
erweihailangboxing.m是生成三维海浪波形的源程序,输入风级数,频率数和角度数得到该风级下的海浪波形;
hailangboxing.m是生成二维海浪波形的源程序,输入风级数和频率数得到该风级下的海浪波形;
SDwave.m是分形法所用的源程序,与本线性得加法所采用的 方法不一样。。纯属我毕设的客串。。所得波形为二维的海浪。)
下面是源程序的一部分:
function [z]=erweihailangboxing(fengji,pinpushu,jiaodushu)
% 3 2.438306 16.444115 4.053570
% 5 1.462983 9.866469 2.432142
% 7 1.044989 7.047480 1.737244
% 9 0.812770 5.481373 1.351190
% 11 0.664988 4.484760 1.105519
% 13 0.562683 3.794799 0.935439
% 15 0.487659 3.288826 0.810714
% 17 0.430288 2.901905 0.715336
wavewmin = [2.438306 1.462983 1.044989 0.812770 0.664988 0.562683 0.487659 0.430288];
wavewmax = [16.444115 9.866469 7.047480 5.481373 4.484760 3.794799 3.288826 2.90190];
wavewp=[4.053570 2.432142 1.737244 1.351190 1.105519 0.935439 0.810714 0.715336];
%-----------------------------------------------------
u=[3,5,7,9,11,13,15,17];
%---------------------------------------------------
if fengji>8
fengji=8;
end
if fengji<1
fengji=1;
end
fi=fengji;
wmin=wavewmin(fi);
wmax=wavewmax(fi);
wp=wavewp(fi);
ui=u(fi);
M=pinpushu;
N=jiaodushu;
wavewn=(wmax-wmin)/M;
thetawn=pi/N;
dx=1;
dy=1;
x=[0:dx:500];
y=[0:dy:300];
[x,y]=meshgrid(x,y);
z=zeros(size(x));
for wi=1:M
for ki=1:N
theta=-pi/2+(ki-1)*thetawn;
epsin=rand*2*pi;
w=wmin+(wi-1)*wavewn+wavewn/2;
swi=0.81*exp(-7400/(w*ui+eps).^4)*2*(cos(theta)).^2/(pi*(w.^5+eps));
an=sqrt(2*swi*wavewn*theta);
z1=w*w*x*cos(theta)/9.8+w*w*y*sin(theta)/9.8+epsin;
z=an*cos(z1)+z;
end
end
surfl(x,y,z);
shading interp;
lightangle(-45,30);
set(findobj(gca,'type','surface'),'FaceLighting','phong','AmbientStrength',.3,'DiffuseStrength',.8,...
'SpecularStrength',.9,'SpecularExponent',200)