Closed msdogan closed 7 years ago
@msdogan D653b.2000-02-28 has a constrained flow, but cub is null. This because we set lb=0, ub=null for costs for all constant costs. Then for constrained flows, we set lb=ub if constrained flow. The the final processing setup is to set all ub == null to Max UB, but the lb == null is not handled.
Thoughts?
@jrmerz yes, looks like they are all constrained SINK
flows, so lb
must equal to ub
. I don't understand how cub
gets null.
EDIT: It should be lb=ub=data from time-series
Because the sinks cost is set to constant. Which we assign here: https://github.com/ucd-cws/calvin-network-tools/blob/master/nodejs/matrix/cost.js#L232
PS, great tool for viewing JSON in browser if you don't have it https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc
okay, zero cost is okay but for node D653b
there are two types of flow
first one is correct, with time series. After that there is another flow
equal to null. Could it be the reason for null dataset?
{"type":"Feature",
"geometry":{"type":"Point","coordinates":[-120.920994,37.738836]},
"properties":{"prmname":"D653b",
"description":"Stanislaus River accretion & depletion",
"type":"Junction",
"inflows":{"default":{"description":"Accretion: Stanislaus River d/s Goodwin Reservoir","inflow":{"$ref" : "inflows/default.csv"}}},
"sinks":[{"default" : {"description" : "Depletion: Stanislaus River d/s Goodwin Reservoir", "costs" : {"type":"Constant",
"cost":0}, "bounds" : [{"type":"EQT","bound": {"$ref":"./sinks/default/EQT.csv"}}], "flow" : {"$ref" : "./sinks/default/flow.csv"}}}],
"flow":null}}
So for some reason, the code is not picking lb and ub from "$ref":"./sinks/default/EQT.csv"
right?
yup.
Ok, think I found the problem... data issue. And there are lots like that. Every leap year, the last day of Feb is marked as the 29th (seems logical), but we check for the 28th, based on flow. I can fix.
Yes, you are right, they are all FEB. Thanks a lot.
Wait, flows are set to 29th... I think this is my 'fake the flow' logic... when I create the dates w/o the existence of flow. Need to check for leap year.
Ok, fix pushed, give it a try.
alright, now correct lb and ub show up in the matrix for leap years. Thanks.
D744a.2000-02-29 SINK.2000-02-29 0 0 1 0.647345 0.647345
pushed to npm calvin-network-tools@1.0.50
@jrmerz I am having some problem with some (not all of them)
SINK
links. For some time steps,lb
is not written in the network matrix.Here are a few example links. There is probably more than that:
Below is the error message from pyomo:
I can't think of any reason why this would be happening.