How to fix the time values of repeating sequence to get triangular wave?

15 views (last 30 days)
Hello everyone,
I need to make a triangular wave of amplitude 1.0 using repeating sequence block. Base frequency for my simulation is 50 Hz and Carrier freuency is 5000Hz. I do not know how to fix the time values. If I fix the time values [0, 1/(2*5000*1000) , 1/(5000*1000)] as in the attached figure, then what does that mean? Is 5000 for carrier frequency? If yes, then what denotes the value, 1000?
Can anyone please let me know about the setting of time values using repeating sequence?
Thanks in advance.

Accepted Answer

Jon
Jon on 12 Feb 2020
Edited: Jon on 12 Feb 2020
I'm sorry I also have no experience with Simulink for Power Electronics so I can not help you with any issues that are specific to that package.
The repeating sequence block is part of the basic Simulink package so I am familiar with that.
Sorry, I didn't read your question carefully enough. I see now that you wanted to make a triangle wave, rather than a sawtooth. Yes if you just define two points, as I originally described, it will make a sawtooth.
To make a triangle wave please use:
Time Values [0 T/2 T]
Output Values [0 A 0]
I think that the sample frequency of the simulation is determined by the solver, and may be either fixed step size or variable depending upon what you select. Generally Simulink is good at choosing a high enough frequency to give a stable and accurate simulation. In any case the appropriate sampling rate (step size) for the simulation depends upon the dynamics of the components in the system and generally will not depend upon the repetition period of your source waveform (Although the step size certainly has to be smaller than T and perhaps T may be a multiple of the step size)

More Answers (1)

Jon
Jon on 12 Feb 2020
If you want to make a triangular wave of amplitude A with period T just use
Time Values [0 T]
Output Values [0 A]
You don't have to worry about the frequency of your simulation.
  1 Comment
Skyscrapper
Skyscrapper on 12 Feb 2020
Edited: Skyscrapper on 12 Feb 2020
If I choose [0 T] then it will be a sawtooth wave, is not it?
One more question, what will be the sample time of power gui? is it related to the period (T) of repeating sequence?
I am new in simulink for power electronics. That is why, I do not know about this so much.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!