• 大小: 2KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-14
  • 语言: Matlab
  • 标签: MATLAB  海浪模型  

资源简介

利用MATLAB对海浪进行仿真,有二维图形和三维图形

资源截图

代码片段和文件信息

function [z]=erweihailangboxing(fengjipinpushujiaodushu)

% 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=[357911131517];
%---------------------------------------------------

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];
[xy]=meshgrid(xy);
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(xyz);
shading interp;
lightangle(-4530);
set(findobj(gca‘type‘‘surface‘)‘FaceLighting‘‘phong‘‘AmbientStrength‘.3‘DiffuseStrength‘.8...
    ‘SpecularStrength‘.9‘SpecularExponent‘200)



 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        1588  2020-03-25 09:01  海浪模型MATLAB仿真代码.m

评论

共有 条评论