-
Notifications
You must be signed in to change notification settings - Fork 57
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
IX model small fix for anions in demo #1420
Changes from 3 commits
06c9888
0841cde
a79e67c
b6784ba
d404c89
fb4c55f
9e06637
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
Param, | ||
Suffix, | ||
log, | ||
value, | ||
units as pyunits, | ||
) | ||
from pyomo.common.config import ConfigBlock, ConfigValue, In | ||
|
@@ -1053,7 +1054,7 @@ def eq_partition_ratio(b): | |
self.target_ion_set, doc="Removed total mass of ion in equivalents" | ||
) | ||
def eq_mass_removed(b, j): | ||
charge = prop_in.charge_comp[j] | ||
charge = abs(value(prop_in.charge_comp[j])) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't know if this would be overkill, but would it be safer to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe the compromise is to use If this value is fixed but the user updates it for some reason you'll still get the correct value put to the solver. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
A There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I tried this initially (i.e., There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes this is the intended behavior - the value of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True, it is currently a Param. I guess I was just thinking of a use case of my own, where I might need to set charge_comp as a Var for parameter estimation since, in that use case, the charge is unknown (just know it should be negative). But- right now charge_comp is just a Param so shouldn’t matter at this point.
kurbansitterley marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return b.mass_removed[j] * charge == pyunits.convert( | ||
b.resin_eq_capacity * b.resin_bulk_dens * b.bed_vol_tot, | ||
to_units=pyunits.mol, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
prop_in.charge_comp[j]
a parameter which should never change?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, should never change and is set as part of the property package configuration.