Showing posts with label Science. Show all posts
Showing posts with label Science. Show all posts

Saturday, June 20, 2020

The stress tensor

It's a tricky bit of business--something I (shamefully) never fully understood in graduate school. That always bothered me.

Continuum mechanics is wonderful. There, I said it, and now we can move on.

Ok, so the stress tensor.

It is like a vector, but not really. It's bigger than that. In reality, a scalar (such as temperature) is a zeroth order tensor. It only has a value. You can still have scalar fields (temperatures at given points), but they don't have direction. They just are, in the place where they are.

A vector on the other hand, like wind velocity, has direction and a magnitude (size or length) at some location. Therefore wind velocity can be described as a vector field. At each point you have a direction and magnitude (length) of velocity--speed is the magnitude of the velocity vector (how long it is, regardless of direction). A vector is a first order tensor.

Tensors (they can be anything second order and above), are a bit different. Some say they have two directions, and lack an intuitive sense. I prefer to think of one of the directions as the plane of a cube. As far as physical intuitive relationships go this works, because you can think of each dimension in space (x, y, and z or i, j, and k) as having a vector associated with it. Consider the cube. You can push on the cube on three different sets of opposite faces. Each face has one resultant vector applied (perhaps a force vector), and if the forces are equal and opposite, the resultant force vector on that face is zero.

This idea of tensors is commonly applied by chemical engineers with respect to the stress tensor. It describes an infinitely small fluid element in equilibrium. Think a tiny smidge (cube) of water in a pipe flow--it can be any bit of water (fluid) anywhere.
Components of the Cauchy stress tensor in Cartesian coordinates


The little cube will have forces acting:
normal (perpendicular, like a bottle standing on a table, putting a bit of weight on the table) to its faces (hydrostatic stress terms),
and it may have some forces that act on the sides in parallel directions (picture placing your hand flat on top of a slinky and moving it in a parallel direction to the ground as the bottom remains in place) to the sides / faces (shear stress terms) of the cube.
Uni-axial terms (contribute to Hydrostatic stress): σ11, σ22, and σ33
Hydrostatic stress = (σ11 + σ22 + σ33) / 3 = σh
 {\displaystyle \sigma _{h}=\displaystyle \sum _{i=1}^{n}\rho _{i}gh_{i}}
Shear stress terms: σ12, σ13, σ21, σ23, σ31, and σ32

Stress terms in the full tensor, using matrix notation:
{\boldsymbol  {\sigma }}=\left[{{\begin{matrix}\sigma _{{11}}&\sigma _{{12}}&\sigma _{{13}}\\\sigma _{{21}}&\sigma _{{22}}&\sigma _{{23}}\\\sigma _{{31}}&\sigma _{{32}}&\sigma _{{33}}\\\end{matrix}}}\right]\equiv \left[{{\begin{matrix}\sigma _{{xx}}&\sigma _{{xy}}&\sigma _{{xz}}\\\sigma _{{yx}}&\sigma _{{yy}}&\sigma _{{yz}}\\\sigma _{{zx}}&\sigma _{{zy}}&\sigma _{{zz}}\\\end{matrix}}}\right]\equiv \left[{{\begin{matrix}\sigma _{x}&\tau _{{xy}}&\tau _{{xz}}\\\tau _{{yx}}&\sigma _{y}&\tau _{{yz}}\\\tau _{{zx}}&\tau _{{zy}}&\sigma _{z}\\\end{matrix}}}\right]

Hydrostatic stress is isotropic, meaning that it acts the same way in all directions.
{\displaystyle \sigma _{h}\cdot I_{3}=\sigma _{h}\left[{\begin{array}{ccc}1&0&0\\0&1&0\\0&0&1\end{array}}\right]=\left[{\begin{array}{ccc}\sigma _{h}&0&0\\0&\sigma _{h}&0\\0&0&\sigma _{h}\end{array}}\right]}

Under the conservation of angular momentum the moments (with respect to an arbitrary point) from the stresses on the faces must balance, and it becomes clear that the tensor must be symmetric:
{\displaystyle {\begin{aligned}M_{O}&=\int _{S}(\mathbf {r} \times \mathbf {T} )dS+\int _{V}(\mathbf {r} \times \mathbf {F} )dV=0\\0&=\int _{S}\varepsilon _{ijk}x_{j}T_{k}^{(n)}dS+\int _{V}\varepsilon _{ijk}x_{j}F_{k}dV\\\end{aligned}}}

or in simpler terms:
{\displaystyle \sigma _{12}=\sigma _{21}} AND {\displaystyle \sigma _{23}=\sigma _{32}} AND {\displaystyle \sigma _{13}=\sigma _{31}} OR:
{\displaystyle \sigma _{ij}=\sigma _{ji}}

The stress tensor is a fundamental piece of the Cauchy momentum equation, which relates:
the material derivative, {\displaystyle {\frac {D\mathbf {u} }{Dt}}\ [\mathrm {m/s^{2}} ]}
the divergence of the stress tensor, {\displaystyle \nabla \cdot {\boldsymbol {\sigma }}={\begin{bmatrix}{\dfrac {\partial \sigma _{xx}}{\partial x}}+{\dfrac {\partial \sigma _{yx}}{\partial y}}+{\dfrac {\partial \sigma _{zx}}{\partial z}}\\{\dfrac {\partial \sigma _{xy}}{\partial x}}+{\dfrac {\partial \sigma _{yy}}{\partial y}}+{\dfrac {\partial \sigma _{zy}}{\partial z}}\\{\dfrac {\partial \sigma _{xz}}{\partial x}}+{\dfrac {\partial \sigma _{yz}}{\partial y}}+{\dfrac {\partial \sigma _{zz}}{\partial z}}\\\end{bmatrix}}[\mathrm {Pa/m=kg/m^{2}\cdot s^{2}} ]}
density at a point, {\displaystyle \rho \ [\mathrm {kg/m^{3}} ]}
and the accelerations caused by body forces (gravitational acceleration mostly), {\displaystyle \mathbf {f} ={\begin{bmatrix}f_{x}\\f_{y}\\f_{z}\end{bmatrix}}\ [\mathrm {m/s^{2}} ]}

So all put together, a form of the Cauchy Momentum equation:
{\displaystyle {\frac {D\mathbf {u} }{Dt}}={\frac {1}{\rho }}\nabla \cdot {\boldsymbol {\sigma }}+\mathbf {f} }
[further explanations of these terms below]

This describes momentum transport in any continuum (not just fluids), and from the Cauchy Momentum equation, the Navier-Stokes equations can be derived. The N-S equations describe the motion of viscous fluids in continuum mechanics. These equations are fundamental to the field of fluid mechanics (and are of mathematical interest).

Navier-Stokes equations (incompressible form):
{\displaystyle \overbrace {\underbrace {\frac {\partial \mathbf {u} }{\partial t}} _{\begin{smallmatrix}{\text{Variation}}\end{smallmatrix}}+\underbrace {(\mathbf {u} \cdot \nabla )\mathbf {u} } _{\begin{smallmatrix}{\text{Convection}}\end{smallmatrix}}} ^{\text{Inertia (per volume)}}\overbrace {-\underbrace {\nu \,\nabla ^{2}\mathbf {u} } _{\text{Diffusion}}=\underbrace {-\nabla w} _{\begin{smallmatrix}{\text{Internal}}\\{\text{source}}\end{smallmatrix}}} ^{\text{Divergence of stress}}+\underbrace {\mathbf {g} } _{\begin{smallmatrix}{\text{External}}\\{\text{source}}\end{smallmatrix}}.}

This form has been simplified for use with incompressible fluids (like water), and for a Newtonian fluid (fluid with shear stress directly proportional to fluid velocity) like water the diffusion term describes the 'diffusion of momentum' through the fluid. And if the 'external source' describes a conservative field, the internal source (thermodynamic 'specific' work) can be combined with the external source to give hydraulic head pressure, or just the fluid pressure:
{\displaystyle {\frac {\partial \mathbf {u} }{\partial t}}+(\mathbf {u} \cdot \nabla )\mathbf {u} -\nu \,\nabla ^{2}\mathbf {u} =-\nabla h.}

What about the stress tensor? Where is it? From the Cauchy Momentum equation, the stress tensor disappears but yields a direct relationship, through fluid viscosity μ, to the rate of change of velocity in each direction, which is a useful and easily measurable / observable quantity in fluid motion:
\tau =\mu {\frac  {\partial u}{\partial y}},

Wikipedia has an excellent description of this constitutive equation:


That's pretty much the point of the stress tensor. It's a very useful concept that under-girds many significant and practical calculations in myriad fields of mechanics from weather models, to fluid mechanical models, to physics engines used in video games.

Descriptions of pieces of the Cauchy Momentum equation
[Material derivative]: describes the rate of change of the velocity field (local velocity of the fluid) in time and space: {\displaystyle \partial _{t}\mathbf {u} +\mathbf {u} \cdot \nabla \mathbf {u} }

[divergence of the stress tensor]: describes how the force per unit volume (dimensions and units: 'Pressure / length' SI units are Pa / m = (N / m^2) /m = N / m^3 which gives dimensions 'Force / volume' equivalence) is related to how the stress tensor components change with each direction. This is essentially telling you how the force on a face (per unit volume) is related to how much the stress components on each face are changing in the direction they act.

Sunday, June 16, 2019

Genetic recombination & 23andMe

Today (when I started this post many months ago) I compared the results of my genetic sequencing with my parents (predictable to be honest). We share a lot--and my parents share none between the two of them.

I'll be transparent. Much of what I learned in 10th grade biology was beyond my ability to apply practically here, and despite doing significant work in mechanobiology and TA'ing a biomolecular engineering class in grad school I was floundering trying to come up with an explanation for completely identical, half identical, and nonidentical segments.

The completely identical and nonidentical were simple concepts. If you compare with a sibling, then the genetic material you received from your parents is the same on both "halves" of the chromosome for identical segments. Nonidentical segments are when neither of the chromosome halves match up.

I highly recommend this post from Barry Starr at Stanford (Ask A Geneticist). He actually explains what most articles fail to address on a meaningful level.

My goal is to briefly recap Barry's explanation, and expound on the possibilities.

Let's start with two parents:
                                                 Mom                                       Dad
They each have genetic code inherited from their parents. We'll identify genetic material in their offspring as coming from a particular chromosome using these colors. On the left, is a chromosome pair of one parent (yellow & orange), and on the right is a chromosome of the other parent (blue & red).

These parents have two children:
                                            Kid A                                             Kid B
Each child inherits material from one parent on one half of the chromosome, and material from the other parent on the other half.

If you consider Kid A, the left chromosome of the pair comes completely from dad, so that whole segment is "half identical" with dad. The right chromosome of Kid A's pair is "half identical" with mom because it contains genetic material entirely from mom.

Ok, now let's compare the siblings to each other.

The following segments are "completely identical" between the two kids:
                                             Kid A                                          Kid B
In the boxes you can see that the colors of each pair match--this is a segment that is "completely identical" because it contains the exact same genetic material from each parent.

Results from the site 23andMe display full siblings the following way (7 chromosomes shown):
Consider chromosome #2 above. The purple color refers to the boxed portion of our siblings above--this part of the chromosome is shared identically by both siblings.
There are large segments in purple, but there is significantly more in the pink color. Pink is referring to "half identical" segments.

The following segments are "half identical" between the two kids:
                                              Kid A                                         Kid B
In the top box the kids share DNA from Dad (red), in the second box the kids share DNA from mom (yellow), in the third box the kids share DNA from Dad (blue), in the fourth box the kids share DNA from data (blue), and in the fifth box the kids share DNA from mom (orange). In each case, the second non-matching chromosome in the pair still contains genetic material from the other parent, but it comes from a different half of the parent's chromosome compared to their sibling.


That leaves "nonidentical" segments. In the 23andMe manner of displaying the comparison it's represented with light grey lines.

The following segments are "nonidentical between the two kids:
                                              Kid A                                         Kid B
None of the boxed segments have the same DNA between the two kids (though if you look closely you can see that I goofed a smidge, and the yellow/orange transition in the middle box doesn't line up perfectly).

Ok, so hopefully the terms are more meaningful, but what of incidence?

Let's isolate small segment and look at the possibilities.

The left half of each chromosome can come from either of Dad's pair, and the right half of each can come from either of Mom's pair, so each of the four above can have two possibilities--this means there are 2 × 2 × 2 × 2 = 16 possibilities.

Let's attribute them all among the three categories:

Completely identical (four)
Red Yellow Red Yellow
Blue Yellow Blue Yellow
Red Orange Red Orange
Blue Orange Blue Orange

Half identical (eight)
Red Yellow Red Orange
Red Orange Red Yellow
Blue Yellow Blue Orange
Blue Orange Blue Yellow
Blue Yellow Red Yellow
Blue Orange Red Orange
Red Yellow Blue Yellow
Red Orange Blue Orange

Nonidentical (four)
Red Yellow Blue Orange
Red Orange Blue Yellow
Blue Yellow Red Orange
Blue Orange Red Yellow

These give us rough proportions to expect. This is a VERY simplified set of proportions, but they get us in the ballpark.
Keep in mind that you can basically do this with billions of segments if we think of the above diagrams as small numbers of base pairs. According to wikipedia:
The centimorgan is also often used to imply distance along a chromosome, but the number of base pairs it corresponds to varies widely. In the Human genome, the centimorgan is about 1 million base pairs.
Over numbers that large, you're going to get reasonably close to an expected value.

When I compared the ratio of completely identical to half identical segments between my brother and I, sure enough, I got about 0.33. When you take the "completely identical" possibilities and divide by the sum of "half identical" and "completely identical" segments you get 0.33. The reason I do this is because it appears that 23andMe includes "completely identical" in the "half identical" segments portion from how they're counted in the analysis. Both are referred to as "shared."
The following are some of my numbers to show how close it can be to 50%:



Reference the following from the ISOGG wiki:
Neither 23andMe nor Family Tree DNA distinguishes between fully identical regions and half-identical regions when computing the number of shared centiMorgans (cMs). Thus, for example, the shared cM for full-siblings will on average be 75% of the total length of the genome, of which on average 50 percentage points are half-identical and 25 percentage points are fully identical.
**Different companies do the calculations in different ways, using different methods, so results can't be compared directly, unless you go through some work to put the numbers on the same basis.**

If we reconsider our rough proportions from the "16 possibilities" this agrees nicely. The "Completely identical" section is counted twice in the last segment because both "sides" (one from each parent) are the same--see the diagrams from "Completely identical" above.
Notice in my example that (13.1% + 26.1%) x 2 = 78.4%--pretty close to 75%.


All that being said, siblings share about 50% of dna with each other, and about 50% with each parent.

23andMe list a table of average shared DNA by relationship: here.


The International Society of Genetic Genealogy also weighs in (again, more information).

Sunday, July 22, 2018

KeePass 2 password manager

I've been recycling passwords based on two themes from past experience that aren't particularly clever. My strat is not swoll, and it keeps me guessing as to which permutation belongs to which account.

This is the experience and modus operandi of many when it comes to online security--bank accounts, the email account you use to change ALL of your passwords with, bill paying, online vendors, social media, work benefits, etc.

What if you lost access to that primary email account? Would you be excited and capable to start from scratch? I'm going to be frank--for me it would be devastating.

Fortunately password managers have been around for quite some time. There are feature-rich, subscription services and more spare, manual intensive (sometimes free) offerings, and everything in between.

Recently I started using KeePass 2.

This manager uses a locally stored, encrypted file to house passwords. It is opened with either a master password, or a master password + unique key file.

I'll detail my setup, because I think it's flexible enough for anyone to use it reasonably easily (security geeks will cry because it totally mitigates KeePass 2 advantage of having a local file, but I'm ok with that because I'm a nobody, and this is very convenient).

Requirements:
USB drive (cheap, probably laying around)
Dropbox (or other cloud storage drive--most are free to use for the basic version)
KeePass 2 software (open source, free to use)
KeeAnywhere (free to use plugin | getting started)
HaveIBeenPwned (free to use plugin)

Process:
1. I downloaded the latest version of KeePass 2 to my primary desktop at home. This will include the ability to use multiple computers, and even a work computer. You can use the "Installer for Windows" .exe file if that's appropriate for your system. There are many supported systems.

2. After install, you need to create a database for your passwords: File > New. This is where you will set your master password. YOU MUST NOT FORGET THIS PASSWORD, BUT IT WILL BE THE ONLY ONE YOU NEED TO REMEMBER (and you can add a key file if you choose--don't lose that either if you choose to go that route).

First steps

To follow the method I use, you should save this database file in a cloud storage drive (Dropbox, Google Drive, etc.). The installation you did on your home computer will allow you to select it locally if you have Dropbox or another cloud storage program installed on your computer.

3. Now that you have a database you can start adding to it. I did this by looking at the passwords I was storing in my browser, and adding those first--then remove them from your browser! You can add them all at once, or slowly accumulate them as you remember which accounts you actually have. You're now set up to use the software with your current passwords without relying on an unsecured browser to remember them, or you can use the built-in password generator to change to better passwords.

4. To use the same synced database on multiple computers however, we have to (maybe) use a plugin. This is the KeeAnywhere plugin linked above. It lets you open a database file from cloud storage.

On the second computer you will be using (maybe a laptop), install KeyPass 2.

If you already have your cloud storage accessible locally on this computer (e.g. you're running Dropbox) then you're all set, and can just open your file from wherever your Dropbox files are stored.

However, if you don't have your cloud drive running with local files on your computer you'll need KeeAnywhere.
Go to the "getting started" page I linked above and add the plgx file to your "Plugins" folder located wherever you installed KeyPass 2 to (probably in "Program Files" somewhere. To install the plugin, you'll need to close then re-open KeyPass 2.
It usually requires admin access, so you may not be able to do this at work (Side note: my work IT allowed me to install KeeAnywhere because they support using password managers--it never hurts to ask).

5. After re-opening KeyPass 2, go to: Tools > KeyAnywhere Settings...
This will take you to a dialog that will let you link to accounts (first steps). You can then open your database file: File > Open > Open From Cloud Drive...

6. Cool. Now you can save your database from this computer, and because it opened the file from your cloud drive it also saves the file to your cloud drive--both computers have access to the same database. Keep in mind that this method relies on you (or the nice people at Dropbox, Google Drive, etc.) to keep your database file backed up.

7. If you want to take your database anywhere and use computers where you might not have install permissions (e.g. at work, the library, a friend's house), we can solve that too. Get out your USB drive and plug it into your computer.

Go back to the downloads page and instead of the .exe version, download the "Portable" .zip file and save it on your USB drive.

After you extract the files on your USB, you can run the program directly from the USB without needing to install it on a work or public computer.

8. Go through the same process of installing the KeeAnywhere plugin to your USB "Plugins" folder and adding the cloud drive and database of your choosing.

VOILA--now you have access to your computers in multiple locations.

===================================================

But your passwords are terrible and you really need to get those cleaned up.

"Ohhhh, but I don't want to," you whine, "nobody will care about stealing anything from little old me."

It's funny you should think that. Your passwords have already been stolen--you've been pwned. Don't look at me! I didn't steal your data! Though I'd love to...all that sweet, juicy data :P

They were stolen from Adobe, Dropbox, LinkedIn, Gawker, Tumblr, AND SO MANY MORE!

You can even check if your email info was breached, from here.

Now that you've got a sweet database of your passwords though, let's use a plugin to check the security of your passwords, so you can change any that have been compromised.

This is when you put the plgx file from the HaveIBeenPwned plugin into the "Plugins" folder of one of your installations. You'll need to install it separately in each installation of KeePass 2 if you want the plugin available on all your computers.

After re-opening KeePass 2, go to: Tools > HaveIBeenPwned.

You can check your database by site/service, username, or password.

Use the plugin to check against both available databases provided, and then change your passwords if you haven't already. You'll have to log in to each separate account and do it manually from there.

There may be some false positives due to the way the search is run, but you can be pretty confident that if you used the password generator to change one and had between 15 and 32 characters (upper and lower case with numbers--and maybe even special characters), that your password is secure.

Happy safe passwords.

AND REMEMBER TO DEFINITELY NOT FORGET YOUR MASTER PASSWORD.
Put it in a safe or something if you need to.

Monday, May 09, 2016

You can't always get what you want



...but you just might find that you get what you need.

It's graduation season.

GVSU is already done, Calvin finishes up soon, Unity will be a little bit yet. Fine.

...but it's the Penn State graduations that are giving me intense, conflicting feelings.

This is the time and year that my cohort begins en masse to graduate with their PhDs.

I'm very happy for them and extremely proud of what they've accomplished. It's a big deal. They've done groundbreaking research that matters and have done it brilliantly, with excellence. They're the smartest, most resilient folks I know, and I miss them--they solved some intractable problems with patience and intelligence. Some of them have even been recognized by their government and by ChE's American Institute.

It's incredibly painful too though, because I also entered the program at the same time they did, with PhD aspirations. I earned my M.S. after three years and left almost two years ago. I left because I wasn't sure how much longer I'd be able to take the anger, coupled with verbal and emotional abuse, from my advisor. I was worried that it would affect who I was as a person and that was non-negotiable for me.

I'm not walking across a stage this month and no one will call me Dr. I won't lead a fancy pharmaceutical lab or drive a fancy car.

But I also don't wake  up with an immediate, deep sense of paralyzing dread every morning. I don't have to face the sneer of a supervisor who with every glance, breath and word tells you that you're scum and get different treatment. I don't have an eye tick from the stress of facing another human being.

Most days I'm very content to be doing what I'm doing--I love it in fact! It's the infrequent reminders that bring pain.

Naming the specific opportunities and good, good things in my life helps. I just re-read the documentation I made of my former supervisor's behavior for the first time in over a year--it was surprisingly helpful to remember the former days of insanity that I dealt with. I don't feel like a failure after reading it.

The beauty of the consolation prize M.S. that I earned (most days that's how it seems to me), is that I can teach college, and maybe even lead independent, novel research with undergraduate students in a new direction--one without the former baggage of a past research life. I can teach science to high school students and walk alongside others, talking about the things that matter. Even if a person decided that I wasn't worth their time, I learned the art of research and studied ChE with some of the best in my field--that can't be taken away.

Mine is not a prestigious life. But it's mine to give, and I'd rather give it to people who are deserving.

Friday, December 18, 2015

Oh that the youth would know the cubic, solve the cubic

This is a generic cubic:
0 = e x3 + f x2 + g x + h

with coefficients e, f, g, and h.

This is the Van der Waal's EOS, a cubic:
P = [R T / (ν - b)] - [a / (ν2)]                           or,
P ν2 = [R T ν2 / (ν - b)] - a                              or,
P ν2 (ν - b) = (R T ν2) - a (ν - b)                      or,
P ν3 - b P ν2 = (R T ν2) - (a ν) + (a b)             or,
P ν3 - (b P + R T) ν2 + (a ν) - (a b) = 0           where,

now,
e = P;
f = -(b P + R T);
g = a;
h = a b
and we're using ν as the independent variable instead of x, of course, but it's the same format.

[For the curious: P is pressure, R is the gas constant, T is absolute temperature, a and b are constants based on critical properties of the specific gas, and ν is specific volume.]

13/27 of my students know how to solve a cubic function.

That is less than half. You solve cubics in high school. Sometimes you solve them in middle school.

It's not surprising that many people criticize engineers for being out of touch with reality--so many just love to play with equations without thinking about what the equations are, or how they can be used/manipulated.

They are tools, not magic, and need to be treated with respect and that understanding, but not reverence.

During the final, one of my students said to me:
"No one ever taught me to solve an equation like this."

I thought about that. What I said was along the lines of:
If you don't know how to solve it, show me clearly, as far as you can, what you've done, and what you would do.

What I thought was:
No. Someone taught you how to solve a cubic; you've done it many times. You just don't recognize this is an instance of the cubic you know how to solve, because you view this equation as being special, because it is the Van der Waals EOS. It can be manipulated just like any other polynomial that you know.
Then I cried and cried and cried and probably vented to Twitter.

Sunday, November 01, 2015

Life and stats

The postdoc I taught with told me once that statistics let us tell people how much we're lying...and that they can be used to lie about how much we're lying.

His statement might be ± anecdotal, but I think it holds.

So, here's to lives dictated by P.

Thursday, October 15, 2015

You were made for this (thermo cycles)

There was a moment during class tonight that felt exhilarating.

I don't mean that hyperbolically.

I mean that I was overcome with wonder and that dovetailed into a teaching moment.

A student asked me to distinguish between a refrigeration and a heat pump cycle--they are very similar processes.  In fact, the only difference is in how you use them.

I didn't have a very clear or concise explanation the first time--to be perfectly honest, I realized in that moment that my understanding was incomplete--and I was supposed to explain this to the class.  At that point, you can either think really fast on your feet, or acknowledge that you don't know.

Normally I would tell them I'd get back to them.

This time was different.

Refrigeration cycles are an interesting concept because they use materials that boil at very low temperatures.  I understand how refrigeration cycles work very well.  It's fundamental to much of my work.

In that moment I decided to try and work out the explanation of a heat pump to myself while I did it for them.  Kind of risky, but since I knew how the 'opposite' cycle worked, I should be able to convince myself.

And in that moment, I had it!  For some reason, the heat pump cycle had previously seemed to have a kind of magical quality to it.  For years I never really felt like I understood it.

Now I had the key!  And I was able to jump right in and explain it with a metaphor/picture that, while absurd*, made sense.

Normally when these little realizations about how the world works come, I'm not with my 'right' people.  That is to say, ChE's.  This time however, I had a captive audience of budding engineers, and they weren't allowed to leave.

That's why it was exhilarating: an epiphany in the presence of a captive audience that has the background to appreciate and learn from it.

Most times I would keep something like that to myself and enjoy the moment amidst my lawyer, biologist, accountant, public administration, social worker friends.  This time though, I got to share my realization (had to really), and in the process looked like I had my s*** together.  I feel like I was made for this.

*a heat pump cycle is basically functioning like a refrigerator for the earth (when the source is geothermal).  You are taking 'heat' in the ground (thereby cooling it) that is at a lower temperature than the object to be heated, a house for example, and boiling a (low T, low P) liquid refrigerant.  The power input comes in compressing the (low T, low P) refrigerant vapor into a (high T, high P) vapor.  That vapor runs through a condenser and gives up its latent heat of vaporization to heat the house.  You then throttle the (high T, high P) liquid through a valve back to a (low T, low P) liquid and boil it with low grade heat from the ground to start the cycle again!  You're making the ground refrigerated and using that heat in your house!  It's the opposite of a refrigerator because our system of interest in a refrigerator is the insulated box--the heat gets expelled to your kitchen (the surroundings).  Now, the system is your home, and you're adding heat to it by taking it from the low temperature ground (surroundings)!!!  The beauty is that you can reverse the process and have air conditioning--now you're just putting that heat in the ground!


Monday, April 13, 2015

Cancer, cell culture and time management

When I was a graduate student at Penn State I studied chemical engineering, but really I did cell biology.

My project was to understand better how tumor cells, such as melanoma, interact with normal cells in our blood vessels.  In specific I looked at the way A2058 melanoma used soluble and mechanical signals to induce changes in HPM-EC and HUV-EC endothelial cell behavior (the paper is linked on my About Me page if you're interested).

Studying this interaction poses an interesting logistics problem: tumor and endothelial cells grow at very different rates and to different densities, and we want to study them together--a lot.

For this to happen:
  1. Both types of cells must be ready on the same day at the same time.  Not only that, but the testing scaffold that has endothelial cells growing on it takes a different amount of time to grow together than the cells do growing in a normal dish.
  2. The experiments need to be completed at roughly the same cell age each time.  Both types of cells needed to be taken care of at least every three days, and usually more often, depending on if they had grown fast enough, and what they were for.
  3. Sometimes the cells need to be grown for a special period of time, before the media they were grown in could be harvested.  This was a different growth density.
  4. Experiments must be continuously started, worked up, stopped and analyzed--and many experiments require results from the previously completed one to inform the conditions of the next one.
    Essentially, I had to have 3-12 plates of up to 6 cell types growing to be able to balance the experiment schedule my adviser and I had set up.
I am convinced that one of the most important lessons I learned in graduate school is time management.

This is not an abnormal case.  Students do this all the time.  It is simply a skill and life to be learned.  We did it day in, and day out, 7 days a week for 12-16 hours a day.

All that to say, when my time management skills are criticized at my current job, I'm somewhat skeptical.  Today it meant that there was an unexpected shortage at a client and frustration was directed my way.  Sometimes people have a lesson they just really think you need.  And I'm ok with that.  I learned exactly how I'm expected to prioritize a particular account.  There is utility there.

So, if you ever want to develop some kicka$$ time management skillz, complete a graduate program doing cell culture.  As an aside, I'm certain that I will never purposely step into a cell culture lab with the intention of working there for protracted periods of time.

Thursday, February 19, 2015

Boiler Primer 3: pH, alkalinity and conductivity

Understanding the environment that reactions take place in helps us to determine which are more likely.  Variables like pH and alkalinity do that, because they tell us what form a species is in.  For example carbonates, which are the components of alkalinity have two protonation states, since H2CO3 is diprotic.  It is an acid that is able to give up two protons.
H2CO3 <=> HCO3− + H+
Ka1 = 2.5×10−4;[1] pKa1 = 3.6 at 25 °C.
HCO3− <=> CO32− + H+
Ka2 = 4.69×10−11; pKa2 = 10.329 at 25 °C and ionic strength = 0.0 (data from wikipedia)
These two pKa values describe the extent to which one of the species is present at a certain pH.  See the speciation plot below for carbonic acid (source):
This means that at low pH, carbonic acid is primarily in its H2CO3 state.  Most of the carbonic acid molecules have given up their first proton by pH 6, and most of those have given up their second proton by pH 9.5 to become CO3.  Thus, above pH 10, CO3 exists as the dominant species.  It is a weak base.  This water is high in alkalinity therefore, but not corrosive.

We like to operate at this pH, because it dramatically reduces the corrosion from oxygen and other sources such as carbonic acid (source):
However, it means that we have a large cohort of CO3 present, which is amenable to reaction with calcium to form calcium carbonate.  Because this is a scale forming environment, we address this with dispersants and inhibitors that get to the calcium before it can form scale.

Conductivity then is a measure of the amount of dissolved solids in water.  This increases as more salts are available in solution to conduct electrons.  This is essentially one number that helps to boil down how full the water is of ions (alkalinity, treatment, hardness).  Water with higher conductivity tends to have more possible reactions as well, shifting equilibrium toward scale formation.  Conductivity is a measure that we use to manage how often blowdown occurs--how often we get rid of water that has many ions, and introduce makeup water with fewer ions, to reduce scale formation.

Boiler Primer 2: Treatment chemistry (low pressure)

Chemical reactions happen pretty quickly in a boiler because the temperature is so high, and reaction rate is generally dependent on temperature.  Some reactions that happen in a boiler are good, and some are bad.
Bad reactions:
Calcium scale formation on boiler tubes (solid deposits reduce heating efficiency)
Oxygen corrosion of steel (pitting and metal loss)

Good reactions:
Steel passivation (forms protective layer)
Calcium salt formation that remains soluble or in the bulk water (we can remove it with blowdown)
We combat bad reactions like calcium scale formation by adding chemicals that the calcium can react with to form small crystals in solution, instead of on the steel tubes in the boiler.  Combating oxygen corrosion involves the use of oxygen scavengers which react with the oxygen to form other compounds, and remove it from the water--what's not there can't do damage.  Nearly all of the following are formulated as sodium salts.  Sodium ions play nice, in general calcium do not.  Calcium often comes into the boiler through makeup water (replacement water for leaky valves or water lost to steam)--it is preferred to be removed with a water softener if possible, before being added to the boiler.

Corrosive Water Scale-forming Water
  • low pH
  • soft or with primarily noncarbonate hardness
  • low alkalinity
  • high pH
  • hard with primarily carbonate hardness
  • high alkalinity
The central dogma of boiler treatment currently is: mitigate corrosion almost completely through the use of an alkaline pH, and use chemistry to stymie unfavorable reactions.  There are some acidic treatments, but today most work is done at elevated pH (table source).

Hot loop chemistry:
Boilers that circulate hot water through a building are typically not blown down (removing water with a high level of dissolved salts).  Once properly treated, they can remain stable for months.  These systems are typically treated with nitrite (above), which passivates the steel by reacting to form a layer of magnetite (Fe3O4).  This is a less reactive oxide of iron that, unlike rust (Fe2O3), will not contribute to loss of boiler steel.  We like to see boiler water a little black (magnetite), rather than red (rust), because it means the steel has a protective layer on it.

Steam boiler chemistry:
Steam boilers present several problems that hot water boilers do not have.
The first difference is that these boilers are constantly losing water as steam, and need more water added as a result.  The steam that condenses has a relatively low pH (7 as opposed to boiler water, which is kept from 9-11).  This makes the water rather acidic and corrosive to the steel.  Combine that with carbon dioxide, which is dissolved in this water creating carbonic acid, and you get a nasty bit of acidic water.  To combat this, amines (cyclohexylamine, above) are added to the boiler water.  Amines vaporize within boiler operating temperatures and leave with the steam.  They also condense with the water and raise the pH (pKa similar to sodium hydroxide which is strongly basic).  This reduces the corrosion in the steel pipes that return the condensed water to the boiler.

Oxygen scavengers such as sulfite (above) and erythrobate are used to react with the oxygen that is dissolved in the feed water make up to the boiler.
Phosphates (above) are added to bind the calcium in small insoluble crystals that are unlikely to cause scale on the boiler tubes.  These eventually leave with the water that is blown out of the boiler periodically.

The above classes of chemical are the most common course of treatment for boilers, though there are others.
These are important considerations for low pressure boilers.  Boiler drums found in higher pressure systems such as power plants have different chemistries and considerations.

Wednesday, February 18, 2015

Boiler Primer 1: Introduction

What is a boiler?
A boiler is used to either heat water, or to heat water with the purpose of making steam.




Boilers do this by contacting water with a hot surface.  There are two general types, fire-tube (left) and water-tube boilers (right).  Water-tube boilers have water running through tubes, and the outside of those tubes are heated by burning natural gas, to heat the water running through them.  More commonly seen are fire-tube boilers.  These involve burning natural gas within the tubes and radiating the heat out to water that surrounds them.

Hot-water boilers are used to heat water which is sent in a loop throughout a building typically, or through a process in general.  These are often used to heat buildings by blowing air over the tubes through air handlers.  This system can be thought to function similarly to how an old radiator does--the kind that tend to bang, and are found in old homes, schools or offices.

Steam boilers create pressurized steam by heating water.  The steam leaves the boiler through a header pipe and is passed to a process or wherever it is needed.  This steam that leaves is precious though, because it is mostly pure.  When water turns into steam, it leaves salts and most other chemical treatment behind in the boiler.  What happens after the steam deposits its heat of vaporization to a process, is that it condenses back into water because it lost the energy to be steam.  The condensed water is then very pure, because the steam was pure.  The condensate is then collected when possible, and fed back into the boiler.  Some boilers cannot do this because the steam is not part of a closed loop and goes elsewhere, but wherever possible, the pure water is collected and recycled, replacing the water that leaves as steam.
As you can see from the above diagram, there is an enormous amount of energy carried in steam.  This is the energy in steam that is applied to a process when the steam is allowed to condense.  That energy isn't free though, it comes from the combusted natural gas, but it allows us a more convenient way to pass energy along, using water/steam as a medium.

Tuesday, June 25, 2013

the day when everything fails

That day sneaks up on you in seeming delight. It finds you after you've actually eaten breakfast, maybe worked out a bit at home. The day lies in wait above your head as you sit in group meeting, giving advice to a new graduate student, about their candidacy presentation they'll give in August.

First, the air conditioner isn't working in the cell culture room. "No matter" you think, we'll just flip the breaker like usual. "Aha!" shouts the day, "not so easily, this time."

"Well" you muse, "maybe I can use the hoods later if the humidity decreases..." Responding before you can catch your breath, the refrigerator/freezer cries out "I'M NOT GOING TO WORK TODAY!! YOU NEED TO EMPTY ME AND LET ME THAW! H4H4H4!"

That escalated quickly...suddenly a day of work turns into damage control. "Weeeeeeeeeeeeeeeeeeeeeee!!" you shout, as your feet leave the ground, leaping into the air from atop the precipice of productivity. And you pray for an updraft. And wings. Pray for the wings first.

Monday, April 13, 2009

The Importance of Wind Power

© Guerito 2005Image via Wikipedia

I just arrived back from a seminar that Calvin held, by Dr. Imad Mahawili, the Executive Director of the Michigan Alternative and Renewable Energy Center. This man is taking an approach to renewable energy and resources that is one of the best that I can think of. The main sources of energy he is looking at are biomass and wind energy. Our lakes are some of the best places to harvest energy from in terms of size and potential. If we build wind-farms offshore far enough, they don't have to be an "eye-sore", which is what some claim. To be honest with you though, there are few man-made structures more beautiful than the windmill to me. Birds die from flying into windmills, this is a fact, but if the structures are far enough from land, the bird problem won't be an issue, as apparently they require food, which they largely get on land. Also, Dr. Mahawili brought up the statistic that cats eat on the order of ten times more birds than turbines can kill.
In Germany, there is an abundance of windmills. This comes from their commitment to losing no German lives in the pursuit of resources through war or other strife. If we invest sufficiently in turbines for our waters, not only would we reduce our emissions, but the amount of energy that we have to import from other states and countries. When we import as a state and country, we not only lose money, but we lose the jobs that the money funds elsewhere.
Biomass is another component that is worth investment. It does more than convert manure into fuel and energy. The sulfur is removed by bacteria, the residual water with essential nutrients is re-introduced to the fields with 90% of the E. Coli bacteria killed off, the leftover solids are not left in the fields to emit methane, but are re-processed and sold as fertilizer or bedding for cattle, so the process is very sustainable. This is a very real thing. In fact, Mahawili designed a plant that does this in West Michigan, which has been operational for almost two years now. The problem is that the company that built it is now working in Texas, doing this, which is great for Texas, but not Michigan.
The policy is not there yet, we need to work at it with the politicians, but it will take time. Dr. Imad Mahawili believes that an entrepreneurial approach is a sure and resourceful way around this, and so do I.
Reblog this post [with Zemanta]

Friday, April 10, 2009

Things

...are going well, not amazing, but well. I got the research fellowship for this summer that I wanted, which is awesome. I'll be looking at ethanol extraction from an invasive woody shrub. Maybe more later on how that goes. I'm home now for Good Friday, and I get to hear one of my friends give the sermon tonight. Also, right now I'm going to play tennis with one of my favorite people. It's a good day, I hope yours is too.
Reblog this post [with Zemanta]

Monday, March 30, 2009

Research Fellowship

Well, I got a research fellowship at Calvin this summer. I'll either be looking into recycling technologies, or the possibility of using buck thorn, an fast-growing invasive species, as an alternative to corn for the generation of fuel ethanol, similar to how switchgrass is being used in warmer climates. I would prefer the ethanol research, but it's very up in the air at this point.


Reblog this post [with Zemanta]

Saturday, February 07, 2009

Aha

So in middle school and high school, I was involved in Science Olympiad in region 12 doing a variety of powder and chemical analysis events. I never really understood the chemistry of it until now. In O-Chem lab, we started integrating chemical analysis of substances with the normal IR, GC and NMR methods that we usually use, and it's all coming together. It's kind of sad that it took me until my second year of undergrad to understand why the things I did in 8th-12th grade worked, but let's not dwell on that. Kudos to David VanDyke for instructing middle schoolers in identification chemistry.

Reblog this post [with Zemanta]

Monday, March 17, 2008

Save what?

Has it occurred to anyone that instead of trying to "save" the planet, we should be trying to save ourselves from certain death instead. Seriously, the only thing that the earth has to worry about is not becoming dust after colliding with another astronomical body, we have to worry about conditions that support life as we know it. I was watching Stargate SG-1 the other day and there was a Gadmeer craft converting a planet from being carbon based to sulfur. Notwithstanding the possibility of this, the planet could have cared less whether the Enkarans or Gadmeer inhabit the place, heck the planet can't even care at all. It's the same here; our planet can withstand global-warming, ice ages and American politics. The real question is: "Can humans?" Like the earth said, "Save Your Sorry Arse."

Reblog this post [with Zemanta]