Simulink: Sine wave generation. Configuration problem.

Hi, While using Simulink, I simply connect a 'sine wave generator' (picked from Simulink>>Sources) to the scope and set the frequency at 100*pi rad/s.
However, on running the simulation, I get a randomly increasing waveform and not a sinusoidal signal of above freq. However, if I set a frequcny such as 1 rad/s, a perfect sine wave is obtained.
I think I must choose a 'continuous' scale to run it and right now maybe a 'discrete scale' is chosen with large step size. May someone suggest a possible remedy?
Thanks.

1 comentario

yassine amine
yassine amine el 24 de Mzo. de 2018
exempel: tried with time=10s , Amplitude=200 , Frequency=100*pi , sample time=0.00001 it gives you a better result

Iniciar sesión para comentar.

 Respuesta aceptada

Guy Rouleau
Guy Rouleau el 6 de Feb. de 2011

1 voto

By default, the Simulink solver chooses the time steps using:
dt = (t_stop-t_start)/50
With the default parameters, it gives 50 Hz, or a period of 0.02. this is why you do not see the 100rad/s sine way proprerly... Nyquist criteria and aliasing!
I made the following blog post exactly on this topic:
http://blogs.mathworks.com/seth/2009/07/14/refining-the-output-of-a-simulation/

4 comentarios

ANUBHAV SINHA
ANUBHAV SINHA el 7 de Feb. de 2011
Thank you. But please also tell about how i can switch from running the simulation from continuous to discrete mode(where i would further choose the step size) and vice versa.
Earlier when i used to run simulation, a block used to appear on top left corner of the screen. However, it seems to have mysteriously dissappeared since last few days! w
Thanks.
Guy Rouleau
Guy Rouleau el 7 de Feb. de 2011
Is that a real question? You are using SimPowerSystems and the block you are talking about is the POWERGUI block!
Make yourself a gift and please read the Getting Started section of the SimPowerSystems documentation:
http://www.mathworks.com/help/toolbox/physmod/powersys/ug/f10-1368.html
Giovanni
Giovanni el 2 de Jun. de 2014
Thank you!!! It helped a lot! :)))))
ARYA VIJAYAN
ARYA VIJAYAN el 23 de Abr. de 2015
Thank you...you helped me..!!

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Etiquetas

Preguntada:

el 6 de Feb. de 2011

Comentada:

el 24 de Mzo. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by