Often in engineering, we run into equations that would be pretty difficult to solve by hand. The good thing is that we usually don't have to. Digital calculators and modern computers can solve incredibly complex equations quickly and accurately. But this raises the question, what did engineers and scientists do before we had powerful digital tools? While starting in the late 1800s and even as late as the 1970s, engineers were building mechanical analog computers to solve complex equations with unparalleled speed and accuracy. These mechanical computers utilized a host of mechanisms to add, multiply, divide, and even integrate functions based on physical inputs, such as the rotation of a rod or the position of a knob. Learning about these machines is not only an excellent study in mechanical engineering, but also a really cool, tangible way to understand calculus. So in this video, we'll be looking at one of the mechanisms that made mechanical computing possible, the mechanical integrator. Let's quickly remind ourselves of what an integral is. The integral of a function, understood graphically, is the area underneath the curve. Let's explain this using a common example. Today we were in a car traveling at 10 meters per second for 60 seconds. Here's a graph of the velocity over time. The question is how far do we travel in total? Well, in this case, it's a simple calculation. The total distance traveled is just rate times time, 10 times 60 equals 600 meters. But notice something else. Rate times time is also the area of this rectangle, or the area underneath the velocity function. The total distance traveled is the area underneath the curve. Another way to write this is that the integral of velocity from time zero to time one is the total distance traveled over that time period, or the area underneath the curve. This holds true for any velocity function. Imagine that our car traveled at three different speeds over the course of 30 seconds. The total distance traveled is still the integral of velocity, or the area underneath the curve. But now, instead of one simple rate times time calculation, the answer is actually a sum of three different rate times time calculations. Now, say our velocity function looked like this. In our first two examples, we solved by multiplying rate times time. But now the rate is different at every single point in time. So how do we calculate this area? Well, imagine we cut this graph into a bunch of thin slivers of size dT. With each sliver, let's take the value in the middle of the interval, and do an approximate rate times time calculation with that value. If we do this for all of the sections, and add up all the results, this will give us a pretty good estimate for the area. Now this estimate would be better if we used a smaller dT. In order for it to be perfect, we would have to do this calculation with an infinitely small dT. This is essentially summing up an infinite number of rate times time calculations for infinitely small sections of this graph. Now, for many functions, we can actually perform this calculation using calculus. But the fascinating thing is that we can also solve it using this machine. This is a mechanical integrator that I've been designing as a teaching tool. Let's see how it works. The two main components of any mechanical integrator are a time disk that rotates at a constant rate, and a follower disk that rotates in output shaft. Here's a simpler presentation of these two components. When the machine is running, the time disk rotates at a constant rate, when the follower rests in contact with the time disk. The position of the follower relative to the center of the time disk can be changed over time. Notice how at any given position, the follower disk is rotating at a certain rate. If the follower is farther away from the center of the disk, it rotates at a higher rate. If the follower is on the opposite side, it rotates in the opposite direction, or at a negative rate. If the follower is in the center, it doesn't rotate at all. So the placement of the follower determines the rate at which it rotates. We can change that rate of rotation by changing the position of the follower. So if we keep the follower at a fixed position, it rotates at a constant rate. This is just like the car traveling at a constant velocity. Say this position corresponds to 0.5 rotations per second, and we want to know how many rotations the follower will make in 10 seconds. We could solve this mathematically by multiplying rate times time, but we could also run the machine for 10 seconds and count how many times the follower rotates. By running the machine, the disk and follower setup is basically performing a rate times time calculation. The position of the follower determines the rate. The time is the time spent at that position, and the total rotation of the follower is the result of the calculation. What makes this tool so powerful is that we can move the position of the follower as the machine is running. Remember how to solve this integral we essentially needed to perform a rate times time calculation, but with a constantly changing rate? Well, if we move the follower as the machine is running, then the follower wheel continues to perform the rate times time calculation even as the rate is changing. So to solve the integral of this function, we can move the position of the follower to track the value of the function over time, and the total rotation of the output shaft will equal the integral of that function over that period of time. With this understanding, we can finally take a look at the entire integrator. Here we see the time disk and the follower connected to the output shaft. In this machine, for the sake of visibility and simplicity, I've made the follower stationary and the table is the portion of the machine that moves back and forth, but it still works in the same way. For the follower, I've created this sort of omnidirectional wheel that has a ring of rubber beads as its edge. In this way, the follower can roll with low friction in the radial direction, but contacts the disk with a higher coefficient of friction in the rotational direction. The displacement of the table is controlled using this lead screw, and the follower rotates this output shaft. For the purposes of this demonstration, I've also attached this module that can control the lead screw with a stepper motor and read the output shaft within encoder. Let's graph a few functions for demonstration. With the function equal to zero, the integral is also zero. Here is a constant function, like the one we looked at earlier. You can see the integral increases linearly over time. Now our function is a linear slope starting at zero. With the rate of rotation increasing linearly, the integral grows at a constantly increasing rate, taking the form of a quadratic. Here the integrator is graphing the third degree function that we looked at earlier. The integral over time is a fourth degree polynomial. And here you see the machine graphing a sine wave. In this case, the function dips from positive to negative, so the integral increases and then decreases. Graphing the total rotation of the output shaft, you can see that the integral of a sine function follows the pattern of a negative cosine function. The purpose of this video has been to illustrate the function of a mechanical integrator as a physical analog to taking the integral of a function. In reality, mechanical integrators have been used for much more than solving simple calculus problems. In 1878, Lord Kelvin's harmonic analyzer used seven integrators to analyze changes in atmospheric temperature and pressure. Throughout the 1900s, the US Navy used integrators in mechanical ship computers to automatically calculate complex trajectories to hit moving targets in real time. And from the 1920s to the 1940s, engineers designed machines called differential analyzers that coupled the inputs and outputs of up to six integrators, enabling the evaluation of virtually unsolvable differential equations. And while there is so much to be said about all these different applications, we will unfortunately have to save that for another video. And with that, I just want to say thank you for watching this video. I hope you've learned something today either about calculus or engineering, hopefully both. This video is part of a project that I've been working on in collaboration with Dr. Michael Lippmann and John Prevo of Princeton University. So a special thanks to them. And thanks also to the Princeton University Keller Center for their support for this project. So that's it for today. Thanks again for watching, and we'll see you in the next one.