Simulink - Triangular wave form simulation

2 views (last 30 days)
Hi, I'm trying to generate simple triangular wave and connect the output to a scope.
I used the repeating sequence block and the parameters were set as bellow.
I assume this is something to do with simulation settings.(Continuous function, ODE45)
Furthermore I recieved following warning:Warning: The model 'test22' does not have continuous states, hence Simulink is using the solver 'VariableStepDiscrete' instead of solver 'ode45'. You can disable this diagnostic by explicitly specifying a discrete solver in the solver tab of the Configuration Parameters dialog, or by setting the 'Automatic solver parameter selection' diagnostic to 'none' in the Diagnostics tab of the Configuration Parameters dialog
Any ideas to fix? thanks

Accepted Answer

Rashmil Dahanayake
Rashmil Dahanayake on 28 Nov 2013
I got it working. As suggested updated to fixed step (1/(1000*20)) and selected the solver to discrete.
thanks

More Answers (1)

venkat
venkat on 28 Nov 2013
You need to select correct solver configuration. Take solver type Fixed step and make sure the fixed step size is relatively small compared to the repeating sequence signal time period for better accuracy (Since it takes more steps to construct the signal)
Check this
Change solver type to Fixed Step and Fixed -step size to 1/1000/20
For repeating sequence block Take time values as [1/1000/4 1/1000/2 3/1000/4 1/1000]
output values as [0 1 0 -1 0]
Here i am generating a triangular waveform whose frequency is 1000Hz and solver takes 20 steps to constuct each cycle of the waveform.

Categories

Find more on General Applications in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!