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

Get status of PRVs with EPANET-Matlab toolkit #218

Open
alireza2032 opened this Issue Aug 17, 2018 · 9 comments

Comments

Projects
None yet
3 participants
@alireza2032

alireza2032 commented Aug 17, 2018

Hello all,

When I use d.getLinkStatus for status of PRVs, I get 0 (closed) or 1 (open) for PRVs while in EPANET software we can get three status for PRVs after hydraulic solving. These status are Open (means Inactive or fully open), Active and Closed.
How I distinguish the status of Open with Active in PRVs with EPANET-Matlab toolkit?

Thank you all,
Alireza

@eladsal

This comment has been minimized.

Show comment
Hide comment
@eladsal

eladsal Aug 17, 2018

Member

Thanks @alireza2032 for posting this. The STATUS reported by the function is basically OPEN or CLOSED. There are more STATES for links and nodes. Form the code:

typedef enum {
  XHEAD,        /*   pump cannot deliver head (closed) */
  TEMPCLOSED,   /*   temporarily closed                */
  CLOSED,       /*   closed                            */
  OPEN,         /*   open                              */
  ACTIVE,       /*   valve active (partially open)     */
  XFLOW,        /*   pump exceeds maximum flow         */
  XFCV,         /*   FCV cannot supply flow            */
  XPRESSURE,    /*   valve cannot supply pressure      */
  FILLING,      /*   tank filling                      */
  EMPTYING
} StatType;     /*   tank emptying                     */

So we can add an EN_STATE option to ENgetlinkvalue and ENgetnodevalue and return the exact state. This was also suggested to me by Fernando Martínez.

Thoughts anyone?

Member

eladsal commented Aug 17, 2018

Thanks @alireza2032 for posting this. The STATUS reported by the function is basically OPEN or CLOSED. There are more STATES for links and nodes. Form the code:

typedef enum {
  XHEAD,        /*   pump cannot deliver head (closed) */
  TEMPCLOSED,   /*   temporarily closed                */
  CLOSED,       /*   closed                            */
  OPEN,         /*   open                              */
  ACTIVE,       /*   valve active (partially open)     */
  XFLOW,        /*   pump exceeds maximum flow         */
  XFCV,         /*   FCV cannot supply flow            */
  XPRESSURE,    /*   valve cannot supply pressure      */
  FILLING,      /*   tank filling                      */
  EMPTYING
} StatType;     /*   tank emptying                     */

So we can add an EN_STATE option to ENgetlinkvalue and ENgetnodevalue and return the exact state. This was also suggested to me by Fernando Martínez.

Thoughts anyone?

@eladsal

This comment has been minimized.

Show comment
Hide comment
@eladsal

eladsal Aug 17, 2018

Member

So we can add something like this:

    case EN_STATUS:
      v = hyd->LinkStatus[index]
      break;
Member

eladsal commented Aug 17, 2018

So we can add something like this:

    case EN_STATUS:
      v = hyd->LinkStatus[index]
      break;
@alireza2032

This comment has been minimized.

Show comment
Hide comment
@alireza2032

alireza2032 Aug 17, 2018

Thanks a lot Dear eladsal,
I consider your guide.

alireza2032 commented Aug 17, 2018

Thanks a lot Dear eladsal,
I consider your guide.

@eladsal eladsal self-assigned this Aug 17, 2018

@eladsal eladsal added the enhancement label Aug 17, 2018

eladsal added a commit that referenced this issue Aug 17, 2018

Add option to get link state
Add EN_STATE to ENgetlinkvalue. Related to #218

@eladsal eladsal added the testing label Aug 17, 2018

@eladsal

This comment has been minimized.

Show comment
Hide comment
@eladsal

eladsal Aug 17, 2018

Member

Committed 99e7151. It turned out that a special check for pumps was needed.

Please test!

Member

eladsal commented Aug 17, 2018

Committed 99e7151. It turned out that a special check for pumps was needed.

Please test!

@eladsal eladsal added this to the v2.2 milestone Aug 17, 2018

@Mariosmsk

This comment has been minimized.

Show comment
Hide comment
@Mariosmsk

Mariosmsk Aug 28, 2018

@eladsal , I have tested this now and it's ok! Also the status in the binary file it's the same with state (without events). fyi

With EMT you can get this with function d.getComputedTimeSeries()

image

Mariosmsk commented Aug 28, 2018

@eladsal , I have tested this now and it's ok! Also the status in the binary file it's the same with state (without events). fyi

With EMT you can get this with function d.getComputedTimeSeries()

image

@alireza2032

This comment has been minimized.

Show comment
Hide comment
@alireza2032

alireza2032 Sep 7, 2018

@Mariosmsk , Thanks a lot,
Is it possible to set the initial status of PRVs with EMT in states Open, Close and None (means active)?

alireza2032 commented Sep 7, 2018

@Mariosmsk , Thanks a lot,
Is it possible to set the initial status of PRVs with EMT in states Open, Close and None (means active)?

@Mariosmsk

This comment has been minimized.

Show comment
Hide comment
@Mariosmsk

Mariosmsk Sep 8, 2018

You can use the function d.setLinkInitialStatus(LinkIndex, status) where status is Initial link status (0 = closed, 1 = open)

Mariosmsk commented Sep 8, 2018

You can use the function d.setLinkInitialStatus(LinkIndex, status) where status is Initial link status (0 = closed, 1 = open)

@alireza2032

This comment has been minimized.

Show comment
Hide comment
@alireza2032

alireza2032 Sep 8, 2018

Dear @Mariosmsk ,
Thanks, but, 1=fully open and I want to define the initial link status on None (=active or partially open). Is it possible?

alireza2032 commented Sep 8, 2018

Dear @Mariosmsk ,
Thanks, but, 1=fully open and I want to define the initial link status on None (=active or partially open). Is it possible?

@alireza2032

This comment has been minimized.

Show comment
Hide comment
@alireza2032

alireza2032 Sep 24, 2018

Dear @Mariosmsk ,
Thanks, but, 1=fully open and I want to define the initial link status for PRV valve on None (=active or partially open). Is it possible?

alireza2032 commented Sep 24, 2018

Dear @Mariosmsk ,
Thanks, but, 1=fully open and I want to define the initial link status for PRV valve on None (=active or partially open). Is it possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment