Closed zdebanos closed 4 months ago
Hi Stepan Just a little problem: you put the C-code into the STUPD part of the program. STUPD (state update) is used to update the internal states of the block and it is only called if you have states in your block. This means that the STUPD part performs this equation:
x' = Ax+Bu
Usually your part of code should be inserted in the "OUT" part of the code .
Just a little theory remembering: Each block is described by the 2 equations
x' = Ax + Bu y = Cx + Du
in continuous time. and
x[k+1] = Ax[k]+Bu[k] y[k] = Cx[k]+Du[k]
in discrete time. In both cases the first equation updates the internal states of the block and should be called as SECOND function, and the second equation uses the internal states and the inputs to actualize the outputs.
Got it, thank you! I deleted the STUPD flag from the functions.
Sorry for my (probably pedantic) explications, but as retired professor I profit from every possibility to continue transmit my old experience! Thanks for the update.
The output is only one, outputting the minimum (or maximum).
I've put these blocks under the math library.