Over the years I have often perturbed a design or model or strategy for sensitivity analysis and optimization. The typical situation is that I have a model for something like an optical system, a heat exchanger, or a nuclear core, and the model has a bunch of knobs and inputs, and bunch of outputs including value functions to optimize or observe. I then have to run various extreme cases or choose a good set of inputs to optimize one of the outputs. It's always the same thing and it made sense to standardize it so I don't have to keep copy pasting code.
casegenmc is python package to organize models, generate and run cases, estimate uncertainty, and optimize. There are ways to study the statistical metrics of the studies, e.g. value functions the incorporate the uncertainty.It also has some decent plotting capability. The source is here and it is pip installable and bit a buggy: https://github.com/lvenneri/casegenmc
It includes some convenience function for using optimization algorithms available from other packages. I have been using NEORL recently, a package my advisor and my friend have contributed to, which packages several evolutionary algorithms in one place.
Previously, Len Fisher addressed the issue of biscuits lost at tea 1. As a cookie soaks, the sugar and fats dissolve,
the starch grains bloat, and the biscuit falls apart pretty quickly. Fisher was trying to increase the dunk time before
structural failure so the timing would be less stressful and finicky. The strategy he proposed was:
Insert one end of the biscuit into the liquid at an angle which can lead to a dryer
structural top side (his explanation) for longer; and
Add a chocolate sheet that keeps it structurally sound.
He won an (Ig) Nobel Prize for this. But the "horizontal" orientation offers such a small advantage that he has to use a
supersize cookie for demos and the results look insubstantial in practice. The angling
has not really done it for me. The wet front climbs the cookie without leaving much of a dry side.
In any case, I have a different problem because I like to soak cookies in whole milk which, as I’ll explain later, is a
painfully slow process with mixed results. For example, the cookie can equilibrate with a dry portion inside
depending on how it is dipped. I just want to wolf down fully soaked cookies as fast as possible but without losing
them. I'm also interested in a cookie I can just toss in and wait to see it soak without sinking. The general strategies
are listed below, and they will make sense using a simple equation and a few other observations.
Minimize soak path length.
Orient horizontally to reduce the gravitational head or submerge partially so that gravity pushes liquid into the cookie from above.
Maximize the wetted surface for a larger flow area with geometries of high surface area to volume ratio.
Maintain a snorkel to allow gas to escape. Without a snorkel, the gas may become trapped.
Use chocolate for water impervious structure but also to create dynamic gas traps.
Increase pore size and surface tension.
Reduce liquid contact angle (highly wetting) or control for desired function.
Keep in mind the shortest path length, and use shapes that have a single path length - torus, sphere - so things don't snap off.
Use surface tension to keep soaked objects afloat.
Soaking a cookie involves a liquid displacing the air in the cookie’s porous interior. Why is this even possible?
Hydrostatic pressure and capillary rise of the fluid can drive the fluid to displace the air. Hydrostatic pressure is
just the phenomenon that liquid will fill the cavities up to the liquid surface, like an inverted cup in water.
Capillary action is what pulls liquids up thin tubes.
We can think of the cookie and its pores as a network of capillaries that feed up and sideways, and we just fit the
observed data to find equivalent radii and contact angles that work. One picture is a capillary going up the cookie. We might also consider the capillaries in the short direction.
To account for the many pores that interface with
the liquid surface, we can simply multiply by the wetted surface area. Cookie porosity is in the range of 0.5 to
0.8 2. Pore size ranges from 5 to 300 microns, and a representative pore size would be about 150 microns 3.
Capillary rise, also called imbibition, pulls the fluid to rise above the liquid surface level until this capillary
pressure balances with the pressure of the liquid column. Balancing the two pressures gives the following equilibrium
soak distance X along the cookie where H is the height, α is the angle of the column with respect to the
surface, θ is the liquid contact angle of the fluid, σ is the surface tension, r is pore radius, and
ρ is the density. This is also known as Jurin’s Law.
X=sinαH=PgravPcap=ρgsin(α)r2σcos(θ)
As it happens, this equilibrium soak length is often very large, much larger than a cookie. So we’re actually interested
in the velocity or soak rate to achieve a certain x soak length rather than the max equilibrium soak length X. To do
that, we use the Hagen–Poiseuille equation which describes laminar flow for incompressible Newtonian fluids.
Starting from the Hagen–Poiseuille equation we have
dtdx=8μxr2Δp
The pressure term is the capillary pressure minus the column pressure. For areas under the liquid surface, there is an
additional but negligible pressure of the liquid height which is ignored here.
Δp=ΔpC+Δph=r2σcos(θs)−ρgxsin(α)
Substituting into the above velocity equation
dtdx=8μr2[rx2σcos(θ)−ρgsin(α)]
Already this shows how reducing the angle of the cookie can increase the velocity along the cookie length. I think
Fisher's idea was that this is a small effect and one can increase the soak along the cookie to be closer or faster than
the flow up the thin side of the cookie,
which could leave a dry backbone on top for longer.
Another observation is that gravity can help increase the flow velocity. Imagine we can somehow dip the cookie into
an upside down cup. The gravitational pressure term is now in the same direction as the capillary term. This occurs for
the top side of a cookie dipped slanted into a liquid. The soak front moves down faster than it moves upward, and the
dry internal structure will
be asymmetric.
Now solving for t by integration,
t=r2ρgsinα8μX[−ln(1−Xx)−Xx]
For small Xx (the fraction of maximum distance), ln(1−y)≈−y−21y2−31y3−⋯
t≈r2ρgsinα4μX(Xx)2
By substituting X we recover the Washburn equation relating soak length
to the time, pressure difference, surface tension, density, and viscosity:
x=2μσrtcos(θ)
Or rearranging to solve for soak time
t=σrcos(θ)2μx2
We can also incorporate a rough dependence on wetted area by noting that we are interested in the time to soak the volume and that
dtdxA=dtdV
With this we now have
t=Aσrcos(θ)2μx2
This simple equation has quite a bit of explanatory power. For the shortest soak time, we want large pores, low
viscosity, short path lengths, low liquid contact angle (hydrophilic) and high surface tension. Note that the angle of the cookie is only contained in higher
order terms, but sin(α) would be in the numerator so that a slanted dip (smaller angle α) with the same wetted surface would reduce
the soak time.
One observation we should be able to explain is that biscuits soak faster in tea compared to milk and the soak rate appears
to slow down the more cookies have been dunked. This can be explained by viscosity. Water has a viscosity two times
lower than milk, and its viscosity drops with increasing temperature (sidenote: cream has a viscosity about 15x greater
than whole milk). So a hot mug of tea is going to soak a cookie much
faster than a cold glass of milk. Similarly, the more cookies are dunked in a glass of milk, the more sugar is dissolved
into the milk, which increases the viscosity and slows down the soaking.
Water’s higher surface tension also plays a role as the capillary pressure increases linearly with surface tension.
Water’s surface tension against air is 72 dyn/cm (1×10−3) N·m) at 25°C and 58.9 dyn/cm at 100°C. Whole milk
has a surface tension of 45.5 dyn/cm at 25°C and 35.5 dyn/cm at 100°C. This is another 1.5–2× factor 4.
I also suspect there's some differences in the liquid contact angle, and the chemistry and reaction rate of hot water
dissolving sugars in the cookie, but not sure.
The viscosity and surface tension of milk
have interesting effects on splashing and droplet formation.
I’ve also observed some dramatic variations in soak rate depending on the orientation and position of the cookie in the
liquid. Here we are dealing with some subtleties about the cross-sectional flow area, imbibing length, pressure differences, and gas outlets.
One curious configuration is the fully submerged case. I'm aiming to maximize the flow area but the result is a cookie with that equilibrates with a dry internal section. To be clear - the cookie is fully submerged and is removed with a dry portion inside. What's happening? As fluid starts to permeate, where does the air that originally occupies the pores go? Some might manage to escape at the
beginning, but it may be somewhat trapped because of the liquid boundary which seals the air inside unless its pressure
is
greater than the bubble point. I say somewhat because there may be a differential pressure that breaks the seal on the
top. The internal pressure of the trapped air goes up, which opposes the capillary action or
pressure difference that was driving the flow. This pressure must exceed the bubble point of the biscuit so that air can
get through the pores on the cookie’s surface currently blocked by the liquid.
ΔPBubble=r2σ
The internal pressure also resists the capillary flow. The equilibrium between the two is reached when the fluid
pressure equals the trapped gas pressure. The gas pressure starts to rise from PA, the original atmospheric
pressure, and it rises with the inverse volume. The fluid pressure
driving the flow into the cookie is constant and is the sum of atmospheric, hydrostatic, and capillary pressure. This
means the equilibrium is reached when the fluid occupies a fraction α of the total pore volume Vp.
I suppose the depths are often quite low, and the imbibing is not uniform, so there could be ways for a dominant gas
path to establish itself and prevent a liquid seal. This could be aided by a pointy structure that concentrates the air
flow in a small path with quickly rising high flow that does not get clogged by water. This could explain why this effect is not present in all cookies, just the most round and thick.
Something else to consider is that the gluten grains expand as they absorb water, which will lead to a shrinking pore
size and kind of continuous exfoliation of the outer layer of imbibed cookie. This would probably be a kind of staggered
process that would allow for instabilities and gas paths to form intermittently, relieving the pressure of the internal
gas. If the pores were structurally sound, perhaps the capillary seal would work.
We can still maximize the surface area and minimize capillary path length by laying the cookie flat on the surface. Now this also has an unexpected result. The cookie soaks but never sinks! This is true when the top side is left dry at the start. If it is just slightly wetted it will soak and sink. But if it is dry, it remains afloat but fully soaked! It is however unstably afloat, because when you just touch, it sink right away. I believe this has to do with surface tension which helps create an upward force and an additional buoyancy force if the there is a below liquid level void created by the surface tension 5.
Next, I will introduce some new cookie geometries and properties that leverage these observations. There will be some
new designs taking advantage of dynamic effects.
The solar spectrum shows up at Earth looking pretty close to a black body of 5777 K. As it goes through the Earth's atmosphere, there are various absorption and scattering interactions that change the spectrum to produce some distinct lines and features. I was curious how I might recreate the solar spectrum as measured on the surface of the Earth if I had a beam of light from a warm blackbody of the same temperature as the Sun.
Water filters can do the trick for many of the features above 500 nm, but I found out that it takes many meters of water vapor to get the spectral features, and that liquid water has quite a different absorption coefficient than water vapor. One trick could be to pressurize the water and increase the temperature to increase the density of the vapor. In this way, the length required is manageable. Potentially only a rather thin medium is needed if we tune the pressure and temperature and fluid quality within engineering constraints for pressurized transparent vessels. We might also be able to add some other constituents to get other features in the spectrum.
Below, the top plot shows a blackbody and the solar spectrum as measured in space and on the surface of the Earth. The third plot shows the absorption coefficients for the different filters. The second plot applies those filters to a blackbody for a particular filter length.
For those curious, spectral absorption data like this can be found here:
Modern economies tend to organize themselves to produce larger volumes of lower-quality goods. This results in lower initial capital expenditures (CAPEX) unlocking greater sales for the seller but at the expense of higher operational expenditures (OPEX) for the buyer, including replacement costs, resulting in higher levelized cost (LC) of goods. This applies to everyday consumer goods like coffee machines, furniture, and homes; as well as industrial systems like power-generating equipment and infrastructure. We provide a simple model to estimate the LC by introducing the idea of economies of quality which defines OPEX as a function of CAPEX with a scaling exponent (α). When the scaling exponent exceeds one and for many financial conditions, we find that non-zero CAPEX can minimize long-term cost. This finding is consistent with the everyday notion that spending on higher quality is worth it. Overall we suggest that prioritizing higher CAPEX is economically advantageous under many conditions challenging the dominant CAPEX-minimization strategies rooted in seller-side profit-seeking and buyer-side short-termism.
SpaceX’s Falcon 9 is like a Toyota Corolla – an order of magnitude cheaper than competitor’s “high performance” rocket
systems, the Ferraris, but achieving the same basic transport requirements with greater reliability and safety. Before
Falcon, space launch was a Ferrari-like industry, with handmade, highly specialized, extremely expensive vehicles
targeting government customers and fully complicit in the inefficiencies of government contracting. Similarly, the
nuclear industry produces and still designs Ferrari-like fission reactors, with high performance metrics in terms of
power density and unit power, at a megaproject scale, but with high system and operational complexity, extreme
development cost, numerous part counts, and very low production and deployment rates that still require human-machine
interface to meet societal safety objectives. The demand for nuclear Ferraris in the U.S., particularly within
non-traditional energy utilities is very low, as few competent utilities want unique reactors with such high capital
costs, running at such high power that low probability accidents can have offsite consequences. Where is the nuclear
Corolla?
Create the first SiC mug – a useful and rare artifact using additive process now available from 3dcarbide.com. There is one issue in that SiC is a bit more thermally conductive than most ceramics, so it may not be the best choice for a hot beverage.
I made these for Ultra Safe Nuclear’s website. It’s a
relatively
simple process of
exploding the parts in the right order with the right natural motion and coordination so that things just snap into place.