MATLAB Answers

0

Simulink model problem. Input depending on its output

Asked by Mehdi Kemp on 18 Apr 2016
Latest activity Answered by Joachim Schlosser on 18 Apr 2016
Hello, I have a slight problem with my model: the input of my model is depending on the output of it. To make it easy I started with a simple model (only ramp and constant) and to solve this I had the following structure in mind: (ramp goes from 0 to 9 and the treshold of the switch is 0.5).
However this appears to be not working. It either outputs only the constant, either the simulations doesn't even start. I have no idea why and how to solve it because I don't see a mistake in my model. Can someone explain me or tell me how to modify the structure. Thank you in advance.

  0 Comments

Sign in to comment.

Tags

Products

1 Answer

Answer by Joachim Schlosser on 18 Apr 2016

The solver is trying to solve the system that you specified at time 0. So in order to get to to work, you need some sort of delay before feeding the comparison back into the switch. See https://www.mathworks.com/help/simulink/ug/algebraic-loops.html for learning about algebraic loops.
Second, what you are trying could also be described with an easier construct without feedback, by placing the comparison directly after the ramp block.

  0 Comments

Sign in to comment.