当前位置:网站首页>【海浪建模1】海浪建模的理论分析和matlab仿真
【海浪建模1】海浪建模的理论分析和matlab仿真
2022-07-05 00:49:00 【fpga和matlab】
1.软件版本
matlab2017b
2.系统原理
海浪建模的设计主要涉及到海浪模型的确定,海浪的各个参数的计算等,本系统,
海浪模型如下:
在现实中,海浪模型的种类有很多,这里采用这个模型,主要是因为该模型的效果和你给出的网站上的效果最为接近。
G为重力加速度,取常数9.8
3.核心源码
global Winds; %风速
global g; %重力加速度
global kk; %仿真模型沙盘和实际区域的大小比例
global Xmax;
global Ymax;
global Dxy;
global flag;
global VX;
global VY;
global VZ;
flag = 0;
g = 9.8; %重力加速度
kk = 1/40; %仿真模型沙盘和实际区域的大小比例
%仿真的间隔
Dxy = 4;
%仿真覆盖的海域范围
Xmax = 1000;
Ymax = 1000;
Start = 200;
x = [Start:Dxy:Xmax];
Ymax2 = round(Ymax/2);
y = [Start:Dxy:Ymax2];
[xo,yo]= meshgrid(x,y);
z2 = zeros(size(x));
%海浪自身运动的波高
r = (3.5325*Winds^2.5)/1000;
%海浪自身运动的波长
k = 2*g/(3*Winds^2);
L = 2*pi/k;
%周期T
T = sqrt(2*pi*L/g);
%波频率
w = sqrt(2/3)*g/T;
t = 0;
while(flag == 0)
disp('the wind speed is');Winds
t = t + 1;
for i = 1:(Ymax2-Start)/Dxy+1
for j = 1:(Xmax-Start)/Dxy+1
%衰减系数
d = sqrt((xo(1,j)-0)^2 + (yo(1,j)-0)^2);
alphas = exp(-0.07*d) - 0.18;
z2(i,j) = alphas*r*cos(k*sqrt((xo(1,j)-0)^2 + (yo(1,j)-0)^2) - w*t);
end
end
%显示局部效果
axes(handles.axes1);
surfl(xo,yo,z2);
axis([Start-50 Xmax+50 Start-50 Ymax2+50 -8 10]);
shading interp;
colormap([143/255,157/255,203/255]);
alpha(0.75);
lightangle(-30,90);
view([VX,VY,VZ]);
pause(0.1);
%海浪自身运动的波长
k = 2*g/(3*Winds^2);
Ls = 2*pi/k;
set(handles.edit1,'String',num2str(Ls));
%计算得到海浪的参数指标
%海浪自身运动的波高
rs = (3.5325*Winds^2.5)/1000;
set(handles.edit3,'String',num2str(rs));
%周期T
T = sqrt(2*pi*L/g);
%速度
c = g*T/(2*pi);
set(handles.edit4,'String',num2str(c));
%波频率
w = sqrt(2/3)*g/T;
set(handles.edit5,'String',num2str(w/2/pi));
end
4.测试结果
仿真操作如上上图所示,
首先点击START开始模拟海浪的效果,然后点击stop可以暂停。
上图3标签就是网站上对应的调整风速度大小的按键。
4所显示就是海浪的各个参数。具体参数的计算见上一页的理论介绍
5这里是3D效果的显示,可以从不同的角度进行观察海浪(MATLAB中GUI的AXIS无法直接用鼠标旋转进行三维显示,所以需要通过这个功能进行显示)
A19-06
边栏推荐
- 初识ROS
- MySQL uses the explain tool to view the execution plan
- [STM32] (I) overview and GPIO introduction
- 测试部新来了个00后卷王,上了年纪的我真的干不过了,已经...
- Innovation leads the direction. Huawei Smart Life launches new products in the whole scene
- 分布式BASE理论
- OpenHarmony资源管理详解
- Summer challenge brings you to play harmoniyos multi terminal piano performance
- Upload avatar on uniapp
- 小程序直播 + 电商,想做新零售电商就用它吧!
猜你喜欢
【C】 (written examination questions) pointer and array, pointer
Oracle case: SMON rollback exception causes instance crash
What you learned in the eleventh week
Specification for fs4061a boost 8.4v charging IC chip and fs4061b boost 12.6V charging IC chip datasheet
Hisilicon 3559 universal platform construction: YUV422 pit stepping record
He worked as a foreign lead and paid off all the housing loans in a year
There is a new Post-00 exam king in the testing department. I really can't do it in my old age. I have
Verilog tutorial (11) initial block in Verilog
College degree, what about 33 year old Baoma? I still sell and test, and my monthly income is 13K+
Parameter passing mechanism of member methods
随机推荐
各大主流编程语言性能PK,结果出乎意料
Binary conversion problem
“薪资倒挂”、“毕业生平替” 这些现象说明测试行业已经...
Distributed base theory
Actual combat simulation │ JWT login authentication
Ap8022 switching power supply small household appliances ACDC chip offline switching power supply IC
【C】(笔试题)指针与数组,指针
The waterfall flow layout demo2 (method 2) used by the uniapp wechat applet (copy and paste can be used without other processing)
Nine Qi single chip microcomputer ny8b062d single key control four LED States
2022.07.03(LC_6111_统计放置房子的方式数)
Innovation leads the direction. Huawei Smart Life launches new products in the whole scene
P4408 [NOI2003] 逃学的小孩(树的直径)
Fs8b711s14 electric wine bottle opener MCU IC scheme development special integrated IC
小程序直播 + 电商,想做新零售电商就用它吧!
It's too convenient. You can complete the code release and approval by nailing it!
JS how to realize array to tree
leetcode494,474
1189. Maximum number of "balloons"
ORB(Oriented FAST and Rotated BRIEF)
SAP ui5 application development tutorial 106 - how to improve the readability of SAP ui5 application routing URL trial version