Problem: I have a Simulink model consisting 3 S-blocks among other things. An output (a 12x1 array) of these S-blocks is constrained. All elements in this array must be positive (not an absolute value, but more like a saturation constraint) even though the derivatives can be negative.
Question: How do you constraint these values? These are a few things I have tried (and failed)/thought of: 1. Try to change the values inside a user-defined function. Apparently the variable is kept by Simulink to itself since the values did change at the output of this user-defined function, but the output of the S-block is unchanged. I even tried to make the variable global!! 2. Same idea as in no. 1. Instead of a user-defined function, I used Simulink blocks. 3. Same idea as in no. 1 but I placed the constrain inside the S-function. It changed all the derivatives, but the output is all wrong (and it still can be negative).
If you have encountered this problem before or/and you have the solution for it, please e-mail me (preferably) or post it here.