Skip to content

Accessing Unit Model Values #663

Answered by andrewlee94
NCJazzMan65 asked this question in Q&A
Discussion options

You must be logged in to vote

Using the pump work for as an example, you can do the following:

m = ConcreteModel()
m.fs = FlowsheetBlock()

m.fs.pump1 = Pump()

m.fs.pump1.mechanical_work.display()

# Add a total work to the flowsheet that adds work of two pumps
m.fs.total_work = Expression(expr=m.fs.pump1.mechanical_work[0] + m.fs.pump2.mechanical_work[0])

A few complications arise however:

  1. Note that most variables are indexed by time - e.g. in the sum above you need to include a time index on the mechanical_work terms.
  2. IDAES models are hierarchical, so some variables are actually buried a few levels deeper - the most important ones of these are the state variables and properties which are buried in StateBlocks ins…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by NCJazzMan65
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants