Varying a sinusoidal input

4 visualizaciones (últimos 30 días)
Reuben Salisbury
Reuben Salisbury el 13 de Abr. de 2020
Comentada: Reuben Salisbury el 14 de Abr. de 2020
I am trying to create a sinusoidal model to simulate the sea as a fixed surface, but I'm not sure how to adapt a simple sinusoidal model so that the wave height and frequency varies within a range (more like the sea). I would change the range for varying sea states, but just need to see how to create a varying amplitude and frequency within a secified range.
  5 comentarios
Reuben Salisbury
Reuben Salisbury el 13 de Abr. de 2020
I am trying to make the value of X0 vary so that the maximum amplitude is not always constant
darova
darova el 13 de Abr. de 2020
try this madness
x = 0:0.01:10;
y = sin(20*x).*sin(x);
plot(x,y)

Iniciar sesión para comentar.

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 13 de Abr. de 2020
Editada: Ameer Hamza el 13 de Abr. de 2020
Try something like this
t = linspace(-10,10,100);
[X,Y] = meshgrid(t);
f = (sin(X+Y)/2+0.5)*0.3+0.3; % frequency change between 0.3 to 0.6
A = (cos(X.*Y/3.5)/2+0.5)*0.3 + 0.7; % amplitude change between 0.7 to 1.0
Z = A.*sin(f.*X).*sin(f.*Y);
surf(X,Y,Z)
It have both variable frequency and amplitude between a specified range.
  7 comentarios
Ameer Hamza
Ameer Hamza el 14 de Abr. de 2020
In this equation
fd = (sin(x)/2+0.5)*0.4+0; % frequency change between 0 to 0.4
0 at the end is the lower range of the frequency and 0.4 is the change in frequency. So
fd = (sin(x)/2+0.5)*1.0+0.5;
will have frequency in range [0.5, 1.5].
Similar parameters are defined for amplitude.
Reuben Salisbury
Reuben Salisbury el 14 de Abr. de 2020
Great, thanks again.

Iniciar sesión para comentar.

Más respuestas (0)

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!

Translated by