Simulink: How to get a cosine wave with 'time dependent frequency'

33 visualizaciones (últimos 30 días)
Preetham Narayana Reddy
Preetham Narayana Reddy el 3 de Ag. de 2017
Respondida: Omur Bas el 30 de Ag. de 2017
I want to generate a cosine wave with the following equation.
x(t) = cos((wc + wx)t) where wx = w0 * cos(wm * t)
The values of wc,w0,wm are known and can be hardcoded. I am not able to put in the time dependency 't' in wx

Respuestas (2)

Meeshawn Marathe
Meeshawn Marathe el 9 de Ag. de 2017
Hi,
To implement this in Simulink, you can try using the "MATLAB Function" Block or the "Interpreted MATLAB Fcn" block. In addition, you would require an input block (In1), found in Simulink Sources.
Define a vector for time "t" (Ex: t=(0:0.01:10)') in the workspace. Go to Configuration Parameters -> Data Import/Export, select input and add [t,t] in the box. (One value of "t" is for simulation time and the other is for the input In1).
If you use a MATLAB function block, you can define the constants within it and write the cosine expression. If you use the other block, you would have to enter the constant values in the command prompt prior to running the model. Connect In1->Fcn block->Scope
Cheers!

Omur Bas
Omur Bas el 30 de Ag. de 2017
To find time explicitly in Simulink, you can use the "Clock" block.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by