Episode Transcript
Available transcripts are automatically generated. Complete accuracy is not guaranteed.
Speaker 1 (00:00):
So picture this. You're staring at this overcrowded, just incredibly
sluggish Excel spreadsheet.
Speaker 2 (00:07):
Oh, I know the one right.
Speaker 1 (00:08):
It's filled with these complex concrete beam calculations. It has,
I mean hundreds of rows nested formulas that are referencing
other nested formulas on totally hidden tabs.
Speaker 2 (00:19):
Yeah, the classic House of cards exactly.
Speaker 1 (00:22):
And you were just sitting there terrified that one wrong click,
like one accidental keystroke, is going to completely break the
entire system.
Speaker 2 (00:30):
It is a very real, very common anxiety in the industry. Honestly,
that fragile spreadsheet is practically a rite of passage for
anyone getting into civil and structural engineering.
Speaker 1 (00:40):
It really is.
Speaker 2 (00:41):
You build it, you rely on it every day, but
you never fully trust it.
Speaker 1 (00:44):
Using Excel for complex structural design today it honestly feels
a lot like trying to build a modern skyscraper with
like a hand drill instead of power tools.
Speaker 2 (00:53):
That's a great way to put it.
Speaker 1 (00:54):
I mean, technically it works, but it's exhausting, it's slow,
and it leads way too much room for catastrophic human error.
And that is exactly why today's deep dive into the
source material is entirely focused on modernizing the engineering toolkit.
Speaker 2 (01:10):
I'm very excited for this one.
Speaker 1 (01:11):
Same here we are going through Victoria Laura's book Python
for Civil and Structural Engineers, and our mission today is
to discover how transitioning from those traditional spreadsheets to Python
can transform all those tedious, error prone calculations into automated, scalable,
and highly accurate workflows.
Speaker 2 (01:29):
And you know, this transition we're discussing, it isn't just
about learning a new piece of software. It is a
fundamental shift in how you as an engineer process information.
We're talking about moving from a static, rigid grid of
numbers to this dynamic, programmable environment that actually scales with
your projects.
Speaker 1 (01:47):
Okay, but before we start calculating sheer forces or you know,
designing steel beams, we really have to set up the
ultimate digital workbench. Like, why are engineers making this jump
to Python in the first place.
Speaker 2 (01:57):
Well, the immediate draw is that it's open source and free,
always a plus. Exactly, you have this massive global community
of data scientists and engineers who are constantly building and
rigorously testing libraries. You aren't just relying on one company's
closed ecosystem.
Speaker 1 (02:14):
Right, and the source material strongly recommends starting with the
Anaconda distribution. Right.
Speaker 2 (02:18):
Yeah, Anacona is great because rather than forcing you to
hunt down and install individual scientific tools one by one,
Anaconda prepects all the essential libraries you need right out
of the box. That makes it so much easier, it
really does, And that installation gives you access to the
real powerhouse of this workflow, which is Jupiter notebooks.
Speaker 1 (02:39):
Yes, Jupiter notebooks. I want to dig into this because
it sounds amazing.
Speaker 2 (02:43):
What's fascinating here is how Jupiter notebooks completely rethink the
documentation process itself. When you use one, you aren't just
solving a math problem in a vacuum.
Speaker 1 (02:52):
Okay, so what does it actually look like.
Speaker 2 (02:55):
Well, a Jupiter notebook allows you to mix what are
called markdown cells, and those handle your formatted text, your
theoretical explanations, and even reference images. You mix those right
alongside code cells, which execute the actual mathematical algorithms.
Speaker 1 (03:11):
Oh wow, so it's kind of like showing your work
in math class, but the paper actually does the math
for you.
Speaker 2 (03:15):
That is a perfect analogy.
Speaker 1 (03:17):
Yes, So exactly how does that change the day to
day workflow for an engineer?
Speaker 2 (03:22):
Think about traditional reporting Usually you do your math in
one program, maybe a calculator or Excel, and then you
open up a word document to explain what you did,
write the whole copy paste routine exactly. Jupiter bridges that gap.
You're writing a transparent, readable document that explains exactly how
you solve the problem step by step, right next to
the code that does the solving.
Speaker 1 (03:42):
That's incredible.
Speaker 2 (03:43):
Yeah, anyone reviewing your work can read your methodology and
verify your math in the exact same window.
Speaker 1 (03:48):
That transparency is huge for quality control. Now. I know.
The book does walk through the basic syntax rules of
Python to get you started things like lists, dictionaries, tuples,
but it also highlights a major track for beginners, which
is this idea of variable scope.
Speaker 2 (04:03):
Oh yes, the global versus local variables issue.
Speaker 1 (04:06):
Yeah, that seems tricky. The book explains that if you
declare a variable inside a specific function, it becomes a
local variable. You can't just suddenly call it later outside
of that function and expect the program to know what
you're talking about, right.
Speaker 2 (04:19):
Because the memory of that variable is completely destroyed once
the function finishes running, which is wild.
Speaker 1 (04:25):
I mean understanding memory allocation, like knowing where and when
a variable actually exists in your computer's memory. That seems crucial.
Speaker 2 (04:34):
It is. The book warns that engineers often try to
write Python exactly like they write Excel formulas, and that
leads to incredibly messy code.
Speaker 1 (04:42):
Because in Excel, sell a one is always sell a
one exactly.
Speaker 2 (04:46):
It's a prominent physical location on a grid. But in Python,
a local variable is temporary. If you don't grasp that
mental shift, you'll get errors that seem completely illogical to
a first.
Speaker 1 (04:59):
Time I can totally see that being a massive hurdle.
Like if I'm used to Excel, where everything is laid
out in front of me permanently, the idea that a
variable just vanishes into thin air because it was local,
that's going to break my brain a little bit.
Speaker 2 (05:11):
It definitely takes them getting used to.
Speaker 1 (05:13):
So I have to ask, if someone has relied on
Excel their whole career, isn't learning concepts like variable scope
and loops going to feel like an overwhelming learning curve
just to do some basic structural math.
Speaker 2 (05:24):
It's a fair question. It absolutely takes time to let
go of that cell grid mindset. The initial friction is
very real, but the text emphasizes that the payoff comes
from the specialized libraries that actually do the heavy lifting
for you.
Speaker 1 (05:38):
You don't have to build everything from scratch, not at all.
Speaker 2 (05:40):
Once you understand the basics of how Python handles memory,
you realize the ecosystem actually makes the advanced math much
easier and significantly more reliable than a spreadsheet.
Speaker 1 (05:49):
Okay, so the initial learning curve is just kind of
the price of admission to get to the good stuff.
Let's look at those heavy lifters then, starting with numb.
Speaker 2 (05:56):
Pie Ah, numpi. This is where things get fast.
Speaker 1 (06:00):
Yeah, Because unlike standard Python lists, NUMPI utilizes something called
the rays. And the trick here is that a numpire
ray can only hold one data type like all integers
or all floats right right.
Speaker 2 (06:11):
And because it doesn't have to check the data type
of every single item one by one, numb pi operates
incredibly fast. When handling complex vectors and matrices, it performs
what we call element wise operations.
Speaker 1 (06:24):
I like to think of numb PI as like a
bulk warehouse forklift. It's not moving one tiny box at
a time, It's operating on an entire palette of numbers
all at once.
Speaker 2 (06:35):
That visual perfectly captures the mechanism standard. Python checks each
item individually, which obviously takes processing time. Numb Pi knows
the whole palette is uniform, so it just moves it instantly.
Speaker 1 (06:45):
Which is huge for massive calculations.
Speaker 2 (06:47):
Absolutely. The source material gives a highly practical example to
demonstrate this. It looks at calculating the internal forces of
a simply supported beam.
Speaker 1 (06:55):
Okay, let's walk through that.
Speaker 2 (06:56):
So imagine you have a distributed load, which we'll call qus,
of twenty kilinotins per meter over a span length of
five meters.
Speaker 1 (07:04):
Got it.
Speaker 2 (07:05):
In a spreadsheet, you might calculate the sheer and bending
moment at a few distinct points, or you know, drag
a formula down a column for one hundred points, just
hoping you don't mess up the absolute cell references.
Speaker 1 (07:17):
Yeah, and if the beam length changes later, you have
to go in and adjust all those rows manually.
Speaker 2 (07:21):
To night precisely. But in Python, you use a numbpi
array to represent a discretized set of points, say one
thousand tiny slices along the entire beam. You write the
equilibrium equations exactly once, apply them across the entire numbpi array,
and in a fraction of a second, you have the
exact sheer and moment values for the entire span.
Speaker 1 (07:42):
Wow, literally one line of code in the entire beam
is calculated. Yeah, but okay, numb pi axes are forklift
for heavy number crunching when we already know the inputs.
But in structural engineering, we often don't have the numbers yet, right,
Like we're trying to find an unknown like the exact
position of a neutral axis in some weird shape.
Speaker 2 (08:01):
Right, the geometry can get complicated, and.
Speaker 1 (08:03):
A standard calculator can't really help if you don't have
the inputs. So how do we solve that underlying algebra?
Speaker 2 (08:09):
That is the perfect question to introduce SIMP simply. Yeah,
it stands for Symbolic Python. It's a computer algebra system
or CAS. And what's cool is that simply doesn't just
crunch numbers. It performs symbolic calculation.
Speaker 1 (08:23):
Meaning it uses symbols instead.
Speaker 2 (08:24):
Of numbers exactly. It keeps variables as unknown symbols like
an X or a y, so you can perform actual
calculus like derivatives and integrals right in the code.
Speaker 1 (08:34):
So it's essentially like having a digital calculus professor inside
your machine.
Speaker 2 (08:38):
That's exactly what it is you hand.
Speaker 1 (08:39):
It an equation with missing variables, and it solves the
algebra for you before you ever plug the numbers in
I know the book manches. You can use the sol
set function to find the roots of complex equations or
lens solve for massive linear.
Speaker 2 (08:52):
Systems, and that symbolic capability is an absolute life saver
for structural analysis when you're integrating a stress distribution over
a complex nonsymmetrical cross section, doing it by hand or
trying to approximate it and excel it just invites rounding
errors and algebraic mistakes.
Speaker 1 (09:10):
Oh for sure.
Speaker 2 (09:11):
Symb handles the symbolic algebra flawlessly. It gives you the
exact mathematical formula before you even try to evaluate it numerically.
Speaker 1 (09:19):
Okay, so we had the forklift to the data rays
and the professor for the algebra. But calculating a single
beam in isolation is really just the beginning, isn't it?
Speaker 2 (09:27):
It is? Real projects are much bigger.
Speaker 1 (09:29):
Yeah, Real engineering projects involve massive data sets, dozens of
different load cases, and you need complex visualizations to even
make sense of it all. So moving beyond a single calculation,
how do we wrangle all that real world data? Without
just drowning in it.
Speaker 2 (09:43):
To handle real scale, you turn to Pandas the animal
the library. Actually, PANDAS introduces a data structure called a
data frame. If numb PI is the forklift, PANDAS is
basically the central nervous system for your data.
Speaker 1 (09:55):
Okay, I like that.
Speaker 2 (09:56):
It can seamlessly load external files like csvs or excel files,
automatically parsing the headers, handling any missing data, and just
aligning everything into a clean, quariable structure.
Speaker 1 (10:08):
So instead of a turbo charge spreadsheet, it's more like
a database where you define the logic and it just
cascades through everything automatically.
Speaker 2 (10:15):
Exactly.
Speaker 1 (10:16):
The book uses PANDAS for a really great scenario, a
two span continuous beam.
Speaker 2 (10:22):
Oh that's a perfect example.
Speaker 1 (10:24):
Yeah. So the engineer has to manage multiple different load combinations,
like maybe you have four point five kilo newtons perimeter
on one span and three point two on the other,
and then you have to check the reverse of that
and then check both together.
Speaker 2 (10:34):
And the goal there is to calculate the envelopes, right,
which are the absolute maximum and minimum values of shear
and bending moment across all those possible load combinations.
Speaker 1 (10:45):
Exactly and processing those envelopes is where traditional methods usually
break down. In Excel, you might have a separate tab
for every single load combination, and then a master tab
trying to pull the maximums from all the others. It
is incredibly fragile.
Speaker 2 (10:58):
It really is one broken link and the whole thing
is wrong.
Speaker 1 (11:01):
But Pandas provides true scalability. A data frame processes one
hundred load combinations using the exact same logic it uses
to process too. You define the operation, say, finding the
maximum moment at each point, and Pandas just applies it
across the entire data.
Speaker 2 (11:17):
Set instantly, which is amazing.
Speaker 1 (11:19):
It completely eliminates that manual copying and pasting between tabs
that causes so many catastrophic engineering errors.
Speaker 2 (11:26):
And once Pandas has organized all that data and found
the maximum envelopes, we need to actually see it. Right.
You can't just hand a client or a checker a
giant list of number.
Speaker 1 (11:34):
No, they throw it right back at you.
Speaker 2 (11:36):
Right. So you use a library called matplotlib, specifically the
pipe plot module to turn that data frame into visual
shear and bending moment diagrams. It really mimiate the plotting
behavior of matt Lab which a lot of engineers are
already very familiar with.
Speaker 1 (11:50):
That visual sanity check is so important.
Speaker 2 (11:53):
Visualization is a critical quality assurance step. I mean, the
math might execute perfectly, but you should never blindly trust
the output without verifying the physical behavior. A diagram instantly
tells an engineer if a bending moment looks physically correct
based on the supports. Map plotlib gives you that immediate
visual feedback.
Speaker 1 (12:12):
Okay, so we have our data organized, scaled, and visualized,
but abstract math and data rays only take us so far.
How do we apply this programming workflow to actual physical
building standards? Because the book specifically dives into European standards,
the eurocodes to show how Python handles physical materials.
Speaker 2 (12:31):
Yeah, let's examine how the text supplies this to steel designed. First,
it walks through calculating the properties of an asymmetric welded ibeam.
You need to find the gross area, the centroid, and
the elastic section modulus right, because the top and bottom
flanges are asymmetrical. The center the neutral axis isn't just
dead center. Finding its exact position requires setting up an
equation where the first moment of area above the axis
(12:53):
equals the first moment of area below it.
Speaker 1 (12:55):
And this is exactly where Simpy comes back in to
save the day. You don't have to manually solve the
quadratic equation. You dynamically set up the equation with simpi,
leaving the neutral axis as an unknown symbol, and it
algebraically solves for the exact millimeter mark.
Speaker 2 (13:12):
It's so clean, it really is.
Speaker 1 (13:14):
But while steel is relatively straightforward, anyone who is designed
a concrete column knows the absolute headache of the MN
interaction curve.
Speaker 2 (13:23):
This is where it gets really interesting.
Speaker 1 (13:25):
Oh, concrete is significantly more demanding because it's a composite material.
You have concrete taking compression and steel rebar taking tension,
and it exhibits highly nonlinear behavior.
Speaker 2 (13:36):
It's not simple math, not at all.
Speaker 1 (13:38):
The book tackles the ultimate limit states or uls for
a typical concrete section. Let's say said two five point
thirty concrete paired with B four fifty c steel reinforcement.
You have to calculate that MN interaction, which is the
exact relationship between the bending moment and the axial force
that will bring the section to total failure and balancing
bending moment against axial force in Excel usually requires a massive,
(14:01):
clunky lookup table with circular references that constantly break, but
the book explains how Python handles it entirely differently right
by breaking the concrete section down into five distinct strain domains.
Speaker 2 (14:13):
Yes, to map the failure envelope accurately, you have to
track the strain across the entire cross section. Domain one
represents the section under pure tension. As you move through
domains two, three, and four, the neutral axis shifts down
through the concrete, transitioning from pure bending to mostly compression.
And finally, domain five is when the entire section is
(14:35):
under pure uniform compression.
Speaker 1 (14:37):
So instead of a static lookup table, Python uses a
four loop. The program essentially steps through the cross section
millimeter by millimeter. At every single slice, it calculates the
stress based on those five domains, calculates the force, and
adds it to a running total YEP. It iterates this
process hundreds of time that a fraction of a second
to plot the final limited resistance diagram that famous onion curve.
Speaker 2 (14:57):
And honestly writing that specific is a rigorous exercise, but
the text uses this concrete example to teach a brilliant
structural programming concept.
Speaker 1 (15:07):
Oh, the modularity thing exactly.
Speaker 2 (15:10):
You do not rewrite that massive block of KURD every
time you need to check a new concrete column on
a new project. The book as you save all that
complex MN interaction logic into a separate external file called
MN doc pi.
Speaker 1 (15:26):
It's like you are building your own proprietary engineering software.
You sit down, you write the complex physics governing those
five string domains exactly once, and you put it in
a digital box. Yes, then on every future project you
ever work on, you just open your Jupiter notebook and
write one single line of code in m MAN. You
pass that module your new columns dimensions and material strengths,
(15:46):
and it instantly spits out the exact limit resistance diagram.
Speaker 2 (15:49):
What stands out to you is the listener. Is it
the mathematical precision of iterating millimeter by millimeter through those
strain domains, or is it the ability to build your
own reusable digital tools. Great question to think about, because
that modularity creating assets like the men pi file is
the true superpower of transitioning to Python. You are building
(16:09):
an evergrowing library of knowledge that makes you exponentially faster
and more accurate on every subsequent project.
Speaker 1 (16:16):
That modularity completely redefines efficiency, and the book shows how
this applies to steel columns as well. Say you have
an H three hundred B steel column subject to buckling
using pandas you load up dozens of axial and horizontal
load combinations, your script filters through all of them, checks
the interaction factors against the Eurocode requirements, and verifies the
(16:37):
buckling resistance for every single scenario in milliseconds.
Speaker 2 (16:40):
It is incredibly powerful, but performing the calculation, even at
that speed is only half the job of a structural engineer.
Speaker 1 (16:48):
You're right. I mean you've calculated the properties, verified the
concrete domains, and designed the steel column. But the city
permittee office, your client, your senior project manager, they do
not want to look at a raw Python script or
terminal window.
Speaker 2 (17:00):
Definitely not.
Speaker 1 (17:01):
They want a clean report. So how do we actually
deliver the final results?
Speaker 2 (17:05):
This brings us to the ultimate workflow step detailed in
the source material, which is exporting your Jupiter notebook directly
into Latex.
Speaker 1 (17:13):
The dex is amazing.
Speaker 2 (17:14):
For those unfamiliar, Latex is a high quality type setting
system widely used in academia and engineering. It's for producing
incredibly clean professional scientific documents.
Speaker 1 (17:26):
The book illustrates this with an example of calculating the
maximum deflection for three different simply supported steel beams using
an IPE two twenty section. Imagine you need to calculate
this for a client. Normally you'd calculate one beam and
excel duplicate the tab twice, hopefully remember to update the
inputs on all three, and then manually type the final
(17:46):
dislections into a word.
Speaker 2 (17:48):
Document report a recipe for typos exactly.
Speaker 1 (17:51):
But with Jupiter you write the logic once, run the
three variations, and then use a tool called nb convert
with a custom template. You actually instruct the program to
hide the code sales, so all the underlying Python programming
completely disappears.
Speaker 2 (18:03):
And the output generated is a pristine, professionally formatted PDF report.
It contains LATEX formatted tables of your load results right
alongside the map plot lib sheer diagrams we discussed earlier,
completely ready for print or official submission.
Speaker 1 (18:17):
It closes the loop entirely.
Speaker 2 (18:19):
It does, and more importantly, by generating the final report
directly from the calculation environment, you eliminate the risk of
transcription errors. We've all seen the classic error where an
engineer calculates the correct sheer value and Excel, but manually
types the wrong number into the final word document.
Speaker 1 (18:35):
Oh yeah, it happens all the time.
Speaker 2 (18:36):
This pipeline makes that mistake basically impossible.
Speaker 1 (18:39):
From raw CSV data through the complex physics of concrete
strain domains straight to a stamped, mathematically flawless PDF report.
Python armed with numb, pie, pandas and SIMPI really isn't
just a tool for software developers anymore. It is the
modern civil engineer's artimate multi toool, combining calculation, data management,
(18:59):
and professionals porting into one seamless automated workflow.
Speaker 2 (19:03):
It allows the engineer to stop acting like a human
calculator dragging formulas down a grid, and start acting like
a true designer evaluating complex systems at scale.
Speaker 1 (19:12):
We started this deep dive talking about the dread of
a fragile, hand drilled EXCEL spreadsheet, and we're ending with
a highly automated, modular power tool. So as we wrap up,
only leave you with a short exercise to ponder to
really reinforce what we've covered today.
Speaker 2 (19:28):
I love this idea.
Speaker 1 (19:29):
Imagine your tasked with designing a fifty story building. We
aren't talking about two or three load cases. We're talking
about thousands of dynamic, wind and seismic load combinations across
hundreds of different column types. Think about the specific concepts
we discussed today, reusable modules like that mn dot PI
script for your concrete columns and Panda's data frames for
(19:50):
processing the thousands of load cases simultaneously.
Speaker 2 (19:53):
It's a huge step up.
Speaker 1 (19:54):
How would applying these specific Python concepts completely redefine the
timeline and the structural safe you have that fifty story
project compared to traditional spreadsheet methods. And taking a step further,
what other disciplines, say aerospace engineering testing wingloads, or even
finance testing market variables, could steal this exact structural engineering
(20:14):
workflow to solve their own massive data bottlenecks.
Speaker 2 (20:18):
The underlying mechanics of processing arrays and modular logic are
truly universal. It's a fascinating question of scale and cross
disciplinary innovation.
Speaker 1 (20:27):
Something to think about the next time you open a
blank spreadsheet and reach for that handro Thanks for joining
us on this deep dive into the source material. Catch
you next time.