필터 지우기
필터 지우기

How can I simulate motion of buoy due ocean waves in 2D or 3D ?

조회 수: 27 (최근 30일)
hi, I'm new in matlab. can any one help me please? ocean waves is sine waves, I'm not understand how to simulate the motion of bouy due ocean waves in matlab, maybe any code or toolbox can represent about that.

채택된 답변

Chad Greene
Chad Greene 2015년 3월 18일
Run this:
x = 1:.1:100; % horizontal distance
lambda = 20; % wavelength
c = 5; % wave speed
A = 1.5; % wave amplitude
% Initialize plot:
hold on
xlabel('distance (m)')
ylabel('wave height (m)')
box off
axis([0 100 -5 5])
% Make an animation:
for t= 0:.1:10
% Calculate wave height along x at time t:
y = A*sin((2*pi/lambda)*(x-c*t));
% Plot wave:
hwave = fill([x,100,0],[y,-5,-5],[.01 .44 .61],'edgecolor','b');
% Get buoy height if buoy is at x = 75 m:
ybuoy = y(x==75)+.1;
hbuoy = plot(75,ybuoy,'ko','markersize',16,'markerfacecolor','r');
% Draw a frame, wait 1/10 second, delete objects and repeat loop:
drawnow
pause(.1)
delete([hwave hbuoy])
end
  댓글 수: 4
Muhammad Luqman Amiruddin
Muhammad Luqman Amiruddin 2015년 5월 9일
yes. thank you very much Mr. Chad.
Muhammad Luqman Amiruddin
Muhammad Luqman Amiruddin 2015년 5월 20일
hello Mr. Chad Greene, can i ask you some question again? do you understand about simulink? especially SimHydraulic in Simscape. i have problem to make velocity hydraulic motor to constant. i will attach my system printscreen. thank you.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Toby
Toby 2017년 6월 21일
For anyone that stumbles on this question, there is now a MATLAB/Simulink simulation package for bodies in waves, distributed by the US Dept. of Energy:
If you'd rather code up the basic equations yourself, you can do something like this:
https://www.researchgate.net/publication/272092752_Dynamics_of_a_Floating_Platform_Mounting_a_Hydrokinetic_Turbine

카테고리

Help CenterFile Exchange에서 Oceanography and Hydrology에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by