Can the discontinuity of a function be modelled using ZONE or WHEN indiscriminately?
If you want to model continuous behaviour, you should use the ZONE statement. By forcing the operator WHEN we could use it to model a discontinuity but, as we will see, this is not at all recommendable. For example, we can model the following discontinuous function: y = 8 if (x > 5), otherwise y = 6 Using ZONE this would be: COMPONENT test DECLS REAL x, y CONTINUOUS y = ZONE (x > 5) 8. OTHERS 6. END COMPONENT It can be modelled using two WHEN statements, as follows: COMPONENT test DECLS REAL x, y INTEGER flag DISCRETE WHEN (x > 5) THEN flag = 1 END WHEN WHEN (x <= 5) THEN flag = 0 END WHEN CONTINUOUS y = 8 * flag + 6 * (1 - flag) END COMPONENT It can even be modelled yet another way, using just one WHEN statement: COMPONENT test DECLS REAL x, y INTEGER flag DISCRETE WHEN ((x > 5) OR (x <= 5)) THEN IF (x > 5) THEN flag = 1 ELSE flag = 0 END IF END WHEN CONTINUOUS y = 8 * flag + 6 * (1 – flag) END COMPONENT As we see, the most appropriate (and intuitive) is the first one. back…
Related Questions
- Can I, as a Mexican foreigner, purchase property within the restricted zone under a Mexican Corporation entity?
- Can the discontinuity of a function be modelled using ZONE or WHEN indiscriminately?
- How do I reset the Time Zone function from Eastern Standard Time?
- How do I reset the Time Zone function from Eastern Standard Time?
- What is the Zone Matching function?
- What is the Zone Matching function?