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

Todini Index Calculation for the Net6 network - Values outside the range [0,1] #418

Closed
amsinhaubc opened this issue Apr 30, 2024 · 5 comments
Assignees
Labels

Comments

@amsinhaubc
Copy link

Hi,

I am using the Net6.inp network, without any modifications, as available from the WNTR-Github site. I find that the Todini Index (TI) values exceed the anticipated range [0,1] many a times over the 96-hours. For example, at 25th hour, it even reaches the value of 30.

What could possibly explain this?

Thanks in advance.

Net6_TI_Screenshot
@kbonney
Copy link
Collaborator

kbonney commented May 1, 2024

I was able to reproduce this with the following snippet:

import wntr

inp_file = 'Net6.inp'
wn = wntr.network.WaterNetworkModel(inp_file)
wn.options.time.duration = 96*3600
sim = wntr.sim.WNTRSimulator(wn)
results = sim.run_sim()

head = results.node["head"]
pressure = results.node["pressure"]
demand = results.node["demand"]
flowrate = results.link["flowrate"] 
todini = wntr.metrics.hydraulic.todini_index(head, pressure, demand, flowrate, wn, 21.09)
todini.plot()

Not sure why we are seeing those unexpected values, though. Will continue to look into this.

@amsinhaubc
Copy link
Author

I was able to reproduce this with the following snippet:

import wntr

inp_file = 'Net6.inp'
wn = wntr.network.WaterNetworkModel(inp_file)
wn.options.time.duration = 96*3600
sim = wntr.sim.WNTRSimulator(wn)
results = sim.run_sim()

head = results.node["head"]
pressure = results.node["pressure"]
demand = results.node["demand"]
flowrate = results.link["flowrate"] 
todini = wntr.metrics.hydraulic.todini_index(head, pressure, demand, flowrate, wn, 21.09)
todini.plot()

Not sure why we are seeing those unexpected values, though. Will continue to look into this.

Thanks for looking into this.

@kaklise
Copy link
Collaborator

kaklise commented May 2, 2024

The Todini index generally results in values between 0 and 1, but values below 0 and above 1 are possible. The paper by Jayaram includes an explanation and suggests a modified resilience index (MRI), which is also included in WNTR.

WNTR function for MRI: https://usepa.github.io/WNTR/apidoc/wntr.metrics.hydraulic.modified_resilience_index.html#wntr.metrics.hydraulic.modified_resilience_index

Jayaram, N., & Srinivasan, K. (2008). Performance‐based optimal design and rehabilitation of water distribution networks using life cycle costing. Water resources research, 44(1).

@amsinhaubc
Copy link
Author

The Todini index generally results in values between 0 and 1, but values below 0 and above 1 are possible. The paper by Jayaram includes an explanation and suggests a modified resilience index (MRI), which is also included in WNTR.

WNTR function for MRI: https://usepa.github.io/WNTR/apidoc/wntr.metrics.hydraulic.modified_resilience_index.html#wntr.metrics.hydraulic.modified_resilience_index

Jayaram, N., & Srinivasan, K. (2008). Performance‐based optimal design and rehabilitation of water distribution networks using life cycle costing. Water resources research, 44(1).

Thanks @kaklise for your reply and the link to the paper. Please correct me if I am wrong, the highest Todini Index attainable is one, while MRI can theoretically range till infinity.

@kaklise
Copy link
Collaborator

kaklise commented May 17, 2024

Todini index generally results in values between 0 and 1, but values below 0 and above 1 are possible.
MRI can be over 1, but cannot be below –1 if elevation and pressure are positive.
I'm not sure if the theoretical upper limit is infinity, but both values can be > 1.

@kaklise kaklise closed this as completed Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants