How can I simulate motion of buoy due ocean waves in 2D or 3D ?
29 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Muhammad Luqman Amiruddin
am 10 Mär. 2015
Kommentiert: rees adah
am 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.
Akzeptierte Antwort
Chad Greene
am 18 Mär. 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 Kommentare
Weitere Antworten (1)
Toby
am 21 Jun. 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 Kommentar
Siehe auch
Kategorien
Mehr zu Oceanography and Hydrology finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!