How to create animation of wave pattern h(x,y,t) = Acos(2*pi*t/T-2*pi*x/L) with T=4s , L=12m, -300<=x<=300, -300<=y<=300 , 0<=t<=20

2 ビュー (過去 30 日間)
clc
clear all
A=1;
T=4;
L=12;
syms t
t=0:1:20;
x=-300:10:300;
H=A*cos(2*pi*t/(T)-2*pi*x/(L))
for k=1:length(t)
plot(t(k),H(k),'+')
axis([-0.5 20.5 -2 2])
pause(0.25)
end
  3 件のコメント
Aagam Jain
Aagam Jain 2020 年 4 月 20 日
Wave Patterns In the open ocean under circumstances where the wind is blowing steadily in the direction of wave motion, successive wavefronts tend to be parallel. The height of the water at any point might be represented by the equation
h(x,y,t)= A cos (2pi*t/T - 2pi*x/L
where T is the period of the waves in seconds, L is the spacing between wave peaks, and t is current time. Assume that the wave period is 4 s and the spacing between wave peaks is 12 m. Create an animation of this wave pattern for a region of -300 m < x < 300 m and -300 m <y < 300 m over a time of 0 < t < 20 s using erase and redraw.
This is the full actual question and i too dint find y in the equation, so i tried solving it for x and t so if anyone could do that ...?
And this ques is from MATLAB for Engineers 5th edition (ques no. 13.10) and if there is any mistake in the ques above plz do comment so that i can solve this ques
BALAJI KARTHEEK
BALAJI KARTHEEK 2020 年 4 月 20 日
where is y in h(x,y,t)= A cos (2pi*t/T - 2pi*x/L

サインインしてコメントする。

採用された回答

BALAJI KARTHEEK
BALAJI KARTHEEK 2020 年 4 月 20 日
clc
clear all
A=1;
T=4;
L=12;
syms t
t=0:(((300-(-300))/10)^-1)*20:20;
x=-300:10:300;
H=A*cos(2*pi*t/(T)-2*pi*x/(L));
for k=1:length(t)
plot(t(k),H(k),'*')
axis([-0.5 20.5 -2 2])
pause(0.25)
end
To evaluate H t and x array length must be same, and rest all wil be same... u will get the graph as a dynamic one, varying with respect to time thats it,,
  2 件のコメント
Aagam Jain
Aagam Jain 2020 年 4 月 20 日
how and why did u write the equation of time in that form.?
BALAJI KARTHEEK
BALAJI KARTHEEK 2020 年 4 月 20 日
i just keeping the length of the time equal to the length of the x

サインインしてコメントする。

その他の回答 (1 件)

darova
darova 2020 年 4 月 20 日
Here is the solution

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

製品


リリース

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by