Effacer les filtres
Effacer les filtres

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

26 vues (au cours des 30 derniers jours)
Muhammad Luqman Amiruddin
Muhammad Luqman Amiruddin le 10 Mar 2015
Commenté : rees adah le 17 Mai 2021
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.

Réponse acceptée

Chad Greene
Chad Greene le 18 Mar 2015
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 commentaires
Muhammad Luqman Amiruddin
yes. thank you very much Mr. Chad.
Muhammad Luqman Amiruddin
Muhammad Luqman Amiruddin le 20 Mai 2015
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.

Connectez-vous pour commenter.

Plus de réponses (1)

Toby
Toby le 21 Juin 2017
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

Catégories

En savoir plus sur Oceanography and Hydrology dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by