Electrical – Sine Function on Simulink

frequencyfunctionMATLABsimulinksine

I'm trying to add the following function on my Simulink model.

enter image description here

where C, B, and N are already variables in my file. Is the correct way to multiply omega by the gains 3N and N/2 an input that into the sine (as shown)

enter image description here

or should I change the value of the frequency? If so, what would be the right value?

enter image description here

Thanks

Best Answer

It really comes down to how much control you want.
\$f_1(\omega) = Csin(\frac{Nt}{2}\omega)\$

\$f_2(\omega) = Bsin(3Nt \omega)\$

In your two equations the gain (C,B) and frequency (N) are your tunabled. Your attempt to realize this in simulink is purely on gain which produces:

\$f_1(\omega) = \frac{N}{2}sin(\omega t)\$

\$f_2(\omega) = 3Nsin(\omega t)\$

If you want a sinus source matching these equations then use the source block configured appropriately enter image description here

If you want to be able to vary the frequency and/or the amplitude use the SineWave function block. Feed in a ramp to set \$3N\omega\$ and an output gain block to set C

enter image description here

Your variables: B,C, N \$\omega\$ can then be set in an m-file or datadictionary.

IF you need these parameters varying this is also viable but a multiplying block is required and the ramp needs a varying slope (maybe via a mux)