How can I simulate motion of buoy due ocean waves in 2D or 3D ?
29 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Muhammad Luqman Amiruddin
el 10 de Mzo. de 2015
Comentada: rees adah
el 17 de Mayo de 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.
Respuesta aceptada
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
Más respuestas (1)
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
1 comentario
Ver también
Categorías
Más información sobre Oceanography and Hydrology en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!