Engineering With Python Rotating Header Image

‘Graphical’ Evaluation to Calculate the Number of Transfer Units – Programming Approach

Plan your solution:

  • Draw a picture, in this case, list all of your data
  • Remember the fundamentals and apply
  1. Draw your material or energy balance envelope (If necessary, not in this case)
  2. Remember [Accumulation = In – Out + Source/Sink]
  • Think about what you need to do and the answer you want
  • You need to perform a numerical integration of data, so you need an integration package
  • You’ll want to print the solution to get the information

How to start your program:

  • With Ipython open, open your editor
  • Label your program (you’ll never remember it, go ahead and label it!)
  • Import the packages you’ll need for solving

hsImportPackages

I looked at the Scipy.integrate documentation and found an integration package that could work with unevenly spaced data.  I chose the Romberg integration package, but you could chose one of the others and try them.

hsInputData

I entered the data for x and x* into Scipy arrays.  As we go on, you’ll see why this is such a nice feature.  You can work with the arrays and perform all kinds of stuff easily.  So, why don’t I quit talking and show you.

Manipulate the Data to get ready for the Integration:

hs653ManipulateData

You see, we can use the ‘arrays’ just like variables and work with them easily.  Very cool.

Set up the Integration and Print the Solution:

hs653RomIntegration

So, that’s is pretty easy, don’t you think.  We’ll discuss the solution in the next post.

Leave a Reply