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

32 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

Chad Greene
Chad Greene el 18 de Mzo. de 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 comentarios
Muhammad Luqman Amiruddin
Muhammad Luqman Amiruddin el 9 de Mayo de 2015
yes. thank you very much Mr. Chad.
Muhammad Luqman Amiruddin
Muhammad Luqman Amiruddin el 20 de Mayo de 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.

Iniciar sesión para comentar.

Más respuestas (1)

Toby
Toby el 21 de Jun. de 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

Categorías

Más información sobre Oceanography and Hydrology en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by