Hi, everyone. Wow, that's loud. This is your obligatory machine learning talk. Every conference has to have one. Here it is. I'm Steph Walter. I work at Red Hat and I wanted to show you how we're applying machine learning to finding bugs. The there's this is a talk about a subject that I feels very much in progress. I like to normally talk about things that are done and so you can play along and do stuff. The stuff that I'm going to show here, you can certainly run on your laptop. That's not the problem, but it's far from complete. So if anyone has interesting places to take this or wants to get involved or work along, you know, that's the intent of this to talk about what can we do better here? How can we make this work? So Let's see if the clicker works. Woo! Okay, so first off, this is the Gospel of Martin Pitt. Any sufficiently complex system will have bugs. Bugs are entropy, and entropy is fundamental to the universe that we live in. If you don't have bugs in your software, your software is trivial. Really, what we want to do is minimize the bugs that have a significant impact, knowing that there will always be bugs. There will always be entropy. We want it to have less effect. In addition, for anyone who's worked with testing to a decent extent, we'll know that false positive, also known as flakes, are everywhere. They're a pain in the butt, and they constantly happen in a pull request that you open and some tests will fail in some unrelated part of the software, some subsystem, something else like that, and this is super annoying. So here's some data and some stats from the cockpit integration tests. The cockpit does about somewhere near a million, well maybe more like 800,000 virtual instances spooled up per month to test the various changes that come into the project. If you go and open a pull request for anything in the project, about 200, no sorry, 2000 virtual machines will be started to test that. That includes booting Linux, testing some feature, shutting it down, and doing that 2,000 different times. So we can see here, do I have a pointer? I do. Nice. In the last 90 days, this is up-to-date data. This is how many total test runs have gone. These are full integration tests. These are not unit tests. These are full Linux systems being booted. Of those, we have this many failures in total. So that's about 5%, or 4.9%, something like that. So most of the time, the first thing that you realize is most of the time the tests succeed, which is most of the time, those virtual machines and those resources are basically being wasted.  They're just doing the same thing, same thing over again. But they do that in order to find these test failures. When we break out these test failures, we find this, that there are 42,000 real failures, 54,000 issues that are known or tracked somewhere else. Someone has already said, this is an issue, but it's not part of cockpit. We can't fix it ourselves. We're going to file a bug somewhere else. And we're going to track it and ignore it from here on out. And then this many test flakes. We'll get into how we can tell the difference between test flakes versus failures in a minute. What's interesting here is that when you look at, no, when you look at a different tab, when you look at the cockpit pull requests in the project, Martin Pitt popped up, you can see that very often, a pull request will fail due to flakiness. In fact, it's very common that a pull request fails like here, this pull request by Zana. Hi, Zana. We'll fail due to unrelated reasons. This entire pull request will be marked as red due to this one test that has failed on one operating system of all these different ones that are tested on. So of about 2,000, 2,500 test runs, all of this by such a CI system is fundamentally collapsed into one red. One red propagates up like that. So that's why we see those numbers that that many real failures, 42,000 seem to make the project look very, very red. So the test flakes have an effect that goes far beyond their numbers. If you want to access this data, there's a URL that this is constantly updated every week. And the data inside this file looks something like this. I've expanded it, it's JSON-L format, and each line is a different record. We have data about the pull request that we're testing, the revision that was pushed to that pull request, the status of a test, whether it's failure, where it was tested, in this case, Fedora 27, the data at which it was tested. I'll get back to that merged line in a second. The test name, the URL for the log, whether that issue is tracked somewhere else, and the actual contents of the log. The merged line is interesting. The merged line is a piece of data that tells us whether someone ignored that failure or not. Whether this record represents something that got merged into the project or not. So a test either, a test failed, and someone said, I'm going to re-trigger the tests, and then those same commits were merged, or someone just forced the thing to merge anyway, ignored the failure. So we can tell that a person, a human, thought that this, if there's a failure here, they thought that this failure was unrelated to the revision, and therefore we can with a pretty good accuracy guess that anything that has status of failure with merged equals true is at least by the team regarded as a flake. Maybe wrong sometimes, but it was regarded as a flake, a false positive. And this is a source of training data. Once you have 2,400,000 records, and you have this kind of data about some aspect of human behavior, you can then start to train machines to learn from that. Just before we go any further, Cockpit is not some little web UI that does some few little things. It interacts with all parts of the system. So when we're talking about testing here and finding bugs, we're not just talking about some JavaScript bugs. We're talking about bugs all the way from system D to SE Linux to accessing the Kubernetes API, accessing Etsy password, the entire spectrum of what's happening on Linux. There's another Cockpit talk that's going to happen upstairs at 3.45 if you want more info on some of this. So what we're talking about here is finding bugs in Linux in general. When a bug happens in Cockpit, it's very often the case that it's in some interaction of these components. These components all iterate at different versions, and sometimes people make changes that break someone else or have an account for an older version of some other component, and so on. So this is a claim I'd like to make, and I'd like to prove. This is very much in progress. I'm making this claim here, but I don't feel like I've proven it in a thesis sense yet. Is that the test flakes of false positives are by and large with a margin of error bugs. False positives test flakes are bugs. They are the entropy in your software, the latent bugs that are hidden that are causing these false positives to happen. All of these annoying flakes that plague your project when you test aggressively are really the tests finding those problems and being helpful, and they're being by and large by most projects are ignoring them. So we can turn that around. Either we can abuse hundreds of children in a sweatshop and make them read these records and figure out that there's bugs here, or we can use machines to do it. And these tests are essentially fuzzing Linux. They are running through various races, various loads, various timing issues, different combinations of components, all of this stuff, and all these mutations are essentially fuzzing once you talk at that scale, essentially putting different inputs, not inputs to the software from the front end or the command line or whatever, but inputs to how it runs. And lastly, these same bugs that are false positives in your testing are the same ones that customers and users and people will run into when using it, and you will never be able to reproduce them, because they happen one every thousand times or one every 10,000 times you do a particular thing under specific load or whatever. And yet here they are happening all the time. By taking advantage of this, we can actually prevent them. So let's get into the machine learning part. This is how at present we try and take advantage of them. We've gone through several iterations of this. This is how it works right now. And for every topic, of course, there's an XKCD, and here's the guy saying, this is your machine learning system? Yep, you pour the data down into this big pile of linear algebra, collect the answers out the other side. What if the answers are wrong? And then just stir the pile until they start looking right. And in many cases, machine learning has a bunch of knobs that you have to be able to turn and turn it until you have the desired effect. But we can't be bashful about this. This is really what we're trying to do here. We're trying to avoid having to bring hundreds of people to come and do this thing and use machines to do it instead. That's what this kind of machine learning is. We're essentially emulating what a human could do by doing it at scale. So this is the basic concept. We want to take all the test failures, and we want to cluster them into clusters. Some clusters are loose, some clusters are tight, and then there's noise, things that don't cluster very well. There's a little cluster here, and we want to say, we want to make the claim that most of the test flakes cluster well, and that the big clusters are bugs, and the bigger the cluster, the more important the bug, the more often it happens. Some bugs are bugs in your tests, obviously, and in the cockpit tests, many of the bugs are bugs in the Linux stack. Some are in cockpit, some are in the underlying layers. I'll show you some examples of this later. So here's how this works. These are the techniques we use. Obviously, you have to pre-process the data a bit, clean it up. Then we use TFIDF, term frequency, inverse document frequency. We use this very cool, very simple technique called normalized compression distance. We used unsupervised clustering in the form of a DB scan, and then nearest neighbor classification. Let's look at each of those. All of this is implemented, by the way, with the simplest of tools, scikit-learn. If you haven't gotten into any machine learning or any of these, really, these tools, then that's a good place to start. This is nothing fancy that needs to run on spectacular hardware. So much of the clustering currently revolves around the log input. The actual raw contents of each log. If you look at, let's look at a pull request. Let's look at this example that we're looking at here. It's on this pull request, and we look at the details of that loading. You'll see that each of these things here is this kind of log output. This is just broken out. There's successful ones. There's failed ones. And this is exactly what we're clustering here. So you take the raw output, and you pass it through some basic pre-processing that does some pretty generic stuff. It replaces grids. It replaces any number with 0, 0, 0, replaces grids with Xs, figures out it also does IP addresses, although I don't think there's any here. If you notice it removes, it knows how to see a path and collapse the path. It takes these file names here and collapse them down to their extensions. Really basic things that we do naturally in our heads when we look at these logs. If you were looking at this day in and day out, as some people unfortunately had to do, you ignore these things. Most of the numbers are literally noise. Most of the file paths, you only look at the last part. If you ever see... We'll get into that next. The grids, that's just pure noise. So this is basically emulating what you do when you look at this stuff. Then the next step is using TFIDF. What TFIDF does is look at each term, in this case we treat each line as its own term, and take the entire body of data that we're training from, those 2.4 million records, and say which of the lines are found across 30% of them, are found way too often to be interesting information about this particular test. If we look back, we see that lines like this here happen very often.  It's nice status, but you really want to get rid of it. When you're actually looking for useful information, and you're doing this actively as part of your job, you just ignore that stuff. TFIDF lets us do that really effectively. There's a knob here to tweak where the percentage is. If I see this in more than 30%, I think that's where we are right now, of the logs just trash it, just ignore it. Or if I see this, I think there's another one over a certain percentage of failures, then trash those lines, and the lines just come down to the data. This is a really good example. Of course, I chose a good example for this thing, but they're not all this beautiful. Sometimes they're longer, and there's junk in there. But you can see one junk line didn't make it out this one, and I don't know why. But other than that, these 1, 2, 3 really are the data lines of that entire log, and it figured this out by itself. You didn't have to go and code in the fact that I like lines that say, wait present, or test team, or any of that. It figured that part out itself. So what happens next? Now we have this, basically what we think is reasonably the information of the test log. So we pass it into a distance algorithm called normalized compression distance, or NCD. What this is, we want to figure out how similar two things are, two pieces of data are. This is a beautiful algorithm. Maybe I'm easily impressed, but this is really impressive to me how simple this is, and how well it works. This works on images, music, logs, text, pros, whatever you want. Any kind of data and checks out how similar they are. Z is a simple function that takes any compression algorithm, passes the data in, and just takes the length of it. You take the length of the compressed data. So using this basic capability, you then take the length of X concatenated with Y, the two things you're trying to compare, the two test logs. One log is X, one log is Y. You concatenate them, you get the length. You do the same for individually, X and Y, and you pass them into this basic bounds checking setup, and you get a number between zero and one that indicates how similar two things are. If you have A, B, and C, or X, Y, and Z, you can tell that X and Y are closer than X and Z. Actually, Z is a bad example because Z is already there, but you know what I mean. You can see that these are similar, these are not similar. This is the kind of input that you can put into an unsupervised clustering algorithm. And the only caveat is that... Well, there's two. One caveat is that compression is hard to optimize on GPUs or hardware and that kind of thing. We can scale this pretty well because we're trying to compare this across tons and tons of logs to get basically matrix of how things are similar and how they aren't. So it does scale, but the actual individual tasks here are really hard to optimize besides just running them on a powerful CPU. That's the one limitation why you probably don't see NCD used more often. If someone comes up with a nice compression algorithm that works in essentially a parallelizable way, which may be fundamentally impossible, but if they do, then NCD is the kind of thing you would see all over the place. The second thing is that you have to, of course, pass in uncompressed data. So if you're using this for something else, this is a little rat hole, but if you're using it for something else, just decompress the data first. Obviously, don't pass in two MP3s into this and expect it to work. But the uncompressed audio data or text data or whatever you want, then this will actually do a really good job of telling you whether something's similar. It will literally find similar beats like if the song has a similar beat in it or the same drums and whatever. Anyway, let's move on. So the next thing we do is we use unsupervised clustering.  Defining clusters is kind of something that you would see as a hallmark of neural networking or some of these other algorithms. That's why we don't use it here because you really want it to figure out that there's a cluster here. I don't know what it is, but there's a cluster here and the things are similar. And so DB scan is just your very basic initial entry-level algorithm for doing this. I think it would be nice to move past DB scan because there's ways in which it's inefficient. It tries to calculate way too much of the matrix of distances between everything and there's things like hierarchical DB scan and other techniques, but we haven't had time to use them yet. Right now we just burn CPU and do this. One aspect of this clustering algorithm is that it has noise. Similar to what we wanted in the first picture when we started this, we want to be able to tell that there's outliers and we don't want to put them in clusters. We don't need to force everything into a cluster. We want to ignore that noise data. I'd like to show that that noise data is intermittent failures, real false positives. The machine just like someone pressed a button, some cable monkey jerked the cord in the data center or something happened, that's completely outside of finding bugs. As it stands, some of those get clustered because some of those things happen regularly, like filling up disks, but I think with enough tweaking and fixing of the actual test bugs and so on, we should arrive at a point where the actual noise is stuff that we can ignore. And the clusters are the bugs. So that's all part of the training.  I can actually show you them here. We'll look at these. I downloaded one set. There's a whole bunch of clusters and each of these have logs of all the things, all the collapsed data and so on. And each of the clusters, we can ask questions about them, such as, you know, it's cut off, such as, how many items are in this cluster? What percentage of them were merged? And that's disgusting. What percentage of them were merged? Are any of them tracked? How many different tests fail on this? Oh, look, this one just failed on one particular operating system, you know, that kind of stuff. Then when we get a new test failure in, after the training has all happened and so on, we ask the question, so given the clusters that we know about, which one is the best fit in? We use K nearest neighbor, which again is a very simple algorithm to do this. We calculate the distances to these clusters and say, where does it fit? So, we do all that with the test logs. So, it's all great and fancy to do stuff like that, implement it, but then making it actually do something in the real world is, of course, always a challenge. So what are we doing with this?  So, you can see here that this particular test failed and it retried due to flakiness. The flakiness score was high enough that it figured out, hey, this used to be ignored. This was ignored so many times by people, so let's just retry it. And that actually is self-reinforcing learning where it'll retry and learn that, hey, I retried this and it succeeded and then the commit got merged. So it actually produces better data for the next time the learning happens. We annotate the test logs with data so that people reading the test logs can say, hey, this is probably a flake or it's not, so someone can input the system and tweak the different knobs that, or sorry, configure the system and tweak the different knobs to get better results. And then we actually find real bugs. This is the interesting part. These are real bugs where we found, in this case, a bug in cockpit and there's pull requests that got merged that show that we are accessing various APIs in a completely racy way in the test for finding this. We were ignored by this for a very long while. It turns out the root causes, we were executing user ad and the group commands and various commands to access to modify user info on the system. We should have serialized them. We were accessing them in a racy way.  We can't reproduce that. But the test for finding it, when we actually listened to those flakes, it was an interesting result. This is what here is brewing right now. This particular cluster is very small. I have the number here four. It's only happened four times.  It's happened very recently in the last two weeks to prevent the system from booting at all. It just does not boot. So I mean, if we want to look at this, I don't have much time, but we have all the proof for this. It's not theoretical. There's another one where we were updating React state wrong. But here is one where we figured out that package D, package kit was crashing intermittently. These are all recent things, but this has gone on for quite a while. There was LVM crashes. There were tons of different SC Linux issues that happened intermittently during boot with races and all sorts of stuff. This stuff comes out regularly and you start to find these bugs. I don't have time to look at these and go into the details. So if you want, and here's the various commands, it's very easy to run this stuff. You can download the state. You can do the machine learning and you can actually put tests through there and get out results. And this is part of the cockpit project. One minute. So I've got to skip ahead. What's next? There's a... Tomorrow I want to work on containerizing this. So putting it in a container. I have some code done for this. Essentially the part that does the machine learning is generic enough to containerize it so other projects can use it. Event soon at some point we want to file bugs automatically.  Here's all the core dumps. Here's all the logs. This happens often enough that you really need to pay attention. And it's the second or third or first highest flake. And the machine learning believes it's not a flake at all. We want to produce a set of non-flakey tests for other projects to then use the cockpit tests so that you can basically say, we know that these things never fail wrong. They're solid tests. And we want to be able to track known issues automatically. Start to say, well, this is specific to Braille or Ubuntu or whatever. There must be a known issue in that operating system if it doesn't happen across all these others. And so we should prompt people to file an actual bug there. All right. And I'd like to make this ludicrous claim to close. Any testing system that does not have enough flakes should introduce more tests or more mutations in their tests so that they can get more flakes because otherwise your tests are not finding enough bugs. And of course, this is really backwards, but once you figure out that the flakes are bugs and you see that most of them are bugs, this is the conclusion that you're right at. All right. That's it. We have a time after the slot in this room. Can we have questions? All right. Okay. That's fair. All right. Let's talk after. No, let's talk after. He would like us to leave. You know, there's gap in the room now. All right. No. Okay. So I'll be around and we'll... We can talk here. The next talk is starting in like 15 minutes. So we'll talk in the back. But that's okay. And we can talk in the back. I'd love to hack on this together and work out the details. No. That's it. Either way. Okay. But I'd like to take questions. I'd love. That's always a fun part of the talk. So you mentioned that Zlib is slow and, well, it's not slow, but hard to parallelize. Have you thought about using something like one of those compression algorithms which are faster than memory access like BLOSC? That would be cool. Which one? BLOSC. BLOSC. B-L-O-C-B-L-O-S-C. No, but we probably should. We should try that. So, yeah, and if we... It's this idea that if you have compressed memory on disk, you can read compressed memory faster, I mean, compressed data faster. And then if you decompress it fast enough on the CPU, this whole process can be faster than reading uncompressed data. So you need very fast decompression algorithms for that end compression. Interesting. And are they hardware accelerated or is it just by inherently fast? So, BLOSC, we should look at putting that in. Compress too well, right? That's fine. There's a trade-off there. And as long as it still has the same effect, then, yeah, that's cool. We tried to choose Zlib compressed because it was really fast and we'd use the parameter nine on it or I forget which way it is, zero or nine to try and do the fastest possible. But this might be faster, so that's interesting. Any other questions? Cool. Well, thank you very much.


So, now I am interested in finding out how good my assumption was in terms of whether this is an adiabatic process or not. So, what we are going to just verify is how good was my assumption. So, this is what I am going to figure out. So, we know based on literature survey that for atmospheric conditions the thermal diffusion wave it moves at a speed called C t and that is equal to omega over 160 where omega is the frequency of oscillation. So, if I have a gas column, if I have an air column and there are pulsations going on in this air column there are pressure fluctuations happening in this air column. The heat generated in such an air column is going to it is going to propagate at this speed C t and what this means is now omega is 31.5. So, the value of C t is and that comes to 0.035 meters per second. So, this is how fast heat is going to move out or move into the system. Now, just consider this air cylinder this distance is 0.3 meters. So, from the center this distance is r and r equals 0.3 divided by 2.15 meters per second. Now, suppose at the center there is a small amount of air which is getting compressed because of this vibration in the system. Now, when it is getting compressed what does that mean heat will get generated and this heat is going to try to move out it is going to radially propagate outwards and it will try to escape the system. Now, let us try to figure out how much time it is going to take for this heat to move out. Now, I know that time delta t is equal to this velocity of heat wave distance it has to travel divided by C t and this is going to be 4.3 seconds. So, this heat will take 4.3 seconds to move from this point to the outward of the cylinder to the outside boundary of the cylinder. Now, in 4.3 seconds the piston and consequently the gas will go through a series of oscillations it is not that once the thing has gotten compressed it will stay in that situation for all the time it will again you know expand and compress and expand and compress. So, in 4.3 seconds we would have 4.3 times 5 because 5 is the natural resonance of the system natural frequency of the system and that equals 21.5 oscillations. So, what does that mean that by the time heat moves a little bit out in the radial direction you start having again expansion and as a result cooling starts happening in the center. So, heat again comes back in then once again heat it comes back in then in the next compression cycle again heat gets in it moves a little bit out and it again moves little bit in. So, as a consequence heat is trapped kind of trapped in this cylinder primarily because of the fact that C t is extremely small C t is extremely small. Now, this C t was extremely high compared to this you know compared to the natural frequency of the system then it would have been different, but because the thermal diffusion the waves speed is extremely small it heat is unable to escape the system and what that means in a sense is that the system is more or less adiabatic. Now, of course there will be some heat escaping from the edges, but bulk of the heat which is contained inside the cylinder deep in the cylinder it remains there. So, our assumption that the cylinder is going to behave in an adiabatic way the air column is going to behave in an adiabatic way is a reasonable one and our answers are correct. So, that was the second problem. The first problem was about developing a pressure wave equation if we had an isothermal system instead of an adiabatic system and the second problem which we just concluded was about natural developing a relation for natural frequency in a air column. Now, we will do two more problems and these will be in context of transmission lines and transmission line equations. So, this is the third problem. So, what we have here is let us say we have a 1 d tube and this 1 d tube is terminating and some material and this value is R the impedance at this end of the tube is R and here I have a loud speaker and it is generating sound which propagates in this tube. Let us say the length of this tube is L length of this tube is L and we have to figure out the value of this L based on some conditions we will talk about and what we are interested in finding is before we go there we have a velocity mic here. So, this is a velocity mic and what we are interested in finding out is how much time delay for particle velocity between speaker on the left and microphone on the right. So, the time delay that is what we are interested in and in this context what we are trying to find out is that what is the value of this terminating resistance. So, this is first question what is the value of this terminating resistance such that there are no reflections what does that mean that as sound comes from open end of the tube to the far to the closed end sound will come and get reflected back and we want to prevent these reflections from happening. So, what kind of value we should have at the terminal point. So, that is one thing we are interested in I will also put my coordinate system x is equal to 0 here and x is growing in this way. The second question we are interested in knowing is that if there has to be a delay. So, our first goal is to determine the value of r such that there are no reflections at extreme end of the tube at closed end of the tube. The second goal or the second thing which we are interested in finding out is what is the value of transfer function for velocity. So, this microphone is going to measure some velocity. So, what is the transfer function u mic u mic velocity measured microphone divided by velocity measured at source. So, you have u source here and u mic is at this point. So, what is this value specifically what is this value such that this system is providing a 0.3 second delay and the third thing is what is the value of l if I have to have a 0.3 second delay. So, these are the three questions. So, we will start with our transmission line equations. So, pressure and velocity we know are related to p plus and p minus using these equations. Now, we know that at x is equal to 0 there is no reflection going to happen. So, the boundary condition is this is my boundary condition there is no reflection we do not want a reflection there. So, if that is the case then at x is equal to 0 p x t or actually it should be 0 t and u of 0 t is equal to. So, this has to be positive times e s t and from these two I can say I can develop a relation for transfer function. So, p over u at x is equal to 0 equals r and when I take the ratios of these two entities you know I get z naught because this z naught is embedded here. So, when I divide p plus e minus s x over c times e s t by this entire number then I get this relation. So, we know that. So, r has to be same as z naught and we know that z naught is nothing, but rho naught c. So, that addresses the first part of my question that what is the value of r what is the value of r if we do not want to have any reflections. Now, my second question was what is the value of this transfer function u microphone with respect to u s that is source velocity. So, u mic over u s what is this value. So, now we know that as p negative you know as this term is 0 because there are no reflections. So, p of x t is equal to p plus e minus s x over c times e s t and u of x t equal to p plus e minus s x over c e s t over z naught. Now, from this relation I can find the value of u mic and also I can find the value of u at source. So, u mic is equal to u x t at x is equal to 0 and this is I have to put x equals 0 in this relation. So, this is equal to p plus e to the power of minus x x over c when x is equal to 0 is 1 times e s t over z naught and u s is equal to u l t excuse me x is equal to l because my source is located at x equals l and that is equal to p plus e minus s l over c e s t over z naught. So, u mic over u source if I take the ratio of these two terms what I get is e. So, I will calculate u mic over u s and before I start doing that I have to make a small minor modification in this picture. I had indicated that x is growing in this direction which is not right actually x is positive in this direction because that is my direction of p plus. So, if that is the case then x is equal to 0 at closed end and x is equal to minus l at open end. So, with this modification I go back and here in this relation I make another small modification and x is equal to minus l and once I put x equals minus l this negative sign becomes positive. So, what I get here is e to the power of minus s l over c this is the value of the transfer function. Now we know that s is equal to j omega.  So, this is my transfer function for u mic over u s. Now the question was that what is the value of l when I have a time delay of 0.3 seconds. So, if there is a time delay of 0.3 seconds what it physically means is that it will take about 0 it will take 0.3 seconds for sound to start its distance to travel a distance of l and in that case l is equal to time it takes to reach the other end which is 0.3 seconds times velocity of sound. So, it is 0.3 c.  So, this is the transfer function u mic over u s which is consistent with a device which provides a 0.3 second time delay and also ensures that there is no reflection happening at the closed end. And the final question was what is the length of this tube. So, we have already calculated this the length of the tube is 0.3 c and if I want to find out the actual number and this time 345 equals 103.5 meters into 3.5 meters. So, that is the third problem which we have covered today and the final problem which is the fourth problem which we will do today is again related to this transmission line theory. So, I will frame the problem first and then we will start discussing its detail. And in this case the problem is not specifically in the area of acoustics, but rather in the area of electromagnetism and electrical engineering. But we will see that whatever concepts which we have developed related to transmission line theory apply in area of electromagnetics as well. So, that is one reason because later we will use a lot of mappings from mechanical to electrical to acoustics and develop a lumped parameter model for complex acoustical systems. And in that context we have to become familiar with these equivalences. So, what we have here is this kind of a system. So, let us say I have a plate. So, this is one plate and then I have another plate these are two parallel long plates and they are metallic plates uniform thickness across the length and let us call this L and let us give a number let us say L equals 30 centimeters. So, these are two parallel plates and once again x equals 0 here and x is growing in this direction. And then at this end of the plate I am putting a voltage and this voltage is V and it can change the value of this voltage can change with respect to. So, it is a function of omega. So, it can change with respect to omega input voltage. What we are interested in finding out in this system is you know what will be the nature of this lumped element with the same impedance z equals V over i. So, what does that mean? Now I am applying some voltage on this system as a consequence there will be some current going into the plate and I am interested in finding out z and what is how is this z going to behave and the way I have defined z is it is a ratio of V and i and this value of z it depends on x. So, I will rewrite this relation. So, z will change with respect to x and with respect to omega because V is changing with respect to x and omega and i is also changing with respect to x and omega. So, what I am interested in finding out is value of z at x equals minus L. So, I am interested in finding this is x equals minus L here x is equal to 0. So, this is the first thing I am interested in finding out and then special case of that expectation is that I will find the relation z x omega at x equals minus L and then also what is z as omega becomes extremely small. So, this is a special case. So, I will find an exact relationship and then I will find an approximate relationship and then we will see how good is our how good is our approximation within 5 percent. So, that is the second thing and then the third thing is we are going to find the something related to the capacitance of the system. So, we know from principles of electrical engineering that capacitance between 2 parallel plates C is equal to A epsilon naught over D where A is the area of the plate epsilon is a material property its permittivity of the medium between these 2 plates in this case it is air or vacuum and D is the distance between these 2 plates. So, if I know the capacitance of the system I can take a meter and find capacitance of the system if I know this then what is the value of z naught. Now, this is how the problem has been formulated to solve this problem I have to know how V propagates along the length of the plate and how I propagates along the length of the plate. So, given so we know that V so V and I both they have a behavior which is very similar to you know what we saw in acoustics. So, voltage and current so there is a V plus component. So, there is a voltage and then at this end there may be some reflection. So, this is given similarly so this is so these are the transmission line equations for voltage and current. So, we will use these transmission line equations to solve to come up with answers on these 3 points. So, C in this case is velocity of wave propagation and that equals 3 times 10 to the power of 8 meters per second which is basically the velocity of any electromagnetic wave. So, this is what we know z naught as we saw in acoustics here also we call it characteristic impedance and this is again a property of the material naught and it does not change from one system to other system. So, with this background we will start solving this problem. So, we will write down the relations for transmission line equations and we know and then we will impose boundary conditions at x equals l and at x equals 0 and then we will start solving for V plus V minus and so on and so forth. So, one thing we know that at x is equal to 0 there is no current flowing at x equals to 0 because if at x is equal to 0 there was current then it will violate Karkov's current law. So, because no current can pass from this point to this point. So, there is no current at x equals 0. So, we will apply a boundary condition B C 1 at x equals 0 I is equal to 0 and what that means is. So, my relation for current is I is equal to V plus over z naught times E minus s x over c minus V minus over z naught E times s x over c. So, my current is 0. So, 0 equals V plus E minus 0 s over c over z naught minus V minus over z naught E plus s times 0 over c and because E to the power of 0 is 1. So, I get V plus equals V minus now this result is very similar to what we saw in the area of acoustics that if I have a closed boundary condition then the velocity at that point is 0 and what that means is that at that point of time P plus at that at that particular position P plus is same as P negative. So, this is my first equation. Now, the second condition is that B C 2 and what it is is that the voltage at x is equal to minus l. So, at x is equal to minus l my equations are and then here I am going to put instead of x l. So, now if I put 1 in 2 then I get I am replacing V negative by V positive. So, what I get is V plus times E to the power of minus s l over c plus E to the power of s l over c and s is equal to j omega. So, I get V plus E to the power of minus j omega l over c plus E to the power of j omega l over c and this is same as 2 V plus cosine omega l over c. Similarly, I is at x is equal to negative l is same as once again if I put V plus equals V minus in this relation the second relation for current then current at x is equal to minus l I can solve for it and I get this relation 2 V plus by z naught times j sin omega l over c. Now, what we wanted to know was what is the value of impedance at x is equal to minus l. So, I am going to take a ratio of V and I. So, therefore, z and what I get is z naught over j times cotangent omega l over c. So, this is my relation for z at x equals minus l. Now, my goal was to find what happens at extremely low frequencies what is the value of z as omega tends to 0. So, as omega tends to 0 this cotangent term it starts approaching as omega tends to 0 cotangent of omega l over c starts approaching 1 over omega l over c. So, as omega approaches 0 the cotangent of omega l over c approaches 1 over omega l over c. So, if that is the case then z minus l omega as omega approaches 0 I make that approximation in the exact relation which is this and then what I get is instead of this equal sign I have almost equal to or approximately equal to 1 over j times 1 over omega times l over z naught c. So, this is my approximate relation for impedance complex impedance and my exact relation is this is my exact relation. So, what I am now interested in finding out the second question that how good is our approximation to what value of omega is it good within 5 percent. So, I want to know that what is the difference between exact and approximate answers and up to what values of omega will this difference not exceed 5 percent of the exact number. So, what I am going to do is all we have to do is plug in different values of omega calculate exact value calculate approximate value and then see is the difference exceeding 5 percent or not and. So, that is what we are going to do. So, I am just going to write these tables I have already calculated these results. So, in first column I have omega then my approximate value. So, what I am going to do is I am going to eliminate z naught and I am going to compare c over omega l with respect to cotangent of omega l over c. So, the second column is going to be c over omega l and then the third column is and then this is my error. So, this is exact and this is approximate. So, we pick up a frequency let us say omega equals 10 to the power of 4 radians per second. So, I find that c over omega l is 10 to the power of 5 same thing cotangent and error is approximately equal to 0. I pick up a higher number omega is 1 mega hertz 10 to the power of 6 radians per second c over omega l goes down to 1000 same cotangent and again my error is still 0. So, I increase my omega to 10 to the power of 8 c over omega l further drops down and it becomes 10 and now I start seeing some difference cotangent omega l over c is 9.967 and my error is 0.33 percent. And then I do a hidden trial and try to find for what value of omega this error is approximately equal to 5 percent. So, this is the number 10 to the power of 9 times 0.38 my c over omega l is 2.63 and this value cotangent of omega l over c is 2.5 and this is about 5 percent. So, the reason I wanted to make this illustration do this example is that when because later in acoustics course we will be making a lot of approximation and we will be making statements like omega is getting very small or this number is becoming very large. Then we have to be cognizant of the fact that what is the context in which we are talking about things which are small or things which we are large. Now in a layman's view all these values of omega 10 to the power of 4, 10 to the power of 6, 10 to the power of 8 and so on and so forth they extremely large, but it turns out that our approximate and exact results are fairly close as long as my omega is less than 0.38 times 10 to the power of 9. So, this number it corresponds to 60.5 megahertz, 60.5 megahertz. The last question we were interested in finding is that I know from you know electrical engineering theory and physics that capacitance between two plates which are parallel to each other is a area of the plates times epsilon permittivity constants divided by d. If this is my capacitance can I find the value of Z naught. So, that is what I am going to do in next few minutes. So, we know that C equals a epsilon over d. The other thing we know is that when I see this approximate relation my Z is impedance V over I at x equal to minus L it is basically 1 over j times omega times L over Z naught C. Now, we know that for a capacitor the impedance that is V over I is 1 over j times 1 over omega C. So, you know capacitance is equal to 1 over omega C impedance. So, this term is also capacitance this term is also capacitance. So, this is my one relation for capacitance and then the other relation for capacitance is L over C Z naught L over C Z naught from here I am getting and now from this block I can find the value of Z naught and Z naught is equal to L over a epsilon times d over C where L is the length of the plate d is the distance between these two plates C is velocity of electromagnetic wave which is 3 times 10 to the power of 8 a is the area of these plates and epsilon is permittivity of free air. So, with this approach we are able to calculate the value of Z naught. So, that concludes my today's lecture and what we have talked about is basically a review of all these concepts which we have done in past several lectures through a set of examples through four examples and with this I conclude my today's lecture and look forward to seeing you in the next class. Thank you.


It's I'm Corbin. I'm Rick and together we're for Corbin. That's true Yeah, and boss on Instagram and Twitter. It's juicy. It spins on my finger like a ball of juice Thank you. It's okay to unfollow your official Twitter account and thank you very much. We have sent us a There's nothing. It's like Christmas. There is literally a ton of packages here I don't know how long this video is gonna be eight nine hours This is we're doing it. I never expected that we'd have to do this many mailbag episodes I know but you just keep sending us stuff and we once again are overwhelmed with the fact that you do that I know and it's so sweet, but we love doing these and we love hearing from you. Hope you like it Yeah, so but also once again if you'd like to send us a thing once again not asking you to send us anything really if you Would like to I will pin it on the main comment and so you will see That address right there. I've already started. I'm excited. It is it is Shakti and there's Big B right there instantly right on the front. So we got Shakti Dear Rick Corbin and team mailing you from Florida. Hopefully first of many Amitabh Bakshan DVDs We would love if you implement the same in your reviews Big B movie of the month segment on your show That's not a bad idea. Not a bad idea. We do love a good big B. We do has Dil Kumar who I've heard is a huge star back in the day Amitabh Bakshan rock say that name we've seen him before too. Oh Yeah, you said the cigarette guy Is it Rocky? Yeah, I think that might be it may be so I like thank you so much. We love you This looks like a DVD This looks like a job for Superman Big big yeah, yes the original yeah the original not the one with Rick. Yes, but this one By wiref with yash yash Jorah and of course big B. We've seen the trailer for this one That's wiref is the review gonna get blocked Looks like this is gonna be a big big B episode. I know That'd be funny if we got like 12 DVDs and all of them were big B I mean if I think that the last time we did one of these mailbag episodes We also recently did shoelay. Oh, yeah, right. It's like.  Yeah, that's gonna be the new channel Looks like it deep is it a beat is it a big B? Come on. Oh, no, it's Devdas. Oh Originally original Devdas. How many times has Devdas been made, but you know it's fun There's Devdas Devdas and then DevD. I think three or four But actually, I think they might have said it's been made a ton This also has Dilip Kapoor who's also in this one. Oh And actually got a message on Twitter that said how have you not reacted to any Dilip Kapoor or how are you? Is that how you Dilip? Dilip Dilip Dilip yeah, Dilip And so yet no idea what this was about. Let us know about it. I mean well Devdas. Yeah We know that I know that about it, but that's about the extent of it Oh Yeah What do we got here? It's a Mohanam and it's Vanapathstram. Didn't we do the trailer to that kid? It's a it's a Cannes Film Festival entry Did we do the trailer to that? I don't believe some. No, but we've done him. This is the shipping package. Thank you to whoever sent us this We appreciate it. Yeah, we do. Thank you so much It really helps us so much to have DVDs and Blu-rays and stuff Yes, and we are getting quite the collection now Yeah, I'll have more DVDs and most of you guys because most people don't have DVDs Yeah, pretty soon we'll have a nice big collection of nothing but Big B DVDs right along Well, that's gonna be the new channel Big B's Big B's reactions Correct Bollywood cookbook, okay, so is that it like a legit cookbook? Like is this recipes from Bollywood stars? That's SRK. Okay, so I think they take famous dishes from movies and Then they give you the recipe on how to make it. So like in okay lamb How do you say that word? Galouti. I think I guess from Calho Naho So it's a dish that was eaten in the movie And they've shown you how to make the dish that you see them eating in the movie Well, it's actually not very out of like weird because there's a oh show like I Don't know what they have you was in the introduction. I may say prawns and green vegetables maybe But they had there's a guy on YouTube. His name is Babish and he has a show called binging with Babish Okay, he makes famous dishes from movies and TV shows. Oh, okay Yeah, Patty. He's made a Royale with cheese. He's made God and all this different kind of stuff So I'm bet it that's basically this but with Bollywood, right? That's cool The first page I open to I would love to find one that we've like seen in a film and make it that would be awesome That would be great. I love that. Thank you so much. This one's two Orban models. Not you just for you Oh, yeah, but it's the same color as the old block busters and we know this one This is this is the very old one with cubby cushy cubby gum. Yeah with Rithik Ben me. I'm a top back John They'd be and Shah Rukh Khan. Yes, that's right. I remember the trailer for this one and Let me review not in a poor. Yeah, Korea Kapoor. Yeah, that's the one with a ton of people It's funny that the trailer was absolute trash. Oh, yeah on the packing list. It only says I'm a top buck shot That's three on the top box John films. Yeah, that's right. Who's keeping score at home? That's three for Big B. I do.  No if it is then man is he a shapeshifter, but this is one that I know Rick has definitely been looking forward to Oh, oh Oh, we got a note! Read the notebooks for the miles That's really long. I don't think I can but it's from India Prune India or Portland, Oregon prune India, so I'm guessing right by way of and then his name is Do not share my real name. I will not We will read this yeah here. Thank you so much saving that. That's awesome Yes, I know we have been looking forward to watching that and it's no way it's not on Netflix It's not on Amazon. It's on nothing. So thank you so much, but it's in our hands Oh Justice for a rambier. Yep This is that the scene the scene that we love between the two of them with the pica Yeah, and Ran beer. Yeah, Ran beer fans are gonna be very happy that we have this But I just want to know a couple things the first one is will he towel dance? the top comment on that on that video is Like this so Corbin will recreate this it's like And oh Yeah Remember that oh Yeah, yeah, Sartaj and On your con on your con and a dill shot the high. Yeah, we are just getting we're getting loaded for bear I'm loving this guys. We it's gonna take us forever This is I think we're gonna have to keep the channel around It's an envelope within an envelope. Is it just an is it hate man of me Is it of you? Oh, I know what this is. I know what this is. Yeah Bless their heart. Yeah, this is somebody and now we're gonna set a precedent here. Yeah, this is somebody who asked If if they sent me a photo if they sent a photo of me would I sign it and send it back? Oh I said, yeah, if you just mail me whatever picture you want with a return thing for me to send it in I will I'll be happy to sign it and send it back to you and they did so Oh, that's so sweet. Yeah, this is the picture. This is me on the partridge family I don't know if you can get it because of the glare, but that's nice. Well, I will absolutely I'm not naming the name of that, but I will absolutely sign this and send this back. That's the return very sweet. Isn't that cool? That's cool. Look at that address Yeah This guy doesn't live but five minutes for months. I think so It's a box set of DVDs. Oh my stars are all of those DVDs in there. Yeah Shashi Kapoor, Randy Kapoor's uncle One of the most underrated artists in Indian film industry is one of the first actors to break out from the oft-active roles and reach out to western Part of the world his initial films were produced out of India. He goes down the list married into this some of the personalities Who are these by films? There's five DVDs. That's awesome. Thank you so much. Thank you Turun. Wow That's we've gotten with five six seven eight nine ten eleven twelve DVDs today Unbelievable. Oh my now. We've got some freaking.  That's why I was this male. That's why I was trying to look for Packing list, where's it coming from? No, but it was sent to the PO box Then it is somebody found out you guys are having a baby You guys are so sweet.   Oh Well, good job. Oh, I was gonna love this. Thank you so much. That's very sweet Well, we have a a baby registry and so I didn't know if this was part of that that like family's been sending us stuff And so I didn't know if that was for that, but it was sent to the PO box I want to know something Where did this come from? Oh, this was sent from New Jersey. Is that a vinyl? Is that new vinyl? No Oh my no Have been looking For Bollywood vinyl. Oh for so long. Show the inking goodness. We got one for Bombay Bangorissanti We got one for, um Oh my god We got one for Come on. What does that say that for me?   That's gotta be first. That's gotta be first. That's gotta be the first one up there Oh, man. Look at him. Look at that stud. I can't wait to listen to these. I know this one's good I have a sexy and I know it. I don't know any of the other ones though. No, that is Unbelievable. You go and put one back there.  Wow Family finally managed to bring them along with me to the States while visiting my goddaughter in New Jersey Corbin may remember me from interactions on Twitter. I hope it's good I've always been interested in your vinyl collection on display and I've been introduced to some great music and yes You're welcome Here's some good album soundtracks that I have grown up listening to over the years Unfortunately the vinyl culture hasn't hit India as much yet, which I've noticed because I mean look for vinyl. It's huge here in LA Yeah, oh, it's vinyl. This is a bit become resurgent. Yeah Consider this an early Diwali gift from me. That's so cool and then his name is Just say the first name. Rajat. Rajat. Yeah, well, thank you so much. Thank you so much That is so so cool. I'm so excited to listen to that That is so cool. That is really really cool. That is so cool As a token of my gratitude for the joy you bring to my life through your creative work I'm sending you an idol of not to raja The sculpture is symbolic of Shiva as the lord of dance and dramatic arts. May he bless your artistic careers Oh, wow. Oh wow, that's gorgeous. It's pretty That's so pretty Whoa The sculpture is symbolic of Shiva as the lord of dance and dramatic arts. May he bless your artistic careers. Why is she standing on a baby? I'm sure there's a I'm sure there's symbolic misses 100%. Yeah We'll learn we're learning more. That's actually the prettiest. Oh me too. I absolutely agree. It's so ornate and detailed Yeah, I wish you could see even like there's there's differentiations on the what looks like copper staining Yeah, that's absolutely gorgeous. Wow, that's really pretty. Thank you. Thank you so much. That is so sweet It really is Christmas. This one is from Rena Rena and it's to Corbin sing and and Rick with an H Rick Kumar Mar Rick with an H. I like it and this one was kind of beat up. So I think it's like okay read first, please Rick with an H Let's see. Hi guys It's Rena Thanks for the great laughs.  Okay, so this one has my name on it. This one is your name on it. Okay for Rick Kumar What's it say? My brain is 90% Bollywood leader That's funny. Oh Heck yeah.  I got us We got one for Ashley.   I saw it Bollywood dance for beginners, baby We are absolutely That bad boy up on that screen and we're gonna try and replicate what they're doing in there. Oh my word That is glorious.  Wow the Mount you send us is insane famous Bollywood actors Wow, I love it. Holy I will laminate that bad boy Yeah, wow Where's Ranveer But wait a minute. We do have another side. We do have B. We'd have another he's at the top and in the middle Of course, and then next to him is a shawari array. All right, Bianca Rithic Salam Kapoor ran beer. Maybe this is your elder one though Like maybe it's a little I fear is relatively new Salam Khan the peek-a-pat-a-cone Charm Khan actually Kumar. Yep. Here. Take that you take that side. I Will absolutely get that laminated That is so cool We should really put it back here run beer didn't make it, but Alia did just like our review for gullywood And this one actually says to to her Come on you guys man I'm just beautiful little pendant This isn't fair you know why this isn't fair I want to like at least Do a physical thank-you back with a You know at Christmas you're supposed to get and give and I guess you're gonna say yeah, but you'd give us through the channel It's like it's no Oh my word. My word. I think that's it shirts. I Kind of I absolutely want to wear it But I also don't want to wear it because the more I wear it the more it can get worn out And I don't want to ever get it Totally, I'm gonna have to wear it. Yeah, I gotta wear them. Wow Thank you all so much wearing this on the channel a lot that was a lot Wow, I don't man I don't know how long this video is Obviously got a ton of stuff. It looks like Christmas morning in here really does but man y'all are insane Thank you so much as usual we're blown away That you would ever consider sending us anything sincerely much less the like the the kind of Personalized gifts and movies that you want us to watch because you love film so much like we do and it's just that's really over one customizable t-shirts. Yeah, it really is vinyl Which is insane Thank you. Yeah, once again if you if you'd like to send us anything not asking you to send us anything It'll be the pinned comment below Just so you can know but thank you so much. Thank you. Thank you. We love you. Love you


Mom, boy. Are you good, man? Are you good? What's going on? I got one. They talked to me. They talked to me. Are you good? Hey, come on, see the thing, baby. You have any other injuries, ma'am? Huh? Do you have any weapons on you? They have them in the bathroom there. Put that first individual that came in contact with. All right. He's got an injured right arm. All right. Yep, red light. Yeah, guys, we see his leg. Come over here. Hey, Ferb. Is it on chair? Right here. I'm holding. We're going to set you up there. We got it. OK. Stay nice and calm for me, OK? Everybody, you stay with me? Stay with me. Stay with me. There you go. Good? Yep. I'll west of here. So two of us need to move into that building. Get two additional. Same check? Got the fusee. Same side of the street? Yeah, same seat. Coffee, same side street. Yep, you got it. Yeah, it'll be. We'll get you guys out of here, all right? Until we're going to... Hey, I'll mark the time. Keep going. Keep going. We're going over the river or under the river? Under. So you want to go over the river? Over the river. All right, clip that under your shirt. Yeah, me too. What's up, Rob? Can you stand up? Yep. Right here. I'm going to help you up. So you're going to hold onto me? Check you under here. We're going to move slow. All right. You got it. Yep. You got a body? Yeah, put it on your feet. Nice. Yeah, I'll open it. I'll open it. I'll open it by the belt. We're going to pull my blood band up here. Go here. Come on. Come on. Come on. Come on. Come on. Here's your board. We're pulling. We got it. Keep your eyes open.