WEBVTT

00:00:00.100 --> 00:00:03.000
Python is used for a wide variety of software projects.

00:00:03.000 --> 00:00:07.980
One area that's really gained a lot of momentum is in the computational space, including data science.

00:00:07.980 --> 00:00:13.300
On this episode, we welcome back Allen Downey to dive into a particular slice of this space,

00:00:13.300 --> 00:00:17.380
simulation problems in Python and physics and engineering in general.

00:00:17.380 --> 00:00:23.440
This is Talk Python To Me, episode 423, recorded June 6, 2023.

00:00:23.440 --> 00:00:39.860
Welcome to Talk Python To Me, a weekly podcast on Python.

00:00:39.860 --> 00:00:41.600
This is your host, Michael Kennedy.

00:00:41.600 --> 00:00:46.720
Follow me on Mastodon, where I'm @mkennedy, and follow the podcast using @talkpython,

00:00:46.720 --> 00:00:49.080
both on fosstodon.org.

00:00:49.080 --> 00:00:51.680
Be careful with impersonating accounts on other instances.

00:00:51.680 --> 00:00:52.660
There are many.

00:00:53.120 --> 00:00:57.720
Keep up with the show and listen to over seven years of past episodes at talkpython.fm.

00:00:57.720 --> 00:01:01.760
We've started streaming most of our episodes live on YouTube.

00:01:01.760 --> 00:01:07.460
Subscribe to our YouTube channel over at talkpython.fm/youtube to get notified about upcoming

00:01:07.460 --> 00:01:09.280
shows and be part of that episode.

00:01:09.280 --> 00:01:13.940
This episode of Talk Python To Me is brought to you by InfluxDB.

00:01:13.940 --> 00:01:19.600
InfluxDB is the database purpose built for handling time series data at a massive scale

00:01:19.600 --> 00:01:20.940
for real-time analytics.

00:01:20.940 --> 00:01:24.800
Try them for free at talkpython.fm/InfluxDB.

00:01:25.280 --> 00:01:28.620
And it's brought to you by the PyBites Developer Mindset Program.

00:01:28.620 --> 00:01:33.400
PyBytes' core mission is to help you break the vicious cycle of tutorial paralysis through

00:01:33.400 --> 00:01:35.060
developing real-world applications.

00:01:35.060 --> 00:01:39.860
The PyBites Developer Mindset Program will help you build the confidence you need to become

00:01:39.860 --> 00:01:41.360
a highly effective developer.

00:01:41.360 --> 00:01:44.740
Check it out at talkpython.fm/PDM.

00:01:44.740 --> 00:01:45.960
Hey, Alan.

00:01:45.960 --> 00:01:47.260
Welcome to Talk Python To Me.

00:01:47.260 --> 00:01:48.020
Welcome back.

00:01:48.140 --> 00:01:48.560
Thank you.

00:01:48.560 --> 00:01:49.480
It's a pleasure to be here.

00:01:49.480 --> 00:01:50.480
Pleasure to have you back.

00:01:50.480 --> 00:01:55.400
We were talking just a little bit before the show, realizing it's only been six years since

00:01:55.400 --> 00:01:56.360
you were on the podcast.

00:01:56.360 --> 00:01:56.980
How about that?

00:01:56.980 --> 00:02:03.420
Last time we talked about Python and engineering way back in 2017, which was a lot of fun and

00:02:03.420 --> 00:02:08.540
has some interesting lead-ins to some of the things that are actually created now.

00:02:08.540 --> 00:02:12.080
You were hinting I'm working on this project about simulating things with Python.

00:02:12.300 --> 00:02:13.500
Here we are talking about it.

00:02:13.500 --> 00:02:13.740
Yeah.

00:02:13.740 --> 00:02:18.180
I was just getting started then and the book has come out very recently.

00:02:18.180 --> 00:02:20.720
So we've kind of bookended the project.

00:02:20.720 --> 00:02:21.740
Absolutely.

00:02:21.740 --> 00:02:25.760
Well, it's quite a project and it's a very interesting one.

00:02:25.760 --> 00:02:31.520
I think a lot of people out there, they hear maybe they should use Python instead of, I don't

00:02:31.520 --> 00:02:36.840
know, MATLAB or some other language for modeling their domain, right?

00:02:36.840 --> 00:02:42.100
And with your book that you put together, which is available for purchase, or you can

00:02:42.100 --> 00:02:43.080
read it online for free.

00:02:43.080 --> 00:02:44.000
That works for you.

00:02:44.000 --> 00:02:45.960
It has a bunch of different examples.

00:02:45.960 --> 00:02:46.820
How many examples?

00:02:46.820 --> 00:02:47.760
Maybe 30 or so?

00:02:47.760 --> 00:02:48.940
I think that's right.

00:02:48.940 --> 00:02:53.200
There are examples in the chapter and then case studies that get into more detail.

00:02:53.200 --> 00:02:53.500
Yeah.

00:02:53.500 --> 00:02:59.640
So there's a lot of different areas of specialization where you're bringing Python to answer problems.

00:02:59.640 --> 00:03:02.360
And we're going to have a lot of fun talking about that.

00:03:02.360 --> 00:03:04.620
But let's just do a quick catch up.

00:03:04.620 --> 00:03:06.960
It's been six years since we last spoke.

00:03:06.960 --> 00:03:07.540
What have you been up to?

00:03:07.540 --> 00:03:09.900
Well, I've changed jobs a couple of times.

00:03:09.900 --> 00:03:13.760
I was a professor at Olin College for 19 years.

00:03:13.760 --> 00:03:16.840
I left at the end of last May.

00:03:16.840 --> 00:03:23.060
And then I was at Driven Data for a little while, working on data competitions and machine

00:03:23.060 --> 00:03:23.440
learning.

00:03:23.440 --> 00:03:28.460
And then recently I've joined Brilliant, where I'm doing curriculum design.

00:03:28.460 --> 00:03:29.440
That sounds very fun.

00:03:29.820 --> 00:03:33.340
You know, first of all, leaving college you were at for 19 years.

00:03:33.340 --> 00:03:34.700
That's a big deal.

00:03:34.700 --> 00:03:35.040
Yeah.

00:03:35.040 --> 00:03:37.700
I've been an academic pretty much all the way through.

00:03:37.700 --> 00:03:39.160
You know, I graduated from college.

00:03:39.160 --> 00:03:40.160
I went to grad school.

00:03:40.160 --> 00:03:41.300
I had my first job.

00:03:41.300 --> 00:03:45.700
I was a faculty member at Colby College and then Wellesley College.

00:03:46.160 --> 00:03:48.700
And then, as I said, Olin for 19 years.

00:03:48.700 --> 00:03:50.880
So it's a real change of career.

00:03:50.880 --> 00:03:52.340
How's it going?

00:03:52.340 --> 00:03:54.320
It's good.

00:03:54.320 --> 00:03:55.240
I'm learning a ton.

00:03:55.240 --> 00:03:59.280
You just, you know, whenever you start something new, you're always, you're on this, you know,

00:03:59.280 --> 00:04:03.640
the steep part of the learning curve, which is challenging, but it's also just exciting.

00:04:03.860 --> 00:04:06.340
You're getting exposed to different things, learning a ton.

00:04:06.340 --> 00:04:07.100
Yeah, absolutely.

00:04:07.100 --> 00:04:12.020
And working at Brilliant now, you know, Brilliant's a good company.

00:04:12.020 --> 00:04:15.280
They've been past sponsors of the show, which is great.

00:04:15.280 --> 00:04:20.240
And, you know, maybe just talk a bit about how you think about curriculum design, since

00:04:20.240 --> 00:04:21.340
that's what you're focused on there.

00:04:21.340 --> 00:04:27.680
How do you think about putting together small class, not semester-wide classes for people

00:04:27.680 --> 00:04:28.100
to learn?

00:04:28.100 --> 00:04:29.620
Yeah, that's a big part of it.

00:04:29.620 --> 00:04:31.040
It's a different format.

00:04:31.300 --> 00:04:37.600
It's smaller, as you said, it's interactive in the sense that the learner is interacting

00:04:37.600 --> 00:04:43.300
with these, you know, graphical elements and other ways of communicating ideas visually.

00:04:43.300 --> 00:04:49.740
We use a lot of animation and the text is deliberately very concise.

00:04:49.740 --> 00:04:52.200
We're trying to, you know, show, not tell.

00:04:52.200 --> 00:04:55.540
And that's a really different kind of curriculum design for me.

00:04:55.540 --> 00:04:57.960
I'm used to, you know, I have a semester-long course.

00:04:57.960 --> 00:04:59.780
I've got several hours a week.

00:05:00.560 --> 00:05:01.700
It's very different.

00:05:01.700 --> 00:05:04.660
And that's part of the challenge that was appealing to me.

00:05:04.660 --> 00:05:10.140
Because I saw some of the courses and I was very impressed with the pedagogy and the opportunities

00:05:10.140 --> 00:05:14.020
that you have there with animation and sound and interactives.

00:05:14.020 --> 00:05:15.800
It's a very different kind of teaching.

00:05:15.800 --> 00:05:20.280
But it's not, there's no, I don't have any interaction with students.

00:05:20.280 --> 00:05:21.800
So that's a challenge as well.

00:05:21.800 --> 00:05:22.760
It's a big challenge.

00:05:22.900 --> 00:05:26.360
I went from teaching in person to teaching online as well.

00:05:26.360 --> 00:05:27.320
Not through Brilliant.

00:05:27.320 --> 00:05:30.460
But I think there's a couple of really big differences.

00:05:30.460 --> 00:05:38.140
One is when you're either, you have a student for a semester, Monday, Wednesday, Friday at 11 to 12.

00:05:38.140 --> 00:05:40.980
Or if you're doing a week-long training class in person.

00:05:40.980 --> 00:05:43.860
Those groups are captive, right?

00:05:43.860 --> 00:05:50.800
And so the constant need to keep their attention for every single minute is really different, right?

00:05:50.860 --> 00:05:57.800
Because it's not impossible, but it's rare that students just get up and walk out because, you know, there's a five-minute section they weren't engaged with.

00:05:57.800 --> 00:05:59.320
But they could easily leave a website.

00:05:59.320 --> 00:05:59.740
Yeah.

00:05:59.920 --> 00:06:04.800
It's particularly in a format like Brilliant, you know, there's not a certificate at the end.

00:06:04.800 --> 00:06:12.380
The motivation to keep going is you're having a good time and you're intrinsically interested in the topic.

00:06:12.380 --> 00:06:16.860
So from my point of view as an instructor, the challenge there is to maintain that.

00:06:16.860 --> 00:06:21.140
It has to be interesting, engaging all the time.

00:06:21.140 --> 00:06:25.160
As you said, if you've got, you know, a five-minute lull, you might lose your audience.

00:06:25.160 --> 00:06:25.480
Yeah.

00:06:25.480 --> 00:06:35.800
The other part that is a big difference is when you have those folks in class, even in a Zoom meeting to a degree, you get immediate feedback of how does an idea land?

00:06:35.800 --> 00:06:38.100
If I present it this way, are they engaged?

00:06:38.100 --> 00:06:41.380
If I present it, or are they clearly not getting it?

00:06:41.380 --> 00:06:49.380
Whereas you put it out into the world at Brilliant or Talk Python or wherever, and they've got to, you take a guess and you put it out there, right?

00:06:49.380 --> 00:06:50.320
You don't get that feedback.

00:06:50.320 --> 00:06:50.640
Yeah.

00:06:50.640 --> 00:06:51.060
Not directly.

00:06:51.060 --> 00:06:52.400
That's definitely challenging.

00:06:52.520 --> 00:07:03.240
We do have some signals where we can see if a learner is getting stuck at a particular place or if we see a lot of drop-off on a particular lesson, we can go in and try to figure out what's happening.

00:07:03.240 --> 00:07:05.240
We get a little bit of explicit feedback.

00:07:05.240 --> 00:07:07.720
Sometimes the learners will tell us what's wrong.

00:07:07.720 --> 00:07:12.280
But most of the time, you're kind of, it's on you to make sure that that lesson works.

00:07:12.280 --> 00:07:19.920
And your colleagues were constantly reviewing each other's lessons and looking for those places where we think we might lose learners.

00:07:19.920 --> 00:07:20.360
Excellent.

00:07:20.360 --> 00:07:21.900
Well, I'm sure it's a lot of fun.

00:07:21.900 --> 00:07:24.660
Some nice comments in the live chat out here.

00:07:24.660 --> 00:07:26.280
People appreciate that as well.

00:07:26.280 --> 00:07:35.620
So one thing that you said you learned, which I haven't really learned before, is I don't even really know what it looks like, is Elm.

00:07:35.620 --> 00:07:36.460
Tell us about Elm.

00:07:36.460 --> 00:07:36.940
What is this?

00:07:36.940 --> 00:07:38.280
This is a programming language.

00:07:38.280 --> 00:07:41.020
As it says, it's primarily for web applications.

00:07:41.620 --> 00:07:44.140
It is a functional programming language.

00:07:44.140 --> 00:07:47.060
And it's mostly a stateless computational model.

00:07:47.060 --> 00:07:50.040
So it's very different from Python.

00:07:50.040 --> 00:07:51.600
I've been learning it.

00:07:51.600 --> 00:07:53.860
This is what we use for a lot of the interactive elements.

00:07:53.860 --> 00:07:56.000
And it was new to me.

00:07:56.000 --> 00:07:58.040
Honestly, I had not even heard of it.

00:07:58.040 --> 00:08:00.080
But it's been great.

00:08:00.080 --> 00:08:03.420
I just, you know, it's been a little while since I learned a new language.

00:08:03.420 --> 00:08:06.280
It's been about 23 years since I learned a new language.

00:08:06.280 --> 00:08:12.500
And I've done functional programming, but I haven't used it, you know, really for applications.

00:08:12.500 --> 00:08:15.020
So this has been, you know, challenging but fun.

00:08:15.020 --> 00:08:18.740
It looks a little bit like Lisp meets HTML.

00:08:18.740 --> 00:08:20.040
That's not bad.

00:08:20.040 --> 00:08:20.620
Yeah.

00:08:20.620 --> 00:08:21.080
Okay.

00:08:21.080 --> 00:08:23.480
Certainly the semantics is very Lisp-like.

00:08:23.480 --> 00:08:27.060
Syntax can be, although not too many parentheses.

00:08:27.060 --> 00:08:29.200
Not as many.

00:08:29.200 --> 00:08:32.760
You get that blister on your pinky or whatever finger you use for the parentheses.

00:08:32.760 --> 00:08:34.820
Maybe your right index figure.

00:08:34.820 --> 00:08:35.220
Right.

00:08:35.220 --> 00:08:35.900
Or ring figure.

00:08:35.900 --> 00:08:36.500
Yeah.

00:08:36.500 --> 00:08:37.160
Yeah.

00:08:37.160 --> 00:08:40.420
And then the syntax, it has a couple of nice features like pipes.

00:08:40.420 --> 00:08:44.080
So, you know, taking a value and piping it through a sequence of functions.

00:08:44.080 --> 00:08:48.040
And of course, you know, functional features like passing around functions as first class

00:08:48.040 --> 00:08:50.020
objects and partial function evaluation.

00:08:50.020 --> 00:08:52.020
Is this a front-end language, like a JavaScript?

00:08:52.020 --> 00:08:54.040
Or is it a back-end language, more like Python?

00:08:54.040 --> 00:08:54.500
Yeah.

00:08:54.500 --> 00:08:56.740
No, front-end, it's getting compiled into JavaScript.

00:08:56.740 --> 00:08:57.180
Okay.

00:08:57.180 --> 00:09:00.600
But it is strongly typed, like extremely strongly typed.

00:09:00.600 --> 00:09:03.040
Like integer and float are incompatible types.

00:09:03.040 --> 00:09:04.560
There we go.

00:09:05.160 --> 00:09:06.680
So very strongly typed.

00:09:06.680 --> 00:09:12.280
But that, along with a lot of error checking, gives you some more confidence that if you put

00:09:12.280 --> 00:09:17.560
this on a web page and a large number of people interact with it, there are maybe fewer errors

00:09:17.560 --> 00:09:19.180
that can get past a compiler.

00:09:19.420 --> 00:09:24.580
You know, a really dynamically typed language like Python, you're rolling the dice.

00:09:24.580 --> 00:09:25.860
You deploy that code.

00:09:25.860 --> 00:09:28.320
You know, some of those lines of code have never run.

00:09:28.320 --> 00:09:30.760
And the first time they do, you might be in trouble.

00:09:31.100 --> 00:09:32.120
The type hints are helping.

00:09:32.120 --> 00:09:34.740
mypy is helping, but that's not a runtime thing.

00:09:34.740 --> 00:09:39.240
Pydantic, for example, is a runtime version that option that helps a lot.

00:09:39.240 --> 00:09:41.980
Before we move off this front-end stuff, then we'll get to the modeling.

00:09:41.980 --> 00:09:46.000
Have you been tracking PyScript and the front-end Python stuff?

00:09:46.000 --> 00:09:46.840
Is that interesting to you?

00:09:46.940 --> 00:09:51.220
It definitely is, and especially from a teaching point of view, getting people into Python.

00:09:51.220 --> 00:09:57.800
One of the challenges, you know, from way back has always been, how do you get a new programmer

00:09:57.800 --> 00:10:00.920
to the point of executing their first line of code?

00:10:00.920 --> 00:10:04.980
That is definitely not as big a barrier as it used to be.

00:10:04.980 --> 00:10:05.660
It used to be.

00:10:05.660 --> 00:10:08.440
You know, you had to install things and download things and all that.

00:10:08.440 --> 00:10:11.140
But yeah, the lower that barrier, the better.

00:10:11.140 --> 00:10:14.780
And yeah, I think PyScript is one of the things that can help to lower it.

00:10:14.780 --> 00:10:16.600
Yeah, I do too. I'm very excited about PyScript.

00:10:16.600 --> 00:10:22.940
It had been interesting in the realm of kind of different ways to execute notebook-style code

00:10:22.940 --> 00:10:25.660
and so on when it was based on Pyodide.

00:10:25.660 --> 00:10:30.960
And now that they're talking about moving to MicroPython, it starts to get into the realm of it.

00:10:30.960 --> 00:10:34.660
It could download the same size as Vue or Angular almost.

00:10:34.660 --> 00:10:38.100
And then it becomes, maybe you can make real apps with this thing.

00:10:38.100 --> 00:10:39.840
So I'm looking forward to see where that goes.

00:10:39.840 --> 00:10:42.740
Oh, interesting. I had not heard about that. So that's exciting.

00:10:43.060 --> 00:10:49.740
Yeah, yeah. One of the big things that they're trying out, I had a couple of the folks on from various projects four or five months ago,

00:10:49.740 --> 00:10:54.900
is they're trying to, instead of using full CPython as the foundation, to use MicroPython,

00:10:54.900 --> 00:10:58.720
which means the download goes from like 10 megs to 100K.

00:10:58.720 --> 00:10:59.480
Yeah.

00:10:59.480 --> 00:11:02.740
When you're talking 100K download, you're like, you know, that's kind of like a big JavaScript.

00:11:03.000 --> 00:11:09.740
And if it's over a CDN and it's cached, you know, maybe you could just make that part of your app in general, not as a specialized thing.

00:11:09.740 --> 00:11:20.400
Yeah, that's interesting, particularly because I think one of the other challenges for Python right now is it takes a while before you're doing really interesting stuff.

00:11:20.400 --> 00:11:27.440
And, you know, JavaScript, for example, you can immediately start doing front end kinds of interactions.

00:11:27.740 --> 00:11:34.160
And a beginner can start to write programs where it resembles the kind of apps that they're using.

00:11:34.160 --> 00:11:36.220
And I think that's a pretty important hook.

00:11:36.220 --> 00:11:37.920
For Python, that's a long path.

00:11:37.920 --> 00:11:40.940
And so it sounds like this could shorten that path quite a bit.

00:11:40.940 --> 00:11:42.640
It sure could. That would be very interesting.

00:11:42.640 --> 00:11:48.120
And I think your insight there comes in as a bit of a teacher as well, right?

00:11:48.320 --> 00:11:53.600
Like it's one thing as an engineer, like I'm going to build this thing, so I'm going to choose this language for such and such.

00:11:53.600 --> 00:11:59.640
But as a teacher, you realize like if you don't have a win early enough in the learning cycle, then you might just bail.

00:11:59.640 --> 00:12:02.000
And for a lot of people, a win is I have a UI.

00:12:02.000 --> 00:12:09.260
I have a thing that looks like an app that I could see on my phone or I could see in my web browser or something like that, right?

00:12:09.260 --> 00:12:10.080
Yeah, definitely.

00:12:10.080 --> 00:12:13.520
Or a robot or some interaction with the real world.

00:12:13.520 --> 00:12:18.000
But yeah, converting Fahrenheit to Celsius is not going to do it.

00:12:18.000 --> 00:12:20.420
No, but Celsius to Fahrenheit, that one is the one.

00:12:20.420 --> 00:12:21.080
That's the one.

00:12:21.080 --> 00:12:21.680
Okay.

00:12:21.680 --> 00:12:26.360
But speaking of converting numbers and so on.

00:12:26.360 --> 00:12:33.340
This portion of Talk Python To Me is brought to you by Influx Data, the makers of InfluxDB.

00:12:33.340 --> 00:12:41.160
InfluxDB is a database purpose built for handling time series data at a massive scale for real-time analytics.

00:12:41.720 --> 00:12:48.500
Developers can ingest, store, and analyze all types of time series data, metrics, events, and traces in a single platform.

00:12:48.500 --> 00:12:50.960
So, dear listener, let me ask you a question.

00:12:50.960 --> 00:12:57.160
How would boundless cardinality and lightning-fast SQL queries impact the way that you develop real-time applications?

00:12:57.760 --> 00:13:08.720
InfluxDB processes large time series data sets and provides low-latency SQL queries, making it the go-to choice for developers building real-time applications and seeking crucial insights.

00:13:08.720 --> 00:13:17.820
For developer efficiency, InfluxDB helps you create IoT, analytics, and cloud applications using timestamped data rapidly and at scale.

00:13:18.220 --> 00:13:23.160
It's designed to ingest billions of data points in real-time with unlimited cardinality.

00:13:23.160 --> 00:13:31.540
InfluxDB streamlines building once and deploying across various products and environments from the edge, on-premise, and to the cloud.

00:13:31.540 --> 00:13:35.580
Try it for free at talkpython.fm/influxDB.

00:13:35.580 --> 00:13:38.000
The link is in your podcast player show notes.

00:13:38.000 --> 00:13:41.180
Thanks to Influx Data for supporting the show.

00:13:42.700 --> 00:13:44.320
Let's talk about your latest book.

00:13:44.320 --> 00:13:48.380
You have a lot of books over at Green Tea Press.

00:13:48.380 --> 00:13:51.700
This is your home for where your books go, right?

00:13:51.700 --> 00:13:52.000
Yeah.

00:13:52.000 --> 00:13:54.480
As well as links to other ones you've written at places like O'Reilly.

00:13:54.480 --> 00:13:55.140
Right.

00:13:55.140 --> 00:13:55.440
Yeah.

00:13:55.440 --> 00:14:01.080
So, everything starts here and there's a free version of all of the books and you can get to it from here.

00:14:01.080 --> 00:14:06.940
You can see kind of the evolution of my process because some of the earlier books, you know, some of them look better than others.

00:14:06.940 --> 00:14:08.020
Let's put it that way.

00:14:08.560 --> 00:14:16.360
And then links there for the ones that have been published, there are hard copies available and electronic versions in convenient format.

00:14:16.360 --> 00:14:22.680
I think we might have spoken about this six years ago, but it was six years ago and I'm not sure and I imagine a lot of people don't remember it.

00:14:22.680 --> 00:14:24.820
Did we talk about your textbook manifesto?

00:14:24.820 --> 00:14:25.340
What is this?

00:14:25.340 --> 00:14:34.700
That was what really got me started and came from my frustration with existing programming books, but also just textbooks in general.

00:14:35.140 --> 00:14:40.660
The way they're used in a lot of classes, they are expensive, they are way too big.

00:14:40.660 --> 00:14:46.720
You know, if there are 700 pages or a thousand pages, nobody's going to read that in a semester.

00:14:46.720 --> 00:14:55.340
And if you're assigning 50 pages a day, I think, you know, you're kidding yourself and the students are not getting much out of that.

00:14:55.340 --> 00:15:10.640
So this is the idea that you can write a book that your students can read and understand and that is at the size where you can do something like a flipped classroom where they are actually going to do some reading before class.

00:15:10.640 --> 00:15:12.900
Not 50 pages, but 10 maybe.

00:15:13.300 --> 00:15:13.960
Come to class.

00:15:13.960 --> 00:15:18.340
Now, as an instructor, I can help to figure out, you know, what are the problem spots?

00:15:18.340 --> 00:15:19.560
What should we cover in class?

00:15:19.560 --> 00:15:25.780
What can we do to practice those ideas in class to take advantage of the time when we're actually in a room together?

00:15:25.780 --> 00:15:28.320
So, you know, read when you're on your own.

00:15:28.320 --> 00:15:29.340
Come to class.

00:15:29.340 --> 00:15:33.640
Let's do things that are more useful than me standing at the front of the room talking to you.

00:15:33.720 --> 00:15:34.340
Yeah, sure.

00:15:34.340 --> 00:15:35.120
Okay.

00:15:35.120 --> 00:15:36.160
That makes a lot of sense.

00:15:36.160 --> 00:15:40.900
So let's dive into your book, Modeling and Simulation in Python.

00:15:40.900 --> 00:15:45.020
Now, as I'm going through this, I'm not sure what I would classify it as.

00:15:45.020 --> 00:15:47.060
Is this a science book?

00:15:47.060 --> 00:15:48.620
Is this an engineering book?

00:15:48.620 --> 00:15:49.800
Is it a programming book?

00:15:49.800 --> 00:15:52.220
It kind of feels like it's a little bit of all of those.

00:15:52.220 --> 00:15:54.100
How would you, what's your elevator pitch here?

00:15:54.100 --> 00:15:55.140
Yeah, it's that.

00:15:55.140 --> 00:16:02.700
It is the solution to a chicken and egg problem, which is that in an engineering curriculum, a science curriculum,

00:16:02.700 --> 00:16:12.400
and maybe even more broadly, I think, for teaching physics and math to almost anyone, a computational approach is really appealing.

00:16:12.400 --> 00:16:17.660
There are things that you can do with computation that are very difficult to do analytically.

00:16:17.660 --> 00:16:21.000
You can do more interesting things faster.

00:16:21.000 --> 00:16:22.340
So that's the appeal.

00:16:22.340 --> 00:16:28.380
The hard part is most people are not coming into college with programming experience.

00:16:28.380 --> 00:16:29.980
Some do, most don't.

00:16:30.260 --> 00:16:34.460
So whatever your curriculum is, but let me focus on engineering because that's where I was.

00:16:34.460 --> 00:16:41.000
You've got a cohort coming in who have programmed, a cohort who have never programmed, and then kind of maybe a middle.

00:16:41.000 --> 00:16:43.400
Maybe they've done like HTML or something like that.

00:16:43.640 --> 00:16:49.560
And now I want to teach them physical modeling, but I have to do kind of three things at the same time.

00:16:49.560 --> 00:16:59.020
The modeling piece, the physical models, the domain knowledge, you know, if it's a scientific system or an engineering system, whatever it is, and programming.

00:16:59.380 --> 00:17:01.760
And there's no good sequence.

00:17:01.760 --> 00:17:10.000
Like I can't send people out to take a computer science class, and then they come back and we do computational science.

00:17:10.000 --> 00:17:12.580
It's just there are a number of reasons that that doesn't work.

00:17:13.040 --> 00:17:18.260
And same thing if they go, let's say they go take calculus or linear algebra, and then they come back.

00:17:18.260 --> 00:17:22.880
Collecting that knowledge and then trying to synthesize it is really hard.

00:17:22.880 --> 00:17:27.560
And it means it's a sequence of courses instead of starting in right from the beginning.

00:17:27.560 --> 00:17:30.120
So those are some of the problems that we were working with.

00:17:30.240 --> 00:17:35.160
And the best solution, at least we think, is put it all together.

00:17:35.160 --> 00:17:40.420
We're going to teach people how to program using these physical models as examples.

00:17:40.420 --> 00:17:47.440
And so they're getting some mathematics, not a ton, kind of a gentle introduction to differential equations.

00:17:47.440 --> 00:17:52.840
Some physics, but it's a bit more broad because it's not just mechanics.

00:17:52.840 --> 00:17:59.360
And then some programming, but it's really a subset of programming that's focused on those domains.

00:17:59.880 --> 00:18:01.940
So that was my best explanation.

00:18:01.940 --> 00:18:03.540
Oh, it's good.

00:18:03.540 --> 00:18:04.080
It's good.

00:18:04.080 --> 00:18:08.800
I can see how there's not a real great solution for that in a college curriculum, right?

00:18:08.800 --> 00:18:14.920
You send them off to take a CS class, and they might come back of having done an introduction to programming course,

00:18:14.920 --> 00:18:17.860
but still not really be able to do too much, or an algorithms course.

00:18:17.860 --> 00:18:21.360
And like, I can really tell you about a doubly linked list.

00:18:21.360 --> 00:18:22.440
You're like, all right, well, you're still not ready.

00:18:22.440 --> 00:18:22.940
I'm sorry.

00:18:22.940 --> 00:18:23.660
You know, right?

00:18:23.660 --> 00:18:25.680
It's a challenge to bring these things together.

00:18:25.680 --> 00:18:33.720
I think that's generally a challenge in education a lot is to cross these things over and why a lot of people feel like certain things are, that's useless.

00:18:33.720 --> 00:18:34.500
I'll never use that.

00:18:34.500 --> 00:18:40.040
That doesn't have any value to me because it's taught in such an abstract, isolated silo.

00:18:40.240 --> 00:18:43.100
Yeah, and you never close the loop because we're making a promise.

00:18:43.100 --> 00:18:53.080
If we send a student to take a prerequisite class, the contract is, you go do this thing, and then when you come back, we're going to make it pay off.

00:18:53.080 --> 00:18:56.260
You're going to see the benefit, and we never do.

00:18:56.260 --> 00:18:57.980
It never pays off.

00:18:57.980 --> 00:18:59.160
It's tough.

00:18:59.160 --> 00:18:59.740
It's tough.

00:19:00.120 --> 00:19:05.500
So, like we said, there's about 30 different problems in here, like population growth.

00:19:05.500 --> 00:19:08.140
How long does it take for your coffee to cool?

00:19:08.140 --> 00:19:10.560
What's the optimal way to transfer it to work?

00:19:10.560 --> 00:19:14.560
Glucose, disease modeling, as well as vaccines.

00:19:14.560 --> 00:19:15.640
People can check out.

00:19:15.640 --> 00:19:19.560
So, I thought it might be fun for us to just pick out however many we get through.

00:19:19.560 --> 00:19:21.380
Let's say we take a shot at 10.

00:19:21.380 --> 00:19:22.200
We'll see if we get there.

00:19:22.200 --> 00:19:25.460
10 of these and just kind of talk through what is the problem?

00:19:25.460 --> 00:19:28.020
What are some of the Python ideas at play here?

00:19:28.020 --> 00:19:30.720
Maybe what are some of the math or science ideas as well?

00:19:30.720 --> 00:19:33.680
So, you want to start with world population?

00:19:33.680 --> 00:19:34.240
Sure.

00:19:34.240 --> 00:19:36.720
Yeah, this one was interesting for me.

00:19:36.720 --> 00:19:39.840
It's something I didn't know very much about, so I got to learn.

00:19:39.840 --> 00:19:47.300
I think it's a sweet spot of you don't need a lot of computational tools because this one comes very early in the book.

00:19:47.300 --> 00:19:52.860
But you can study a real system that's happening right now and get to understand it.

00:19:52.860 --> 00:19:54.840
So, it's a discrete system.

00:19:54.840 --> 00:19:59.180
So, we're just counting the number of people and modeling population growth.

00:19:59.180 --> 00:20:05.960
And so, the number of new people in any year is going to be some function of the current population.

00:20:05.960 --> 00:20:08.400
And so, we can introduce a couple of different models.

00:20:08.400 --> 00:20:10.040
You know, starting very simple.

00:20:10.040 --> 00:20:15.240
One of them says, what if we have the same number of births and deaths every year?

00:20:15.240 --> 00:20:21.780
Well, okay, the population would grow linearly or maybe shrink linearly, but it would be linear growth, constant slope.

00:20:21.780 --> 00:20:22.420
All right?

00:20:22.420 --> 00:20:23.720
What if it's proportional?

00:20:23.720 --> 00:20:27.900
What if we have a birth rate that's proportional to the current population?

00:20:28.360 --> 00:20:29.600
Some people might know.

00:20:29.600 --> 00:20:31.440
You're going to get exponential growth.

00:20:31.440 --> 00:20:40.080
And I think if you ask people what's going on in the world right now, they probably believe that we are experiencing exponential growth.

00:20:40.340 --> 00:20:41.460
That was my thought when I read this.

00:20:41.460 --> 00:20:42.160
I thought, oh, yeah, okay.

00:20:42.160 --> 00:20:45.480
So, we'll probably talk about geometric growth and those types of things.

00:20:45.480 --> 00:20:45.700
Yeah.

00:20:45.700 --> 00:20:46.140
Right.

00:20:46.140 --> 00:20:47.100
Well, that's the model.

00:20:47.100 --> 00:20:50.280
And we try to fit that model to the data, and it doesn't.

00:20:50.280 --> 00:20:56.760
And so, that's where the first lesson comes from, which is you can do all the theory you want, and eventually you will collide with data.

00:20:57.760 --> 00:21:00.380
And your theory may or may not survive the impact.

00:21:00.380 --> 00:21:02.100
And that's what happened here.

00:21:02.100 --> 00:21:06.120
The population is currently not growing exponentially.

00:21:06.440 --> 00:21:10.380
Going back to about 1960, it's pretty close to linear.

00:21:10.380 --> 00:21:13.560
And that one's kind of weird because, okay, wait a minute.

00:21:13.560 --> 00:21:18.360
If it's linear, that means we have roughly the same number of births and deaths every year.

00:21:18.560 --> 00:21:19.560
But how?

00:21:19.560 --> 00:21:23.840
You know, how do you get 7 billion people to coordinate and make that happen?

00:21:23.840 --> 00:21:26.800
So, there are a couple of ways to think about what's happening.

00:21:26.800 --> 00:21:31.440
One of them is the logistic growth model, which starts out exponential.

00:21:31.440 --> 00:21:35.780
And then, as you approach a carrying capacity, you approach this limit.

00:21:35.780 --> 00:21:39.500
It approaches that limit asymptotically at the high end.

00:21:39.500 --> 00:21:42.460
And in the middle, there's a piece that looks linear.

00:21:42.460 --> 00:21:45.820
So, you could look at that model and you could, okay, maybe that's what's going on.

00:21:45.820 --> 00:21:48.440
Except it turns out that's not quite right either.

00:21:48.440 --> 00:21:50.960
And that's where the domain knowledge comes in.

00:21:50.960 --> 00:21:55.080
Because so far, it's just been programming and looking at data.

00:21:55.080 --> 00:21:59.540
At some point, you have to talk to a demographer because they actually know what's going on.

00:21:59.540 --> 00:22:01.920
And what's going on turns out to be very interesting.

00:22:01.920 --> 00:22:04.000
It's the demographic transition.

00:22:04.000 --> 00:22:12.500
And this is a social and economic phenomenon, which is as societies, countries become more economically

00:22:12.500 --> 00:22:16.660
developed and have more personal freedom, fertility rates tend to go down.

00:22:16.660 --> 00:22:18.900
And they very often, it's often dramatic.

00:22:18.900 --> 00:22:26.720
It would be a shift from lifetime fertility of five, six, seven, or eight children down to very close to two.

00:22:26.720 --> 00:22:30.600
And 2.1 is the replacement level where population levels off.

00:22:30.600 --> 00:22:36.120
A lot of developed countries right now are at or below replacement in terms of birth rate.

00:22:36.380 --> 00:22:40.100
And so, the populations are leveling off or starting to decline.

00:22:40.100 --> 00:22:40.460
Yeah.

00:22:40.460 --> 00:22:42.960
There's going to be some knock-on economic effects.

00:22:42.960 --> 00:22:44.980
Although, I don't know that those were modeled in your book.

00:22:44.980 --> 00:22:55.680
But, you know, like, how does things like social security and support nets happen when the thing being supported is heavier or larger than the people doing the supporting, right?

00:22:55.680 --> 00:22:56.060
Right.

00:22:56.060 --> 00:22:59.320
Speaking of economies like Japan, for example, and so on.

00:22:59.560 --> 00:22:59.900
Yes.

00:22:59.900 --> 00:23:00.180
Yeah.

00:23:00.180 --> 00:23:02.440
They've been below replacement level for quite a while.

00:23:02.440 --> 00:23:07.440
So, in some sense, they are the predictor of what a lot of other countries are looking like now.

00:23:07.440 --> 00:23:10.840
And as you said, you know, vast economic consequences.

00:23:10.840 --> 00:23:12.680
Now, that's where I stopped.

00:23:12.680 --> 00:23:13.840
It's not an economics book.

00:23:14.700 --> 00:23:21.540
That's where it was, I think, fun for us to, you know, get to that point and say, look, okay, we have found some interesting things.

00:23:21.540 --> 00:23:26.500
And now, you know, go explore because there's a lot more to learn about this.

00:23:26.500 --> 00:23:26.760
Yeah.

00:23:26.760 --> 00:23:32.700
I doubt it would surprise the listeners that the standard data science pieces are at play here.

00:23:32.700 --> 00:23:37.020
Jupyter Notebooks, Pandas, Matplotlib, those kinds of things, right?

00:23:37.020 --> 00:23:38.320
Yeah, there it is.

00:23:38.320 --> 00:23:40.540
From Pandas, read HTML.

00:23:40.540 --> 00:23:41.280
Yes.

00:23:41.280 --> 00:23:43.280
Whenever we can, we try to get real data.

00:23:43.280 --> 00:23:47.040
One of the goals of this class is to connect students to the real world.

00:23:47.040 --> 00:23:54.160
And that's one of the places where data science is a real opportunity because the availability of data is great.

00:23:54.160 --> 00:23:58.100
And the computational tools for working with data are very good.

00:23:58.100 --> 00:24:03.120
Now, obviously, in Python, you know, Pandas is one of the popular libraries for data.

00:24:03.120 --> 00:24:06.780
There are others, you know, more generally, you know, there's R, you know, Matlab.

00:24:06.780 --> 00:24:09.780
This is a real, I think, teaching opportunity.

00:24:09.780 --> 00:24:13.220
One of the things I thought was interesting from a lot of these was the...

00:24:13.220 --> 00:24:16.640
The acquisition of the starter data for a lot of these.

00:24:16.640 --> 00:24:19.940
So, for example, in this one, you have...

00:24:19.940 --> 00:24:22.540
You're getting the world population estimates from a table.

00:24:22.540 --> 00:24:28.560
And I think this table originally comes from Wikipedia, but you've saved it locally because you're smart.

00:24:28.560 --> 00:24:31.940
And in case they change the format of that page, you don't have to rewrite your book.

00:24:32.140 --> 00:24:39.880
But, you know, it really highlights certain things that are just so easy if you know the way, but are not necessarily obvious.

00:24:39.880 --> 00:24:43.860
So, for example, here you have from Pandas, read, import, read, HTML.

00:24:43.860 --> 00:24:46.360
You can just go read HTML and you give it a...

00:24:46.360 --> 00:24:50.480
Either a URL or just a HTML file in this case.

00:24:50.480 --> 00:24:54.560
And then you can say, well, we just want the second table that was in that HTML.

00:24:54.560 --> 00:24:57.060
And it literally grabs out of Wikipedia.

00:24:57.060 --> 00:25:02.160
It grabs the table and turns it into a Pandas data frame, which is pretty remarkable, honestly.

00:25:02.160 --> 00:25:02.700
Yeah.

00:25:02.700 --> 00:25:05.960
Well, you know, I have mixed feelings about this because it is...

00:25:05.960 --> 00:25:06.100
Okay.

00:25:06.500 --> 00:25:10.320
It's great that we can get the data and it's easy with these tools.

00:25:10.320 --> 00:25:15.040
It's a little bit sketchy in the sense that, you know, as you said, we have to...

00:25:15.040 --> 00:25:16.900
What if Wikipedia changes the format?

00:25:16.900 --> 00:25:22.040
This is not exactly data that anybody intended to export.

00:25:22.040 --> 00:25:30.040
So, I think I would prefer to get this data from the original source in a format that was really intended.

00:25:30.040 --> 00:25:33.920
An HTML table is not exactly a data transport format.

00:25:33.920 --> 00:25:35.120
No, an Elm table.

00:25:35.120 --> 00:25:35.840
No, just kidding.

00:25:35.840 --> 00:25:38.040
I mean, it's fragile in a lot of ways.

00:25:38.040 --> 00:25:42.100
Somebody could insert a column, delete a column, more likely the insert one, right?

00:25:42.100 --> 00:25:43.680
To add, oh, we found a new data source.

00:25:43.680 --> 00:25:44.340
We added it.

00:25:44.340 --> 00:25:45.700
And all of a sudden, all of your stuff breaks.

00:25:45.700 --> 00:25:50.040
But it could even be as simple as we added more information to the Wikipedia page.

00:25:50.040 --> 00:25:52.880
And now there's a table that precedes this table in HTML.

00:25:52.880 --> 00:25:56.600
So, when you say, get me the second table, you actually get some unrelated thing, right?

00:25:56.600 --> 00:26:03.280
So, obviously, I mean, it's effectively web scraping behind the scenes, which is always fraught with instability.

00:26:03.280 --> 00:26:08.760
But you're taking advantage of what Wikipedia did, which is to collate all of these sources.

00:26:09.260 --> 00:26:13.360
People have gathered this and curated this collection of data.

00:26:13.360 --> 00:26:19.120
So, that's why I say mixed feelings, because it is a great opportunity to take advantage of that.

00:26:19.120 --> 00:26:21.720
But web scraping might not be the best way to do it.

00:26:21.720 --> 00:26:21.880
Yeah.

00:26:22.080 --> 00:26:23.920
Quick question from Marwan.

00:26:23.920 --> 00:26:31.240
Does the book include attempts to visualize the simulations, like modeling a bouncing ball becomes more rewarding if you can see it in action?

00:26:31.240 --> 00:26:31.720
Definitely.

00:26:31.720 --> 00:26:36.100
And that comes up in the third part of the book, which is about mechanical systems.

00:26:36.100 --> 00:26:39.620
And those are the things where, yeah, we've got objects moving in space.

00:26:39.860 --> 00:26:42.400
And that begs to be an animation.

00:26:42.400 --> 00:26:45.820
There's not a ton of it because it's a little bit.

00:26:45.820 --> 00:26:52.140
The tools for animation in Jupyter Notebooks using Matplotlib are a little bit clumsy.

00:26:52.140 --> 00:26:54.300
So, I didn't get deep into it.

00:26:54.300 --> 00:27:03.120
But definitely the point where you get to see the simulation and you see the objects moving in space, you, I think, appreciate it, for one thing.

00:27:03.420 --> 00:27:10.760
You also, I think, get to debug it because your eye is really good at seeing physical errors.

00:27:10.760 --> 00:27:15.800
If your physical model is doing something incorrect, you're going to see it instantly.

00:27:15.800 --> 00:27:16.760
It's going to bother you.

00:27:16.760 --> 00:27:16.960
Yeah.

00:27:16.960 --> 00:27:18.140
That does look right.

00:27:18.140 --> 00:27:22.300
And, you know, it's probably not necessarily a problem with the animation, with the modeling.

00:27:22.300 --> 00:27:27.080
But even things like acceleration and deceleration, if a thing just goes over and stops, you're like, oh, it didn't.

00:27:27.080 --> 00:27:27.860
That's not right.

00:27:27.860 --> 00:27:28.520
It shouldn't do that.

00:27:28.520 --> 00:27:30.460
It should slow down and come to a stop.

00:27:30.460 --> 00:27:32.280
It didn't hit an imaginary wall.

00:27:32.280 --> 00:27:40.000
This portion of Talk Python To Me is brought to you by the PyBites Developer Mindset Program.

00:27:40.000 --> 00:27:45.240
It's run by my two friends and frequent guests, Bob Belderbos and Julian Sequira.

00:27:45.240 --> 00:27:49.120
And instead of me telling you about it, let's hear them describe their program.

00:27:49.120 --> 00:27:55.760
Are you trying to code your way to a more flexible and impactful career but aren't getting anywhere?

00:27:55.760 --> 00:28:02.360
If so, the PyBytes Developer Mindset Coaching Program, PDM, can help get you unblocked.

00:28:02.360 --> 00:28:03.300
Imagine this.

00:28:03.300 --> 00:28:10.900
Building and deploying your own applications, mastering Python, and getting personalized one-on-one coaching every step of the way.

00:28:10.900 --> 00:28:15.060
We know the struggle of tutorial paralysis all too well.

00:28:15.060 --> 00:28:19.700
And that's why PDM focuses on real-world applications.

00:28:20.480 --> 00:28:24.240
Our mission is to help you build confidence as an effective developer.

00:28:24.240 --> 00:28:27.000
And remember, this isn't a bootcamp.

00:28:27.000 --> 00:28:30.380
It's a highly personalized, invite-only program.

00:28:30.380 --> 00:28:36.960
You won't be just another face in the crowd in some classroom, but a valued part of our inclusive community.

00:28:36.960 --> 00:28:40.100
And are you ready to give back to the open source world?

00:28:40.760 --> 00:28:49.420
With PDM, you'll gain the skills and the confidence to contribute meaningful code to the projects that matter to you.

00:28:49.420 --> 00:28:51.300
And it's not just about the coding.

00:28:51.300 --> 00:29:00.160
It's about joining a community of like-minded developers, fueling your intellectual curiosity and making a difference with your skills.

00:29:00.160 --> 00:29:03.740
So, are you ready to take your Python skills to new heights?

00:29:03.740 --> 00:29:05.160
We hope you are.

00:29:05.160 --> 00:29:08.500
So, please, apply now for the PDM program.

00:29:09.100 --> 00:29:11.640
With PyBytes, you don't just learn to code.

00:29:11.640 --> 00:29:16.160
You code to learn, to grow, and to give back.

00:29:16.160 --> 00:29:17.280
See you on the inside.

00:29:17.280 --> 00:29:23.500
Apply for the Python developer mindset today at talkpython.fm/PDM.

00:29:23.500 --> 00:29:26.100
It's quick and free to apply.

00:29:26.100 --> 00:29:28.500
The link is in your podcast player show notes.

00:29:28.500 --> 00:29:30.840
Thanks to PyBytes for sponsoring the show.

00:29:30.840 --> 00:29:33.700
All right.

00:29:33.700 --> 00:29:36.760
Next one to talk about is epidemiology.

00:29:37.440 --> 00:29:41.560
And in this one, you can talk about the freshman plague.

00:29:41.560 --> 00:29:46.500
People maybe with regard to college have heard of the freshman 15, like a certain amount of weight.

00:29:46.500 --> 00:29:49.460
A lot of people seem to put on from the stress of going to college.

00:29:49.460 --> 00:29:58.800
But the freshman plague is more about coming together in a big group from all over the place more than maybe people are used to coming from their hometown.

00:29:58.800 --> 00:29:59.240
Yeah.

00:29:59.240 --> 00:30:01.180
Well, we started this example.

00:30:01.180 --> 00:30:02.420
Well, let's see.

00:30:02.420 --> 00:30:05.040
I think we were working on this in 2017.

00:30:05.140 --> 00:30:08.320
But we were using this example previously.

00:30:08.320 --> 00:30:10.500
So before COVID is the point.

00:30:10.500 --> 00:30:13.220
And I guess at the time, it was sort of a fun example.

00:30:13.220 --> 00:30:16.960
Like, hey, everybody gets a cold during the first few weeks of the semester.

00:30:16.960 --> 00:30:17.660
Ha ha.

00:30:17.660 --> 00:30:20.320
And it's, you know, it's less funny now.

00:30:20.320 --> 00:30:22.400
But it's also definitely more relevant.

00:30:22.400 --> 00:30:27.680
You know, we're thinking about, you know, modeling an epidemic and modeling interventions.

00:30:28.120 --> 00:30:31.680
And in particular, understanding a concept like herd immunity.

00:30:31.680 --> 00:30:39.780
So if you're talking about, you know, public health and what, you know, what's our civic obligation, it's not just looking after yourself.

00:30:39.780 --> 00:30:44.480
There is a public consequence to your individual decisions.

00:30:44.480 --> 00:30:45.460
Yeah, absolutely.

00:30:45.460 --> 00:30:46.060
There sure is.

00:30:46.060 --> 00:30:50.440
And, yeah, this used to be somewhat of an interesting example.

00:30:50.440 --> 00:30:57.140
And then it became one of the biggest stories, you know, maybe of our lifetimes.

00:30:57.140 --> 00:30:57.460
Who knows?

00:30:58.040 --> 00:31:01.140
Anyway, so this is the Kermak-McKendrick model.

00:31:01.140 --> 00:31:05.620
And there's a couple of interesting things that I thought were interesting models here.

00:31:05.620 --> 00:31:11.260
So in this model, you have the susceptible folks who are not yet infected, but potentially could be.

00:31:11.260 --> 00:31:12.700
You have the recovered people.

00:31:12.700 --> 00:31:16.360
And you assume they have some kind of immunity, at least for their freshman year, I guess.

00:31:16.360 --> 00:31:17.960
And then the people who are infected.

00:31:17.960 --> 00:31:21.680
And you talk about this idea of having, what's it called?

00:31:21.680 --> 00:31:22.600
Stalk.

00:31:22.600 --> 00:31:23.100
Yeah.

00:31:23.100 --> 00:31:26.020
Stalk and flow diagrams.

00:31:26.260 --> 00:31:33.400
Those are pretty interesting because you think of the freshman class as kind of a fixed set, right?

00:31:33.400 --> 00:31:34.100
Mm-hmm.

00:31:34.100 --> 00:31:36.100
There are some different versions of the model.

00:31:36.100 --> 00:31:37.440
And right, Kermak-McKendrick.

00:31:37.440 --> 00:31:38.880
Nobody calls it that.

00:31:38.880 --> 00:31:42.180
Everybody just calls it an SIR model because those are your three.

00:31:42.280 --> 00:31:43.400
And you can extend it.

00:31:43.400 --> 00:31:45.740
There are additional groups.

00:31:45.740 --> 00:31:52.600
And what you're modeling is the flow of, in this case, it's people, from one stock to another.

00:31:52.600 --> 00:31:59.220
So someone who is susceptible, if they become infected, they move into the infectious stock.

00:31:59.600 --> 00:32:01.640
And when they recover, they move into the recovered.

00:32:01.640 --> 00:32:03.920
So this is the simplest model.

00:32:03.920 --> 00:32:06.360
And usually, it's a fixed population.

00:32:06.360 --> 00:32:14.680
The reason that this is where we start is that this lends itself to a differential equation that we can do some work with.

00:32:14.680 --> 00:32:19.000
We can't solve it analytically, but there are some useful analytic methods.

00:32:19.000 --> 00:32:21.740
And we can also work with it computationally.

00:32:21.740 --> 00:32:24.880
So this is one of several examples in the book where we do both.

00:32:24.880 --> 00:32:31.300
And that gives us a chance to show the strengths and weaknesses of analysis and computation,

00:32:31.300 --> 00:32:36.660
and also to do some validation by comparing the results from one and the other.

00:32:37.020 --> 00:32:39.920
So yeah, that's why this is where it is in the book.

00:32:39.920 --> 00:32:47.120
It's kind of the transition from the discrete systems in part one to the first order continuous systems.

00:32:47.120 --> 00:32:47.460
Yeah.

00:32:47.460 --> 00:32:48.060
Okay.

00:32:48.060 --> 00:32:51.980
One of the things that, I don't know, maybe I should have just known this or not,

00:32:51.980 --> 00:32:58.540
but what was interesting to me was thinking about applying differential equations to a discrete set, right?

00:32:58.540 --> 00:33:03.420
Like I think of differential equations of being either applied to like maybe an interval,

00:33:03.600 --> 00:33:12.280
all of the real numbers or the complex numbers or, but not to 90 things, you know, which that was surprising, I thought.

00:33:12.280 --> 00:33:15.820
And then your ability to model that in Python was pretty cool.

00:33:15.820 --> 00:33:16.140
Yeah.

00:33:16.140 --> 00:33:21.320
So I'm glad you mentioned that because it's a really useful modeling method.

00:33:21.320 --> 00:33:25.860
And it's a good example of the kind of modeling decisions that you're making all the time.

00:33:25.860 --> 00:33:27.520
And it can go in both directions.

00:33:27.520 --> 00:33:33.440
You can take something that you know is actually discrete, like people, and treat it as if it were continuous.

00:33:33.440 --> 00:33:36.360
And that works pretty well if you have a large population.

00:33:36.360 --> 00:33:39.840
Obviously, if you get down to very small numbers of people, it starts to break down.

00:33:39.840 --> 00:33:46.220
And that's where we can have a conversation about modeling and say, look, this is an approximation, right?

00:33:46.220 --> 00:33:48.080
This isn't how the world really is.

00:33:48.080 --> 00:33:56.260
But I can pretend, I can run the model, and those results can be useful even if the model isn't perfectly realistic.

00:33:56.800 --> 00:33:58.620
Because, you know, that's how models work.

00:33:58.620 --> 00:34:00.120
None of them are perfectly realistic.

00:34:00.120 --> 00:34:10.320
So that's, I think, one of the goals of the book is to engage the learner in those kinds of discussions about modeling decisions.

00:34:10.320 --> 00:34:14.540
Because I think that's missing in a lot of science classes.

00:34:14.540 --> 00:34:20.660
If you think about the traditional freshman physics class, you are told what the model is.

00:34:20.660 --> 00:34:23.460
You say, we're going to do a block on a frictionless plane.

00:34:23.460 --> 00:34:26.460
We're going to do a projectile moving in a vacuum.

00:34:26.460 --> 00:34:29.080
Well, the frictionless, that's a modeling decision.

00:34:29.080 --> 00:34:33.640
It says, we're going to temporarily ignore friction in order to solve this problem.

00:34:33.640 --> 00:34:36.300
But you as the learner didn't get to make that decision.

00:34:36.300 --> 00:34:42.840
You don't, you're not required to figure out the consequences of it or think about when it doesn't apply.

00:34:42.840 --> 00:34:44.880
And that's what we really wanted to get at here.

00:34:44.880 --> 00:34:47.120
Yeah, that's a really interesting point.

00:34:47.120 --> 00:34:55.600
And that's why a lot of people think math is just a bunch of formulas or, you know, science, hard sciences are often just a bunch of formulas.

00:34:55.600 --> 00:34:57.560
Then you just got to remember to use the formula.

00:34:57.560 --> 00:35:10.340
Because it just goes from this sterilized version, final version, without understanding, going from observation to making your way through it until you end up with something like this, right?

00:35:10.480 --> 00:35:11.100
Yeah, yeah.

00:35:11.100 --> 00:35:11.200
Yeah.

00:35:11.200 --> 00:35:15.780
Now, there's a scary version of this, which is that it's not objective.

00:35:15.780 --> 00:35:26.280
Because if there's one answer and your job is to figure out, you know, what's the right formula, apply the formula, get the answer at the back of the book, that's nice and objective.

00:35:26.440 --> 00:35:29.000
And, you know, we want our science to be objective.

00:35:29.000 --> 00:35:32.340
But regardless of what we want, it isn't.

00:35:32.340 --> 00:35:34.280
Because it's based on modeling decisions.

00:35:34.280 --> 00:35:37.480
All science is based on modeling decisions.

00:35:37.480 --> 00:35:40.960
And those are subjective decisions.

00:35:40.960 --> 00:35:45.860
It's deciding whether a particular model is suitable for purpose.

00:35:45.860 --> 00:35:47.740
It depends on what you're trying to do.

00:35:48.000 --> 00:35:53.860
If you want to make a general qualitative description of a system, maybe you can use a simple model.

00:35:53.860 --> 00:35:55.540
Maybe you can leave friction out of it.

00:35:55.540 --> 00:36:03.160
If you want to land an orbiter on Mars or a rover on Mars, you might need a more detailed model.

00:36:04.280 --> 00:36:10.060
Yeah, if you're off by 1% of 1 degree, it's going to matter by the time you get there.

00:36:10.060 --> 00:36:10.320
Yeah.

00:36:10.320 --> 00:36:11.980
Where's that playing in again?

00:36:11.980 --> 00:36:12.360
Yeah.

00:36:12.360 --> 00:36:12.460
Yeah.

00:36:12.460 --> 00:36:19.700
So in this one, you talked to using this, a couple of types and ideas in here with states and systems.

00:36:19.700 --> 00:36:28.740
And it sounds like in the book, it looks like in the book, you provided some foundational building blocks for modeling the mod sim module, right?

00:36:28.740 --> 00:36:38.200
So in addition to just having the books, you've got a bunch of Jupyter Notebooks that people can check out and as well as some code to kind of help this modeling here.

00:36:38.200 --> 00:36:39.280
You want to talk a bit about that?

00:36:39.280 --> 00:36:39.740
Sure.

00:36:39.740 --> 00:36:48.040
So this was my attempt to use some programming ideas to communicate modeling ideas by creating these objects.

00:36:48.040 --> 00:36:52.800
So one of them is a state object and it represents the state of a system.

00:36:52.800 --> 00:36:57.600
So if you think about an object moving through space, it has position and velocity.

00:36:58.140 --> 00:37:04.180
And at any point in time, if I write down the position and velocity, that's the state of that object.

00:37:04.180 --> 00:37:08.080
So in object-oriented programming, that begs to be an object.

00:37:08.080 --> 00:37:12.420
It is a state object that contains position and velocity.

00:37:12.420 --> 00:37:19.760
Now, under the hood, it is a pandas series that is mapping from names to values.

00:37:19.760 --> 00:37:22.760
Similarly with a system object, that's actually a Python namespace.

00:37:22.760 --> 00:37:26.420
So there are a couple of different things, but this one's a namespace.

00:37:26.980 --> 00:37:32.400
And it represents everything that you need to know about a system in order to model it.

00:37:32.400 --> 00:37:34.500
So it'll be the parameters of the system.

00:37:34.500 --> 00:37:45.400
If it's, let's take that projectile moving in space again, it might be mass, cross-sectional area, coefficient of drag, density of air, temperature of air, all the things to model.

00:37:45.400 --> 00:37:47.940
One of the examples is like a baseball in flight.

00:37:47.940 --> 00:37:48.380
Excellent.

00:37:48.380 --> 00:37:59.280
So in this one, you go through, you model, you run the simulation over time and eventually end up with a graph that shows, you know, a little over half of the students got lucky and didn't get the plague.

00:37:59.280 --> 00:38:03.120
But about half of them did at some point throughout the year or the semester or whatever it was.

00:38:03.920 --> 00:38:10.160
So that's, you can do a single run in order to simulate a hypothetical course of the disease.

00:38:10.160 --> 00:38:15.600
And now you can start to vary the parameters and say, you know, what if the disease is more infectious?

00:38:15.600 --> 00:38:18.300
What if the recovery time is longer or shorter?

00:38:18.760 --> 00:38:20.940
What if people start washing their hands?

00:38:20.940 --> 00:38:23.140
And what if we start vaccinating them?

00:38:23.140 --> 00:38:30.560
And so by varying the parameters now, you can see how the output of the model depends on the system parameters.

00:38:30.560 --> 00:38:33.620
And that's where another one of these objects comes in.

00:38:33.620 --> 00:38:35.620
We have a thing that's called a sweep series.

00:38:35.620 --> 00:38:42.820
It's a mapping from a hypothetical parameter to the output of the model using that parameter.

00:38:42.820 --> 00:38:48.120
Yeah, when you hear people talking about COVID, I remember them talking about the infection rate.

00:38:48.120 --> 00:38:49.780
You know, is it bigger than one?

00:38:49.780 --> 00:38:50.640
Is it less than one?

00:38:50.640 --> 00:38:54.240
And all of those things were very relevant here, right?

00:38:54.240 --> 00:38:54.560
Right.

00:38:54.560 --> 00:38:55.040
Yes.

00:38:55.040 --> 00:38:59.320
The R0 and R, the contact rate.

00:38:59.320 --> 00:39:03.240
And that term comes straight out of this model.

00:39:03.240 --> 00:39:06.120
That is the ratio of the two parameters here.

00:39:06.120 --> 00:39:12.920
So beta is the rate of infection, depending on how many people are susceptible and how many are infected.

00:39:12.920 --> 00:39:20.480
And gamma is the rate of recovery, which is the fraction of infected people who recover in a unit of time.

00:39:20.480 --> 00:39:24.960
And the ratio of those two things is the contact rate, the R0.

00:39:24.960 --> 00:39:25.320
Yep.

00:39:25.320 --> 00:39:26.160
All right.

00:39:26.160 --> 00:39:28.960
Well, way more relevant these days than it was a few years ago.

00:39:28.960 --> 00:39:30.100
Oh, yeah.

00:39:30.100 --> 00:39:33.380
We all know a lot more about epidemiology than we used to.

00:39:33.380 --> 00:39:35.540
We sure do.

00:39:35.540 --> 00:39:43.700
So my daughter was just enjoying going back and watching some of her favorite YouTubers videos from February and March of 2020.

00:39:43.700 --> 00:39:44.640
Just laughing.

00:39:44.640 --> 00:39:47.220
They were saying, oh, it looks like we're going to have to stay home for a week.

00:39:47.220 --> 00:39:48.660
And she's just like, they have no idea.

00:39:48.660 --> 00:39:49.520
They have no idea.

00:39:49.520 --> 00:39:49.940
Okay.

00:39:49.940 --> 00:39:51.100
All right.

00:39:51.100 --> 00:39:52.380
Let's go on to something more fun.

00:39:52.380 --> 00:39:54.800
One of my favorite things, coffee.

00:39:54.800 --> 00:39:55.340
Come on.

00:39:55.340 --> 00:39:56.600
Yeah.

00:39:56.600 --> 00:39:56.980
Awesome.

00:39:56.980 --> 00:40:00.340
And so tell us about the coffee cooling problem that you solve here.

00:40:00.340 --> 00:40:01.480
This one's a classic.

00:40:02.040 --> 00:40:07.480
The source that I'm aware of is a Martin Gardner column in Scientific American.

00:40:07.480 --> 00:40:17.100
And it posed this question, which is, if I get my coffee and I also have some milk and I'm planning to add the milk to the coffee, should I add it now?

00:40:17.100 --> 00:40:18.780
And so that they cool down together.

00:40:18.780 --> 00:40:21.120
Or should I drive to my destination?

00:40:21.120 --> 00:40:22.260
Let's suppose you're commuting.

00:40:22.260 --> 00:40:25.300
Should I get to my destination and then mix them?

00:40:25.300 --> 00:40:31.680
With the goal of getting the coffee down to a pleasantly drinkable temperature as quickly as possible.

00:40:31.680 --> 00:40:32.060
Okay.

00:40:32.060 --> 00:40:32.580
Yeah.

00:40:32.580 --> 00:40:33.180
You pick it up.

00:40:33.180 --> 00:40:37.960
Maybe you hit one of those drive-through coffee shack things that just stands on its own.

00:40:37.960 --> 00:40:39.340
And you're like, oh, it's always too hot here.

00:40:39.440 --> 00:40:45.200
How should I do this so that I can basically have a perfect coffee when I arrive where I'm going, right?

00:40:45.200 --> 00:40:45.740
Okay.

00:40:45.740 --> 00:40:46.380
Excellent.

00:40:46.380 --> 00:40:50.840
So this one involves Newton's law of cooling, right?

00:40:50.840 --> 00:40:51.940
Did I get that right?

00:40:51.940 --> 00:40:52.460
You got it.

00:40:52.460 --> 00:40:53.420
And the heat transfer.

00:40:53.420 --> 00:40:53.980
There we go.

00:40:53.980 --> 00:40:54.840
Newton's law of cooling.

00:40:54.840 --> 00:40:56.960
Another differential equation here.

00:40:56.960 --> 00:40:59.880
As they want to be in simulation.

00:40:59.880 --> 00:41:00.580
Yes.

00:41:00.580 --> 00:41:00.940
Right.

00:41:00.940 --> 00:41:04.080
So this is another one, which is a first order differential equation.

00:41:04.080 --> 00:41:09.080
You can do it two ways, which is you can break it up into discrete steps in time.

00:41:09.080 --> 00:41:12.820
And so your differential equation becomes a difference equation.

00:41:12.820 --> 00:41:18.420
And that's a natural thing for a programming language because now it's a loop.

00:41:18.420 --> 00:41:23.600
And during each time step, you figure out the difference between the coffee and the environment.

00:41:23.600 --> 00:41:25.520
That tells you the rate of change.

00:41:25.520 --> 00:41:29.020
And then that lets you make a prediction for the next time step.

00:41:29.020 --> 00:41:35.180
And so if you repeat that process, that is Euler's method for solving differential equations.

00:41:35.180 --> 00:41:37.940
So there's kind of a natural transition there.

00:41:37.940 --> 00:41:42.700
And then I think for this problem, we don't yet use the ODE solver.

00:41:42.700 --> 00:41:44.480
But then later in the book, we do.

00:41:44.480 --> 00:41:48.500
And that's trying to motivate, you know, why are we using this library?

00:41:48.500 --> 00:41:51.000
Well, you know, there are limits to Euler's method.

00:41:51.000 --> 00:41:53.420
At some point, it's not very accurate.

00:41:53.420 --> 00:41:55.720
Yeah, it might not be accurate enough for sure.

00:41:55.720 --> 00:41:59.440
And ODE, ordinary differential equations for people out there listening.

00:41:59.440 --> 00:42:00.140
You got it right.

00:42:00.140 --> 00:42:00.580
Thank you.

00:42:00.580 --> 00:42:02.700
Ordinary differential equation.

00:42:02.700 --> 00:42:05.960
And so, you know, Python has, you know, SciPy.

00:42:05.960 --> 00:42:10.680
SciPy has several functions that will solve differential equations for you.

00:42:10.680 --> 00:42:12.460
And so we're kind of, we're sneaking up on that.

00:42:12.460 --> 00:42:12.660
Yeah.

00:42:12.660 --> 00:42:13.080
Okay.

00:42:13.080 --> 00:42:15.080
It is interesting that you can say, yeah, sure.

00:42:15.080 --> 00:42:16.000
It's a differential equation.

00:42:16.140 --> 00:42:20.280
And those might sound scary and hard to solve and all those kinds of things.

00:42:20.280 --> 00:42:22.600
But you can subtract two numbers.

00:42:22.600 --> 00:42:24.120
You can do a simple thing.

00:42:24.120 --> 00:42:25.380
And looping is good.

00:42:25.380 --> 00:42:29.520
And so if you just make your loop have small enough increments, you're kind of doing the

00:42:29.520 --> 00:42:33.020
same thing that, you know, taking the limit to get to calculus does anyway, right?

00:42:33.180 --> 00:42:33.540
Yeah.

00:42:33.540 --> 00:42:38.820
We're kind of, we're short circuiting what I think is a really unnecessary loop, which

00:42:38.820 --> 00:42:44.100
is there's a lot of physical modeling where you take a system, you write a differential

00:42:44.100 --> 00:42:49.500
equation, but then you can't actually do anything with that differential equation.

00:42:49.500 --> 00:42:50.540
You can't solve it.

00:42:50.540 --> 00:42:53.320
And so you're going to have to use numerical methods anyway.

00:42:53.700 --> 00:42:58.500
And if you look at what the numerical method is doing, it's basically Euler's method.

00:42:58.500 --> 00:43:02.520
It's, you know, they're more complicated versions, but it's the same idea.

00:43:02.520 --> 00:43:03.980
We're going to take time.

00:43:03.980 --> 00:43:05.960
We're going to break it up into discrete steps.

00:43:05.960 --> 00:43:09.060
And we're basically simulating the system.

00:43:09.060 --> 00:43:14.460
So what we do in the book is cut out the middle and go straight to simulation.

00:43:14.460 --> 00:43:19.280
There's almost no reason to write a differential equation if you can't solve it.

00:43:19.280 --> 00:43:21.560
You might as well just start with a simulation.

00:43:21.560 --> 00:43:23.520
So what's the story with the coffee?

00:43:23.520 --> 00:43:24.840
How should I approach this?

00:43:24.840 --> 00:43:25.980
I'm not going to give it away.

00:43:25.980 --> 00:43:28.640
People got to earn it.

00:43:28.640 --> 00:43:30.020
They got to come figure it out, huh?

00:43:30.020 --> 00:43:31.340
You do have at the end.

00:43:31.340 --> 00:43:36.280
So one of the big challenges here is not like, how soon in my trip should I get the coffee?

00:43:36.280 --> 00:43:38.920
How long should I let it sit or any those kinds of things?

00:43:38.920 --> 00:43:43.740
It's one of the important parts is you have milk or cream you want to put into the coffee.

00:43:43.740 --> 00:43:49.040
You should decide if you put it into the hot coffee, the cold cream right away, that starts

00:43:49.040 --> 00:43:53.260
at somewhere other than if you maybe wait till you get to the office and then mix the cream.

00:43:53.260 --> 00:43:56.940
So people can come back and solve that about the milk.

00:43:56.940 --> 00:43:57.260
Right.

00:43:57.260 --> 00:43:58.440
Here's a question.

00:43:58.440 --> 00:43:59.120
This came up.

00:43:59.120 --> 00:44:03.020
One of the people I chat with on Twitter posed this question.

00:44:03.020 --> 00:44:04.160
It's a variation of this.

00:44:04.160 --> 00:44:08.540
He said he was disagreeing with his wife about using an electric kettle.

00:44:08.720 --> 00:44:13.600
The question is, let's say that you heat up a kettle full of water.

00:44:13.600 --> 00:44:15.580
You use half of it.

00:44:15.580 --> 00:44:17.020
And now the other half is there.

00:44:17.020 --> 00:44:23.280
You have a stay warm feature where you can set the kettle so that it keeps the water at,

00:44:23.280 --> 00:44:25.720
let's say, tea making temperature for you.

00:44:25.720 --> 00:44:28.640
Or you can shut it off, let it cool down.

00:44:28.640 --> 00:44:31.620
And then later on, when you want to make tea, heat it up again.

00:44:31.900 --> 00:44:36.280
Now, let's leave out of it for now that the time that it would take to heat up again.

00:44:36.280 --> 00:44:37.760
Let's say you don't care about that.

00:44:37.760 --> 00:44:39.520
You just want to know about energy consumption.

00:44:39.520 --> 00:44:45.060
Is it better to keep the water hot or let it cool down and then you have to use all that

00:44:45.060 --> 00:44:46.340
energy to heat it up again?

00:44:46.340 --> 00:44:48.140
Do you want to get in on this?

00:44:48.140 --> 00:44:48.500
Yeah.

00:44:48.500 --> 00:44:54.140
My guess is it's better to let it cool down because the wider temperature gradient you

00:44:54.140 --> 00:45:00.200
keep between the ambient air and the water, the higher rate of loss of temperature, which

00:45:00.200 --> 00:45:05.100
you actually had a really interesting piece, tidbit of information here.

00:45:05.100 --> 00:45:10.360
You said, okay, if the coffee cools from, you know, cooking temperature down to drinking temperature,

00:45:10.360 --> 00:45:11.860
that's a ton of energy.

00:45:11.860 --> 00:45:16.760
It says to give you a sense, if you're able to harness all of that heat to do work, which

00:45:16.760 --> 00:45:18.860
you can't because of inefficiencies of engines.

00:45:18.860 --> 00:45:24.200
But if somehow you had a magic levitating engine that converted a heat energy to potential

00:45:24.200 --> 00:45:31.000
energy, you could use this lost energy to lift the cup of coffee from sea level to 8,500

00:45:31.000 --> 00:45:33.420
meters just under the height of Mount Everest.

00:45:33.420 --> 00:45:36.080
That's an insane amount of energy when you think about it.

00:45:36.080 --> 00:45:36.760
That is.

00:45:36.760 --> 00:45:41.240
And honestly, I did this calculation 10 times and I'm still not sure.

00:45:41.240 --> 00:45:42.660
It's got to be wrong.

00:45:42.660 --> 00:45:43.940
No, it's awesome.

00:45:43.940 --> 00:45:44.800
I love it.

00:45:44.800 --> 00:45:47.060
I believe that this is true.

00:45:47.060 --> 00:45:51.660
But if someone contradicts me, I would be grateful because I just want to know.

00:45:51.660 --> 00:45:56.900
But at least according to the calculation I did, the difference between mechanical energy

00:45:56.900 --> 00:46:00.300
and heat energy is just, it defies your intuition.

00:46:00.300 --> 00:46:06.880
And it's really, it's thermodynamics that is the difference because to take something from

00:46:06.880 --> 00:46:13.640
sea level up to the top of Mount Everest is organized energy and heat is disorganized energy.

00:46:13.640 --> 00:46:17.200
And what that means is, you know, you can have, you can have quite a lot of heat and

00:46:17.200 --> 00:46:20.420
not be able to do much work with it because it's disorganized.

00:46:20.420 --> 00:46:20.740
Yeah.

00:46:20.740 --> 00:46:21.120
Okay.

00:46:21.120 --> 00:46:21.720
Excellent.

00:46:21.720 --> 00:46:25.640
Before we move on this one, I remember you were, I can't remember where I said, I think

00:46:25.640 --> 00:46:29.560
it might've also been Scientific American, but there was a debate about coffee of whether

00:46:29.560 --> 00:46:35.300
blowing on it, if it was the cool air hitting the water that would cool it, if it was just

00:46:35.300 --> 00:46:36.240
the evaporation.

00:46:36.240 --> 00:46:41.460
And someone did an experiment where they, they put a fan on it with cool background air

00:46:41.460 --> 00:46:45.000
and they put a hairdryer with hot air blowing on it.

00:46:45.000 --> 00:46:46.880
And it's still, it's the evaporation.

00:46:46.880 --> 00:46:50.200
It's like these state changes and the, this energy of this heat loss.

00:46:50.200 --> 00:46:51.320
It's, it's pretty powerful.

00:46:51.320 --> 00:46:51.680
Yeah.

00:46:51.680 --> 00:46:56.220
The latent heat of vaporization is, is a huge number, which is good because that's what

00:46:56.220 --> 00:46:56.880
keeps us cool.

00:46:56.880 --> 00:46:58.100
That's why sweat works.

00:46:58.100 --> 00:46:58.640
That's right.

00:46:58.640 --> 00:46:58.980
That's right.

00:46:58.980 --> 00:46:59.340
It's good.

00:46:59.340 --> 00:47:00.460
We're coming up on summer.

00:47:00.460 --> 00:47:01.540
So we're going to appreciate that.

00:47:01.540 --> 00:47:01.900
I'm sure.

00:47:01.900 --> 00:47:02.460
All right.

00:47:02.520 --> 00:47:05.540
Onto the next one limits to growth.

00:47:05.540 --> 00:47:06.660
Tell me about this one.

00:47:06.660 --> 00:47:06.980
Yeah.

00:47:06.980 --> 00:47:11.520
So this is related to the population growth that we were talking about earlier.

00:47:11.520 --> 00:47:17.920
And this is developing the logistic growth model, but then trying to figure out, is that

00:47:17.920 --> 00:47:19.280
really what's going on?

00:47:19.280 --> 00:47:24.960
Is, is human population leveling off because we are hitting resource limits?

00:47:24.960 --> 00:47:28.420
Like, are we running out of food or, or other resources?

00:47:28.420 --> 00:47:30.380
The answer for now is no.

00:47:30.720 --> 00:47:35.180
I mean, we can certainly look at places in the world where resources are scarce, but

00:47:35.180 --> 00:47:36.740
that's not what's limiting growth.

00:47:36.740 --> 00:47:38.820
Interestingly, it's almost the opposite.

00:47:38.820 --> 00:47:44.200
It is the places that are most economically developed, where resources are most available,

00:47:44.200 --> 00:47:47.440
where fertility rates are the fastest.

00:47:47.440 --> 00:47:47.960
Okay.

00:47:47.960 --> 00:47:49.940
And, and it's not being driven by death rate.

00:47:49.940 --> 00:47:50.820
That's the other thing.

00:47:50.820 --> 00:47:56.960
I think the other reason that we know that what we're seeing is not a resource limit because

00:47:56.960 --> 00:47:58.740
that would drive up the death rate.

00:47:58.740 --> 00:47:58.980
Yeah.

00:47:59.040 --> 00:48:00.000
And that's not the case.

00:48:00.000 --> 00:48:03.680
The death rate is dropping at all ages in all places.

00:48:03.680 --> 00:48:05.660
Well, with a few exceptions.

00:48:05.660 --> 00:48:06.660
Yeah.

00:48:06.660 --> 00:48:06.940
Yeah.

00:48:06.940 --> 00:48:07.220
Of course.

00:48:07.220 --> 00:48:09.580
So this one's kind of about finding that equilibrium.

00:48:09.580 --> 00:48:10.160
Yeah.

00:48:10.160 --> 00:48:17.100
This is taking the model to its limit and saying, okay, if we use the logistic model, even though

00:48:17.100 --> 00:48:19.740
we think physically, this isn't exactly what's happening.

00:48:19.740 --> 00:48:25.080
Can we make a prediction about where we think world population will level off and possibly

00:48:25.080 --> 00:48:26.540
even start to fall?

00:48:26.540 --> 00:48:32.380
And one thing that surprised me is that even though this model is very simple and not realistic,

00:48:32.380 --> 00:48:38.820
the predictions that come out of it are not wildly different from what we're getting from

00:48:38.820 --> 00:48:39.660
real demographers.

00:48:39.660 --> 00:48:47.680
So the UN and the US census both have projections for world population out to about 2100.

00:48:47.680 --> 00:48:56.720
And they predict world population will probably level off around 2100 at somewhere between 9 and 11 billion people.

00:48:56.720 --> 00:49:00.340
And this very simple model is not too far off from that.

00:49:00.340 --> 00:49:00.600
Yeah.

00:49:00.600 --> 00:49:01.160
Okay.

00:49:01.160 --> 00:49:02.320
That's a pretty wide range.

00:49:02.320 --> 00:49:04.980
You know, a lot of things can happen.

00:49:04.980 --> 00:49:05.520
Yeah, sure.

00:49:05.520 --> 00:49:10.180
A lot of assumptions and current equilibrium might change, right?

00:49:10.240 --> 00:49:11.820
Like, for example, climate change.

00:49:11.820 --> 00:49:12.760
Who knows what that does?

00:49:12.760 --> 00:49:12.980
Yep.

00:49:12.980 --> 00:49:13.680
That's big.

00:49:13.680 --> 00:49:19.520
But right now, the biggest drivers are the indices of world development.

00:49:19.520 --> 00:49:25.660
If you look at things like health and especially child mortality, when child mortality is low,

00:49:25.660 --> 00:49:27.620
fertility goes down.

00:49:27.620 --> 00:49:29.240
And it's counterintuitive.

00:49:29.240 --> 00:49:34.420
But to some extent, people are having, let's say, enough children.

00:49:34.420 --> 00:49:39.820
If your children have a very high chance of survival, enough is a smaller number.

00:49:40.180 --> 00:49:41.400
It's a funny way I'm looking at it.

00:49:41.400 --> 00:49:47.600
But that's, so health, economic opportunity, human rights is one of the other big driving

00:49:47.600 --> 00:49:48.140
forces.

00:49:48.140 --> 00:49:48.520
Right.

00:49:48.520 --> 00:49:48.980
Autonomy.

00:49:48.980 --> 00:49:49.400
Yeah.

00:49:49.400 --> 00:49:52.840
Freedom to make reproductive decisions and education.

00:49:52.840 --> 00:49:54.100
That's the other big one.

00:49:54.100 --> 00:49:54.260
Yep.

00:49:54.260 --> 00:49:55.000
Yep.

00:49:55.000 --> 00:49:55.580
Okay.

00:49:55.580 --> 00:49:59.460
Another one from the health area, glucose and insulin.

00:49:59.460 --> 00:50:00.040
Yeah.

00:50:00.040 --> 00:50:01.800
What's the problem we're solving here?

00:50:01.800 --> 00:50:08.180
So this is a model of the system in our bodies and actually, I think all mammals to regulate

00:50:08.180 --> 00:50:08.760
blood sugar.

00:50:09.160 --> 00:50:14.760
And it's the interaction of glucose or blood sugar and the hormones that cause blood sugar

00:50:14.760 --> 00:50:15.460
to go up and down.

00:50:15.460 --> 00:50:17.280
The primary one being insulin.

00:50:17.280 --> 00:50:20.640
And there's a model that's called the minimal model.

00:50:20.640 --> 00:50:26.660
And it was proposed by researchers who were trying to describe, you know, what's the minimum

00:50:26.660 --> 00:50:32.020
set of interactions that we need in order to have a model that fits the data pretty well.

00:50:32.020 --> 00:50:38.800
This is an example that I liked partly because the discussion of modeling was so explicit that

00:50:38.800 --> 00:50:45.580
there are some quotes from these papers where they are more open about their thinking than

00:50:45.580 --> 00:50:45.980
usual.

00:50:46.400 --> 00:50:48.500
It seems like people kind of hide the models.

00:50:48.500 --> 00:50:54.760
And these guys were really thinking about what do we need to include and what can we leave

00:50:54.760 --> 00:50:55.060
out?

00:50:55.060 --> 00:50:58.320
And how do we evaluate whether the model is good enough?

00:50:58.880 --> 00:51:05.900
And the way they did good enough is they actually had data from studies of blood sugar and diabetes

00:51:05.900 --> 00:51:09.120
where people have a challenge test.

00:51:09.120 --> 00:51:21.720
They are actually injected with glucose solution and then they monitor their insulin levels and blood sugar levels over three hours with measurements every two minutes.

00:51:22.140 --> 00:51:29.640
And so you can see blood sugar goes up and then insulin goes up and then glucose comes down and then insulin comes down.

00:51:29.640 --> 00:51:36.080
And then you eventually get back, if everything works, to your steady state base levels where you started.

00:51:36.080 --> 00:51:36.440
I see.

00:51:36.440 --> 00:51:40.940
So if you don't have diabetes, your body should react that way.

00:51:40.940 --> 00:51:46.320
But maybe if you do, like it can't produce the insulin to counterbalance that or something like this, right?

00:51:46.360 --> 00:51:53.540
So I think I've heard of that as a test for seeing if you have either have diabetes or maybe are pre-diabetic, right?

00:51:53.540 --> 00:51:54.420
Yep, exactly.

00:51:54.420 --> 00:51:55.400
And there are two things.

00:51:55.400 --> 00:51:55.580
Okay.

00:51:55.580 --> 00:52:01.680
You might not be producing enough insulin or your cells might be insensitive to it.

00:52:01.680 --> 00:52:03.640
So there are kind of two ways that that can go wrong.

00:52:03.640 --> 00:52:03.880
Okay.

00:52:03.880 --> 00:52:07.860
So I think, I don't remember which one that you did this on here.

00:52:07.860 --> 00:52:15.400
There's all, all these come with great plots over time and, you know, running the simulation and seeing how it evolves over time.

00:52:15.500 --> 00:52:16.760
And those kinds of things.

00:52:16.760 --> 00:52:20.940
But at least one of these you used SimPy, right?

00:52:20.940 --> 00:52:21.380
Yes.

00:52:21.380 --> 00:52:23.180
SimPy is pretty interesting.

00:52:23.180 --> 00:52:23.640
Yeah.

00:52:23.640 --> 00:52:35.520
So this is symbolic computation and it allows you to solve systems equations, nonlinear equations, differential equations, at least for the ones that have an analytic solution.

00:52:35.520 --> 00:52:37.840
SimPy will often find it for you.

00:52:37.840 --> 00:52:42.200
And when I say find a solution, it's not a numerical approximation.

00:52:42.200 --> 00:52:45.260
It's a symbolic representation of the function.

00:52:45.360 --> 00:52:45.460
Right.

00:52:45.460 --> 00:52:47.940
That's why I thought it was so interesting as a thing.

00:52:47.940 --> 00:52:52.500
Because so everything we've been talking about so far are like these Euler type solutions.

00:52:52.500 --> 00:52:59.080
We're like, okay, well, if we just approximate, if the gap is small enough, it's like calculus, but it's a loop, you know?

00:52:59.400 --> 00:53:06.540
Whereas this says, actually, the integral of this differential equation is this other formula, right?

00:53:06.540 --> 00:53:08.960
Like you would learn in, you know, calculus or something.

00:53:08.960 --> 00:53:09.260
Yeah.

00:53:09.400 --> 00:53:15.780
And so what you get is this object that represents the function and you can render it as LaTeX.

00:53:15.780 --> 00:53:21.020
So you can kind of see it, you know, with the nice integral symbols and infinity symbols and all that.

00:53:21.020 --> 00:53:24.140
And you can also, from that, generate Python code.

00:53:24.140 --> 00:53:32.380
So you could have, you know, solve your differential equation and then evaluate the result as a numerical computation.

00:53:32.380 --> 00:53:32.680
Right.

00:53:32.680 --> 00:53:37.140
And the answer, instead of being 3.14, whatever, is just the letter pi.

00:53:37.140 --> 00:53:37.660
Right.

00:53:37.660 --> 00:53:37.960
Right.

00:53:37.960 --> 00:53:39.720
It's like, here, you gave me a formula.

00:53:39.720 --> 00:53:43.380
Here's the actual symbolic solution to it as a number, right?

00:53:43.380 --> 00:53:43.600
Yep.

00:53:43.600 --> 00:53:43.820
Yeah.

00:53:43.820 --> 00:53:44.300
Pretty cool.

00:53:44.300 --> 00:53:49.220
So you did, I believe you used that in some of your simulations or some of your models, right?

00:53:49.220 --> 00:53:51.480
There were a couple of examples where we did both.

00:53:51.480 --> 00:53:58.380
We would do the numerical solver and then the symbolic computation and then compare them.

00:53:58.380 --> 00:54:03.600
And then a couple of places where there's an analysis that you can do, like the SIR model,

00:54:04.020 --> 00:54:09.220
where the, you could do the analysis by hand and certainly in lots of science and math classes,

00:54:09.220 --> 00:54:10.200
that's what you would do.

00:54:10.200 --> 00:54:17.820
But I really wanted to show people how to do this symbolically because I think it separates two parts of the activity.

00:54:17.820 --> 00:54:22.780
There's the low level activity of actually, you know, writing all the symbols on paper

00:54:22.780 --> 00:54:28.080
and being very careful not to leave off the minus signs and the two, you know, factor of two and all that.

00:54:28.080 --> 00:54:31.260
And then there's the high level, keeping track, what am I doing?

00:54:31.260 --> 00:54:32.280
What's my goal?

00:54:32.280 --> 00:54:33.720
What are the steps I'm following?

00:54:33.720 --> 00:54:34.840
To get there.

00:54:34.840 --> 00:54:39.340
And I think symbolic computation has a lot of potential to separate those two,

00:54:39.340 --> 00:54:44.900
where I think people could come away with a much better understanding of that high level stuff

00:54:44.900 --> 00:54:50.580
if they are freed from so much of their attention being on the low level stuff.

00:54:50.580 --> 00:54:50.920
Yeah.

00:54:50.920 --> 00:54:51.840
Yeah.

00:54:51.840 --> 00:54:57.680
Just the grind of factoring polynomials or taking the derivative or whatever, right?

00:54:57.680 --> 00:54:57.960
Yep.

00:54:57.960 --> 00:54:58.440
Yeah.

00:54:58.440 --> 00:55:02.440
Or you see, you know, mechanical systems, if you're working with physical vectors,

00:55:02.720 --> 00:55:06.300
you just, you have a page that's just full of signs and cosines.

00:55:06.300 --> 00:55:13.620
And it's, in some sense, what that, what that is, is a failure of notation because that page full of

00:55:13.620 --> 00:55:19.780
signs and cosines is really telling you that you have not represented the computation in an effective

00:55:19.780 --> 00:55:20.240
way.

00:55:20.240 --> 00:55:25.600
That the signs and cosines are a consequence of not using vector arithmetic.

00:55:25.960 --> 00:55:26.060
Right.

00:55:26.060 --> 00:55:30.780
Which you do make a big use of with pandas and things like that, right?

00:55:30.780 --> 00:55:31.160
Right.

00:55:31.160 --> 00:55:32.100
We get to it.

00:55:32.100 --> 00:55:37.460
And this is, I think, where I started to reach the limits of the current tools.

00:55:37.860 --> 00:55:44.400
Because ideally, if you have vector quantities, like position and velocity and acceleration,

00:55:44.400 --> 00:55:46.320
you should represent them as vectors.

00:55:46.320 --> 00:55:53.500
And so when you add two vectors, you're not converting them to their coordinates, adding the coordinates,

00:55:53.740 --> 00:55:55.700
and then putting the result back into a vector.

00:55:55.700 --> 00:56:00.500
You just think of vector addition as a fundamental operation.

00:56:00.500 --> 00:56:08.140
But in the same way, we would like to be able to do differentiation and numerical solution to these methods,

00:56:08.140 --> 00:56:11.800
also using vectors as primitive objects.

00:56:11.980 --> 00:56:13.560
And we're not quite there.

00:56:13.560 --> 00:56:16.540
The SciPy libraries don't really do that.

00:56:16.540 --> 00:56:23.420
So I end up doing a lot of packing and unpacking, where I start with vectors, but then to do the computation,

00:56:23.420 --> 00:56:25.080
I have to break them down into coordinates.

00:56:25.080 --> 00:56:28.900
And then when I get the result, I have to stuff it back into vectors.

00:56:28.900 --> 00:56:35.160
I think the next generation of scientific computing, we need vectors as basic types,

00:56:35.160 --> 00:56:37.580
and we need computation with units.

00:56:37.580 --> 00:56:41.480
Yeah, right, which is something that's also often missing.

00:56:41.480 --> 00:56:46.080
To my knowledge, this does not exist in Python or any other programming language that's not.

00:56:46.080 --> 00:56:47.220
At least it is mainstream.

00:56:47.220 --> 00:56:48.640
There are probably some engineering ones.

00:56:48.640 --> 00:56:50.760
But we have things like Pint, right?

00:56:50.760 --> 00:56:51.320
Yeah.

00:56:51.320 --> 00:56:52.680
Which is a pretty neat library.

00:56:52.680 --> 00:56:56.540
It's very neat, and it's very close to what I want.

00:56:56.540 --> 00:57:01.880
AstroPy is the other library I'm aware of that does a really good job with units.

00:57:01.880 --> 00:57:11.180
And I've played around with each of them enough to be excited for the potential, but also to have hit a wall of, I still can't quite do what I want.

00:57:11.180 --> 00:57:13.520
Ideally, it should be end-to-end.

00:57:13.520 --> 00:57:21.660
I should be able to start with the parameters of my system and the initial state described using vectors with units,

00:57:21.660 --> 00:57:29.240
And then run the whole computation so that at the end, my result is in the form of vectors with units.

00:57:29.240 --> 00:57:30.080
Yeah.

00:57:30.080 --> 00:57:32.740
And that's still, that's not easy yet.

00:57:32.740 --> 00:57:33.500
Yeah, not yet.

00:57:33.500 --> 00:57:33.820
Okay.

00:57:33.820 --> 00:57:42.580
You know, the SimPy stuff is a little like that in the sense that the thing you get back is like kind of a function in the mathematical sense,

00:57:42.660 --> 00:57:45.180
like f of x equals, you know, e to the x.

00:57:45.180 --> 00:57:48.780
And you can compose them and pass them around, right?

00:57:48.780 --> 00:57:54.560
And sort of use them a little bit more than just, well, I got an answer out of this, and then I feed the answer there, right, numerically.

00:57:54.560 --> 00:57:55.200
Yes.

00:57:55.200 --> 00:58:01.400
So SimPy is end-to-end in this way, that you start with symbols and you end with symbols.

00:58:01.400 --> 00:58:07.400
There's no like in-between where you have to break it down into numerical methods and then build it up again.

00:58:07.960 --> 00:58:16.460
So yeah, I think SimPy has achieved this goal and we're still, I think, working on vectors and units and scientific computation.

00:58:16.460 --> 00:58:17.240
Yeah, absolutely.

00:58:17.240 --> 00:58:17.880
All right.

00:58:17.880 --> 00:58:23.180
Well, we're pretty close to out of time, but I think maybe let's just touch on one more kind of fun.

00:58:23.180 --> 00:58:26.840
And that is the, people can go and play with this.

00:58:26.840 --> 00:58:29.000
That's the bungee dunk.

00:58:29.000 --> 00:58:32.320
Do you want to tell people what kind of insanity a bungee dunk is?

00:58:32.320 --> 00:58:34.540
And then you can just talk about this modeling problem.

00:58:34.920 --> 00:58:40.680
As a way to say, some human being put their body in jeopardy to test this theory, right?

00:58:40.680 --> 00:58:41.640
Tell us about this.

00:58:41.640 --> 00:58:42.080
Yes.

00:58:42.080 --> 00:58:42.480
Okay.

00:58:42.480 --> 00:58:47.980
So this was partly prompted by this video, which shows a person doing a bungee jump.

00:58:47.980 --> 00:58:49.580
So they're jumping off a crane.

00:58:49.580 --> 00:58:51.740
They have a bungee cord attached to their ankles.

00:58:52.040 --> 00:59:01.400
And when the cord is stretched out and fully extended, they are about four feet from the ground and they can reach out.

00:59:01.400 --> 00:59:05.740
And the person jumping has a cookie or a biscuit because they're in the UK.

00:59:05.740 --> 00:59:11.880
And they dunk the cookie into a cup of tea that is on a dock at the bottom of this.

00:59:11.880 --> 00:59:13.360
And I forget the number.

00:59:13.360 --> 00:59:14.500
Was it 30 meters?

00:59:14.500 --> 00:59:15.840
But it was a roll round.

00:59:15.840 --> 00:59:15.900
Yeah.

00:59:15.900 --> 00:59:17.260
Something like that.

00:59:17.260 --> 00:59:17.520
Yeah.

00:59:17.880 --> 00:59:20.380
It was way too far for a person to do that with their body.

00:59:20.380 --> 00:59:21.700
Now, part of this is that the bungee-

00:59:21.700 --> 00:59:27.300
The video shows them literally they come to a complete stop because the way the springs work.

00:59:27.300 --> 00:59:37.600
And they are right at where they literally do dunk this biscuit into the tea and then shoot back up for the back and forth oscillation by Hook's Law of the bungee, right?

00:59:37.600 --> 00:59:38.300
You got it.

00:59:38.300 --> 00:59:38.800
Right.

00:59:39.020 --> 00:59:41.840
Now, the margin of error here is low.

00:59:41.840 --> 00:59:54.460
Most people want to do a bungee jump to not do this because if it just turns out that he had extended about two meters more than he expected to, he would have at least hit the plank.

00:59:54.460 --> 00:59:56.620
And he was over a body of water.

00:59:56.620 --> 01:00:00.400
So maybe it's not a catastrophe, but it was a risky thing to do.

01:00:00.400 --> 01:00:01.920
At a minimum, it's going to hurt.

01:00:01.920 --> 01:00:02.540
Yes.

01:00:03.540 --> 01:00:03.980
Yeah.

01:00:03.980 --> 01:00:10.920
So basically, you go through the idea of like, well, if you wanted to try, the record was 70 meters.

01:00:10.920 --> 01:00:11.660
Oh, okay.

01:00:11.660 --> 01:00:13.320
Oh, that is way up there.

01:00:13.320 --> 01:00:16.120
So that's way up there.

01:00:16.120 --> 01:00:25.260
So if you wanted to say, you know what, guy with a cool beard that currently holds the Guinness Book of World Records, we have pandas, we have notebooks, we're going to beat this.

01:00:25.740 --> 01:00:26.060
Right.

01:00:26.060 --> 01:00:29.440
You could go through and model all the details out.

01:00:29.440 --> 01:00:38.020
And you talk through some of the assumptions like the bungee will not apply a slowing force to you until it fully extends the slack length of the bungee.

01:00:38.020 --> 01:00:41.440
And then it is a perfect spring and on and on, right?

01:00:41.440 --> 01:00:41.960
Right.

01:00:41.960 --> 01:00:44.700
But here's where there is some interesting physics.

01:00:44.700 --> 01:00:47.040
So here is the other motivation for this problem.

01:00:47.040 --> 01:00:49.520
Remember, thinking about modeling decisions.

01:00:49.520 --> 01:00:55.040
What can you leave out and what do you have to include in order to get a precise answer?

01:00:55.380 --> 01:00:59.180
So in this scenario, like air resistance is definitely a factor.

01:00:59.180 --> 01:01:04.080
And the stretch of the spring and its restoring force is definitely a factor.

01:01:04.080 --> 01:01:05.820
But here's the interesting part.

01:01:05.820 --> 01:01:15.540
During the first phase of the jump, while the bungee cord is not yet stretching, but it is uncoiling because it starts out in a great big U shape.

01:01:15.540 --> 01:01:22.140
It's dangling down and it has to unravel or, you know, unwrap itself as you are falling.

01:01:22.500 --> 01:01:32.840
The first model that you probably think of is that it's just free fall, that you are being pulled by the force of gravity and the bungee cord is being pulled by the force of gravity.

01:01:32.940 --> 01:01:35.980
And so there's no net interaction between the two.

01:01:35.980 --> 01:01:41.840
And so you would think it would be just your acceleration would be equal to G, you know, 9.8 meters per second square.

01:01:41.840 --> 01:01:43.860
And that's what turns out not to be true.

01:01:43.860 --> 01:01:47.260
And it's not at all obvious, but there is an interaction with the cord.

01:01:47.260 --> 01:01:50.400
It is transferring momentum from the cord to you.

01:01:50.780 --> 01:01:53.000
It's analogous to a whip action.

01:01:53.000 --> 01:01:59.460
And the net effect is that you accelerate faster than gravity because the cord is actually pulling you down.

01:01:59.460 --> 01:02:06.920
It turns out that the difference you would be off by, if you ignore this effect, you would be off by about two meters.

01:02:06.920 --> 01:02:09.600
And that's going to be a problem.

01:02:09.600 --> 01:02:11.220
That was your margin of error.

01:02:11.220 --> 01:02:12.460
Right.

01:02:12.820 --> 01:02:15.620
So there's a nice physics paper that explains this.

01:02:15.620 --> 01:02:25.100
And there's a really nice Veritasium video that explains the phenomenon and does a really compelling demonstration that shows that it's true.

01:02:25.100 --> 01:02:28.000
Veritasium is fantastic for this kind of stuff.

01:02:28.000 --> 01:02:31.180
It's a YouTube channel that does these kinds of experiments.

01:02:31.180 --> 01:02:34.220
A little bit like the Discovery Show, but way better.

01:02:34.220 --> 01:02:35.180
They're really good.

01:02:35.180 --> 01:02:35.420
Yeah.

01:02:35.600 --> 01:02:39.600
Did you see the downwind sort of sailboat, but a sail car?

01:02:39.600 --> 01:02:40.640
No, I don't.

01:02:40.640 --> 01:02:42.420
Oh, maybe I did actually see that.

01:02:42.420 --> 01:02:42.700
Yeah.

01:02:42.700 --> 01:02:43.640
I think I did.

01:02:43.640 --> 01:02:44.520
That one's very good.

01:02:44.520 --> 01:02:44.940
It's been a while.

01:02:44.940 --> 01:02:45.520
Yeah.

01:02:45.520 --> 01:02:49.020
I'll see if I can find the channel and put it up in the show notes for people.

01:02:49.020 --> 01:02:49.280
Yeah.

01:02:49.280 --> 01:02:49.680
All right, Al.

01:02:49.680 --> 01:02:54.620
I think with that, we probably should call it for time, but very interesting.

01:02:54.620 --> 01:02:59.460
People don't actually recommend you go try to break the bungee dunk record.

01:02:59.460 --> 01:03:00.540
Yeah, no.

01:03:00.540 --> 01:03:01.080
Do something else.

01:03:01.080 --> 01:03:03.320
But if you do, it is fun to watch.

01:03:03.320 --> 01:03:03.560
Yeah.

01:03:03.560 --> 01:03:04.700
Make a good model.

01:03:04.700 --> 01:03:05.340
Exactly.

01:03:05.340 --> 01:03:08.040
Make a good model and let us know.

01:03:08.040 --> 01:03:10.780
We'll share it, but we don't recommend it.

01:03:10.780 --> 01:03:11.980
All right.

01:03:11.980 --> 01:03:14.060
Final two questions before we get out of here, Alan.

01:03:14.060 --> 01:03:15.380
You're going to write some Python code.

01:03:15.380 --> 01:03:16.980
What editor do you use?

01:03:16.980 --> 01:03:22.120
I'm using mostly Jupyter Notebooks, but also a little bit of VS Code.

01:03:22.120 --> 01:03:22.440
Okay.

01:03:22.440 --> 01:03:24.360
For Notebooks, is it straight Jupyter?

01:03:24.360 --> 01:03:25.400
Is it JupyterLab?

01:03:25.400 --> 01:03:28.440
I just had JupyterLab 4.0 come out, which is a big update.

01:03:28.440 --> 01:03:28.980
I know.

01:03:28.980 --> 01:03:34.300
And every time JupyterLab gets better, I think now's the time for me to make the switch, but I have

01:03:34.300 --> 01:03:34.620
not.

01:03:34.620 --> 01:03:38.740
And partly it's familiarity and partly as a teaching environment.

01:03:38.740 --> 01:03:41.900
I prefer a simple environment with the minimum distraction.

01:03:41.900 --> 01:03:42.220
Sure.

01:03:42.220 --> 01:03:43.680
That's certainly valid.

01:03:43.680 --> 01:03:44.500
All right.

01:03:44.500 --> 01:03:48.480
Then notable PyPI package, or Conda package, if you prefer.

01:03:48.480 --> 01:03:48.980
Right.

01:03:49.120 --> 01:03:55.960
Well, I have to say the SciPy, NumPy, Pandas, those were the primary things I was using

01:03:55.960 --> 01:03:57.320
for this book.

01:03:57.320 --> 01:04:01.840
And then maybe a shout out to Pint, which I, you know, as I said, I think it's not quite

01:04:01.840 --> 01:04:04.960
doing everything I want, but I think it's a really great tool.

01:04:05.080 --> 01:04:05.320
Excellent.

01:04:05.320 --> 01:04:06.060
Yeah, I agree.

01:04:06.060 --> 01:04:06.600
All right.

01:04:06.600 --> 01:04:07.520
People are interested.

01:04:07.520 --> 01:04:08.560
They want to check out your book.

01:04:08.560 --> 01:04:11.120
I'll put the link in the show notes.

01:04:11.120 --> 01:04:14.120
There's Jupyter Notebooks up on Google CoLab.

01:04:14.120 --> 01:04:18.860
If you're feeling brave, you can create your own virtual environment, install them locally

01:04:18.860 --> 01:04:19.940
and run them there as well.

01:04:19.940 --> 01:04:20.740
That works too.

01:04:20.740 --> 01:04:21.760
Anything else you want to say?

01:04:21.760 --> 01:04:22.900
How people get started with this book?

01:04:23.200 --> 01:04:25.180
The idea is to just get you into it.

01:04:25.180 --> 01:04:30.960
There are some case studies and a lot of chances to take whatever system you're interested in

01:04:30.960 --> 01:04:32.340
and apply these tools.

01:04:32.340 --> 01:04:34.320
So I hope people enjoy it.

01:04:34.320 --> 01:04:37.240
And if you do anything interesting with it, let me know.

01:04:37.240 --> 01:04:37.800
Sounds good.

01:04:37.800 --> 01:04:39.320
Well, thank you for being here.

01:04:39.320 --> 01:04:40.840
And thanks to everyone for listening.

01:04:40.840 --> 01:04:41.340
Thank you.

01:04:41.340 --> 01:04:44.940
This has been another episode of Talk Python To Me.

01:04:44.940 --> 01:04:46.760
Thank you to our sponsors.

01:04:46.760 --> 01:04:48.360
Be sure to check out what they're offering.

01:04:48.360 --> 01:04:49.800
It really helps support the show.

01:04:50.920 --> 01:04:53.860
InfluxData encourages you to try InfluxDB.

01:04:53.860 --> 01:05:00.340
InfluxDB is a database purpose-built for handling time series data at a massive scale for real-time

01:05:00.340 --> 01:05:00.740
analytics.

01:05:00.740 --> 01:05:04.680
Try it for free at talkpython.fm/InfluxDB.

01:05:04.680 --> 01:05:08.320
Are you ready to level up your Python career?

01:05:08.320 --> 01:05:13.240
And could you use a little bit of personal and individualized guidance to do so?

01:05:13.240 --> 01:05:20.020
Check out the PyBytes Python Developer Mindset Program at talkpython.fm/PDM.

01:05:20.020 --> 01:05:22.300
Want to level up your Python?

01:05:22.300 --> 01:05:26.280
We have one of the largest catalogs of Python video courses over at Talk Python.

01:05:26.280 --> 01:05:31.460
Our content ranges from true beginners to deeply advanced topics like memory and async.

01:05:31.460 --> 01:05:34.120
And best of all, there's not a subscription in sight.

01:05:34.120 --> 01:05:37.040
Check it out for yourself at training.talkpython.fm.

01:05:37.040 --> 01:05:38.940
Be sure to subscribe to the show.

01:05:38.940 --> 01:05:41.720
Open your favorite podcast app and search for Python.

01:05:41.720 --> 01:05:43.020
We should be right at the top.

01:05:43.440 --> 01:05:48.180
You can also find the iTunes feed at /itunes, the Google Play feed at /play,

01:05:48.180 --> 01:05:52.380
and the direct RSS feed at /rss on talkpython.fm.

01:05:52.380 --> 01:05:55.820
We're live streaming most of our recordings these days.

01:05:55.820 --> 01:05:59.220
If you want to be part of the show and have your comments featured on the air,

01:05:59.220 --> 01:06:03.600
be sure to subscribe to our YouTube channel at talkpython.fm/youtube.

01:06:03.600 --> 01:06:05.500
This is your host, Michael Kennedy.

01:06:05.500 --> 01:06:06.780
Thanks so much for listening.

01:06:06.780 --> 01:06:07.940
I really appreciate it.

01:06:07.940 --> 01:06:09.900
Now get out there and write some Python code.

01:06:09.900 --> 01:06:30.460
I really appreciate it.

01:06:30.460 --> 01:07:00.440
Thank you.

