当前位置:网站首页>【海浪建模2】三维海浪建模以及海浪发电机建模matlab仿真
【海浪建模2】三维海浪建模以及海浪发电机建模matlab仿真
2022-07-05 00:49:00 【fpga和matlab】
1.软件版本
matlab2017b
2.核心源码
function func_power_gen_machine(HHup,R_buoy,seepart,seeall);
if seepart == 0 & seeall == 1
%先产生固定部分
%第一:海底的圆柱体
t = 0:pi/20:2*pi;
RR = 100;
HH = -6.5;
x= 600+RR*sin(t);
y= 300+RR*cos(t)/2;
z=linspace(-8,HH,length(t));
X=meshgrid(x);
Y=meshgrid(y);
Z=[meshgrid(z)]';
surf(X,Y,Z);
xlabel('x'),ylabel('y'),zlabel('z')
shading interp;
colormap([255/255,100/255,103/255]);
hold on
clear X Y Z
%第二:上半部分的柱体
t = 0:pi/20:2*pi;
RR2 = 60;
HH2 = -6;
x= 600+RR2*sin(t);
y= 300+RR2*cos(t)/2;
z=linspace(-8,HH2,length(t));
X=meshgrid(x);
Y=meshgrid(y);
Z=[meshgrid(z)]';
surf(X,Y,Z);
xlabel('x'),ylabel('y'),zlabel('z')
shading interp;
colormap([255/255,100/255,103/255]);
hold on
clear X Y Z
%第三:线圈
HH3 = -8:0.5:-3;
for i = 1:floor(length(HH3)/2)
t = 0:pi/20:2*pi;
RR3 = 10;
x= 600+RR3*sin(t);
y= 300+RR3*cos(t)/2;
z=linspace(HH3(2*i-1),HH3(2*i),length(t));
X=meshgrid(x);
Y=meshgrid(y);
Z=[meshgrid(z)]';
plot3(X,Y,Z,'b');
xlabel('x'),ylabel('y'),zlabel('z')
shading interp;
colormap([255/255,100/255,103/255]);
hold on;
end
alpha(0.5);
clear X Y Z
HHup = HHup + 0.1;
%第四:滑动活塞
t = 0:pi/20:2*pi;
RR2 = 15;
x= 600+RR2*sin(t);
y= 300+RR2*cos(t)/2;
z=linspace(-6+HHup,-5+HHup,length(t));
X=meshgrid(x);
Y=meshgrid(y);
Z=[meshgrid(z)]';
surf(X,Y,Z);
xlabel('x'),ylabel('y'),zlabel('z')
shading interp;
colormap([255/255,100/255,103/255]);
hold on
alpha(0.5);
clear X Y Z
%第五:连接引线
t = 0:pi/20:2*pi;
RR2 = 0.01;
x= 600+RR2*sin(t);
y= 300+RR2*cos(t)/2;
z=linspace(-5+HHup,0+HHup,length(t));
X=meshgrid(x);
Y=meshgrid(y);
Z=[meshgrid(z)]';
plot3(X,Y,Z,'k');
xlabel('x'),ylabel('y'),zlabel('z')
shading interp;
colormap([255/255,100/255,103/255]);
hold on
alpha(0.5);
clear X Y Z
%第六:水面浮标,球形
t=linspace(0,pi,25);
p=linspace(0,2*pi,25);
[theta,phi]=meshgrid(t,p);
x= 600+R_buoy*sin(theta).*sin(phi);
y= 300+R_buoy*sin(theta).*cos(phi)/2;
z=R_buoy*cos(theta)/28 + HHup;
surf(x,y,z);
shading interp;
colormap([255/255,100/255,103/255]);
hold on
alpha(0.5);
alpha(0.5);
end
if seepart == 1 & seeall == 0
%第六:水面浮标,球形
t=linspace(0,pi,25);
p=linspace(0,2*pi,25);
[theta,phi]=meshgrid(t,p);
x= 600+R_buoy*sin(theta).*sin(phi);
y= 300+R_buoy*sin(theta).*cos(phi)/2;
z=R_buoy*cos(theta)/28 + HHup;
surf(x,y,z);
shading interp;
colormap([255/255,100/255,103/255]);
hold on
alpha(0.5);
alpha(0.5);
end 3.测试结果
在上一次的成果基础之上【海浪建模1】,加入了海浪发电机的动态效果,以及简单的计算一下发电量。根据设计要求,整个发电机之后,仿真的效果如下所示:

从这里可以看到,控制界面做了下调整,增加了三个按键,其中,part_View是海面浮标的动态效果,All_View是整个发电机的动态效果,Close the power mach则是关闭发电机的动态效果,仅仅显示海浪的效果,electricity则是显示发电量的效果。整个系统仿真结果如下所示:
最初的海浪建模:

点击Part_View按键:

调整视角滑动条,如下的效果:

点击All_View按键:

调整视角滑动条,如下的效果:

点击Close the power Mach按键:

A19-07
边栏推荐
- pycharm专业版下载安装教程
- 107. Some details of SAP ui5 overflow toolbar container control and resize event processing
- (脚本)一键部署redis任意版本 —— 筑梦之路
- [Yocto RM]10 - Images
- GDB common commands
- [STM32] (I) overview and GPIO introduction
- SAP UI5 应用开发教程之一百零七 - SAP UI5 OverflowToolbar 容器控件介绍的试读版
- Hologres query management and timeout processing
- 《论文笔记》Multi-UAV Collaborative Monocular SLAM
- "Upside down salary", "equal replacement of graduates" these phenomena show that the testing industry has
猜你喜欢

测试部新来了个00后卷王,上了年纪的我真的干不过了,已经...
![P3304 [sdoi2013] diameter (diameter of tree)](/img/5c/984675bf4517481f80f54657c6c7ad.png)
P3304 [sdoi2013] diameter (diameter of tree)

SAP UI5 应用开发教程之一百零六 - 如何提高 SAP UI5 应用路由 url 的可读性试读版

Inventory of more than 17 typical security incidents in January 2022

Hisilicon 3559 universal platform construction: YUV422 pit stepping record

潘多拉 IOT 开发板学习(RT-Thread)—— 实验4 蜂鸣器+马达实验【按键外部中断】(学习笔记)

Playwright recording
![P3304 [SDOI2013]直径(树的直径)](/img/5c/984675bf4517481f80f54657c6c7ad.png)
P3304 [SDOI2013]直径(树的直径)

Verilog tutorial (11) initial block in Verilog

Get to know ROS for the first time
随机推荐
[error reporting] "typeerror: cannot read properties of undefined (reading 'split')“
【C】(笔试题)指针与数组,指针
The performance of major mainstream programming languages is PK, and the results are unexpected
OpenHarmony资源管理详解
URLs and URIs
Complete knapsack problem (template)
揭露测试外包公司,关于外包,你或许听到过这样的声音
Playwright之录制
Daily practice (18): stack containing min function
User login function: simple but difficult
海思3559万能平台搭建:YUV422的踩坑记录
[paper reading] cavemix: a simple data augmentation method for brain vision segmentation
华为百万聘请数据治理专家!背后的千亿市场值得关注
Liangzai's first program life and annual summary in 2022
ORB(Oriented FAST and Rotated BRIEF)
Fs8b711s14 electric wine bottle opener MCU IC scheme development special integrated IC
lambda expressions
Hisilicon 3559 universal platform construction: YUV422 pit stepping record
小程序直播 + 电商,想做新零售电商就用它吧!
pycharm专业版下载安装教程