Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Up- and down-crossing aware truth states #447

Closed
SouthEndMusic opened this issue Jul 22, 2023 · 0 comments · Fixed by #492
Closed

Up- and down-crossing aware truth states #447

SouthEndMusic opened this issue Jul 22, 2023 · 0 comments · Fixed by #492
Labels
control Rule based control of physical layer

Comments

@SouthEndMusic
Copy link
Collaborator

Motivation

The line below shows a range of a to-be-controlled parameter/state s, with indicated upper and lower bounds (ub, lb) and upper and lower setpoints (usp, lsp).

lb   *   lsp            usp    *    ub      
|---------|--------------|----------|

s ->

Quite common control use cases are of these types:

  • Once s < lb, s must rise up to lsp;
  • Once s > ub, s must fall down to usp.

Up to now, we used to view this problem as 'when the parameter s is in one of these starred (*) regions, there must be some memory that says whether s is on its way to a setpoint or not'.

However, DiscreteControl only takes action at changes of conditions. Therefore, it is useful to consider how the parameter s entered the starred regions. More specifically:

  • s is on its way to lsp if it did an up-crossing at lb;
  • s is on its way to usp if it did a down-crossing at ub.

Proposal by example

Say we have the following conditions for the situation described above:

  1. s > lb
  2. s > lsp
  3. s > usp
  4. s > ub

and also the control states 'rise' and 'fall', 'free' for making s rise, fall, and change freely respectively.

We introduce truth values in addition to T and F:

  • U for an up-crossing, which is a special case of T;
  • D for a down-crossing, which is a special case of F.

Then for the upper set point case, the control logic can be as follows (using the wildcard 'A' from #440):

  • AAAT -> 'fall'
  • AAAD -> 'fall'
  • AATF -> 'free'
  • AAFA -> 'free'

Note that the second case implies the third case. So, we say that crossing-type specific truth states take precedence.

Shortcoming

The above does not work when an extra condition on s is added within the relevant starred region.

@SouthEndMusic SouthEndMusic added control Rule based control of physical layer needs-refinement Issues that are too large and need refinement improvement labels Jul 22, 2023
@github-project-automation github-project-automation bot moved this to To do in Ribasim Jul 22, 2023
@SnippenE SnippenE removed the needs-refinement Issues that are too large and need refinement label Aug 15, 2023
@SnippenE SnippenE moved this from To do to 🏗 In progress in Ribasim Aug 15, 2023
SouthEndMusic added a commit that referenced this issue Aug 15, 2023
Fixes #447, fixes
#454.

---------

Co-authored-by: Bart de Koning <[email protected]>
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Ribasim Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
control Rule based control of physical layer
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants