Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can the discontinuity of a function be modelled using ZONE or WHEN indiscriminately?

0
Posted

Can the discontinuity of a function be modelled using ZONE or WHEN indiscriminately?

0

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123