We go on to advanced reaction engineering. We now look at residence time distribution. Now, why are we interested in looking at residence time distribution? Of course, it comes from common sense that every reaction equipment, the time for which the reagents sit inside the equipment determines the extent to which the reaction would occur. And that is a prime motivation to understand the distribution of residence times inside the equipment. So, typically if you have an equipment like this and then we have fluids coming in and fluids going out. And you would like to know what is the time of residence of different fluid elements inside the equipment? We provide what is called as a tracer. We mentioned earlier that the tracer can be a solid, can be a liquid, it can be a gas depending upon the systems that you are looking at. And only important thing is that the tracer must be able to mingle you know with the streams. And then should have properties same as that of the stream and it should be measurable very accurately. So, that we can get the information of our interest. So, we said that if you put a tracer and measure the composition at the exit with the function of time. If you put a pulse of tracer by pulse we mean is that we put a certain milligrams or grams of tracer very quickly and that is called the pulse. And we look at the response of the system with respect to time. So, and then if the flow is v we can measure this, we can measure c, we can measure v c and this will be something like milligrams per some time say minute versus. So, we will get a curve like this, we do not know what the curve is, but whatever the curve is from here we said our e function or residence time distribution function is given as v time c d divided by m 0 where m 0 is the total amount of tracer that we have put into the system b t. So, what is it mean this term v time c t represents the material that is leaving the system at time between t and t plus d t. Well this m 0 represents the total amount of material that we have put in therefore, this fraction refers to material with time of residence in the equipment between t and t plus d t or shall we say a time of residence t. And this is the information of our interest. Now, we can do this for any kind of equipment and we said little earlier that if you have a stirred tank, we said little earlier that if you have a stirred tank that means if you have a stirred tank and you have a material coming in and going out. And the residence time distribution function for the stirred tank we said is something like this. We derived this where tau is the residence time which is given as v divided by v 0 v 0 is the flow. Now, we also said that suppose you have a sequence of stirred tanks, sequence of stirred tanks flow is coming in here going out here out here and this is tank 1 2 and n. We derived this and using first principles to say that the time of residence time distribution of the n tank sequence is given as t to the power of n minus 1 divided by factorial n minus 1 tau i to the power of n e raised to the power minus of t by tau i where we said tau i equal to tau i equal to v of any tank divided by v 0 that means the assumption is that tau 1 equal to tau 2 equal to tau n that is the assumption. Therefore, the total residence time tau which is v divided by v 0 equal to n times tau i. Based on this what we have derived and therefore, this function is a result of the experiment that we have done which means that we take put a put a tracer here put a tracer here and then measure at the end of this time this is what we will find if it is a number of stirred tanks of equal volumes. We also said that if you want to understand the performance of a real vessel you want to understand the performance of a real vessel suppose you have a real vessel. We do not know how this and this fluid is coming in fluid is coming out going out and we want to see how this system is performing as a chemical reaction suppose the reaction of this type occurring what is the expected performance of this equipment. So, this equipments because of this tracer study we have done we know the sigma square we know this mean and variance both mean and variance are known because we know the residence time distribution. So, what is our expectation the way to do this is that let us say we have this particular system consist of n tanks as an assumption suppose it is it can be approximated as an n tank sequence. So, that the first time this is first second and so on first time will perform like this therefore, the n th tank will perform like this therefore, or the performance C n by C naught which is essentially 1 minus of x n this is given by 1 by 1 plus k tau i to the power of n. And we also said in our analysis of n tank sequence that this that sigma squared we mentioned this if you recall n equal to mu squared by sigma squared we mentioned this. So, this is known on other words just to summarize if you have an arbitrary vessel and we have done the RTD test of this vessel for from which we have found out sigma squared and more square. Therefore, this arbitrary vessel can be approximated as a sequence of stirred tanks where n is given by mu n squared by sigma n squared. So, once you know that an arbitrary vessel can be described in terms of an n time sequence if it is the first order reaction we know that 1 minus of x is given by C n by C n 0 therefore, this given by 1 by k tau i to the power of n. Now, we can replace this tau i tau i is tau by n or it is same as mu n by n therefore, and this you can replace this n from the fact that n is equal to mu n squared by tau n sigma n squared sorry sigma n squared. Therefore, n everything can be replaced in terms of measured numbers the measured quantities are mu n and sigma n therefore, 1 minus of x equal to C n by C 0 which is equal to 1 by 1 plus k tau i to the power of n is also equal to 1 by 1 plus k what is tau i tau by n to the power of n that is equal to 1 plus 1 by k what is tau tau is mu n correct mu n. And what is this is mu n squared by sigma n squared and then what is n it is mu n squared divided by sigma n squared or simplifying we get this as 1 plus k 1 plus k sigma n squared by mu n to the power of mu n squared by sigma n squared equal to mu n squared by mu n squared C n by C 0 is 1 minus of x what is it that we achieved what we are saying is that if you have an arbitrary vessel we do a tracer test on the arbitrary vessel then that tracer test gives you sigma squared and mu n squared. And once you know sigma squared and mu n squared you know the number of tanks which is given by number of tanks can be represented as mu n squared divided by sigma n squared. So, in view of this relationship and if it is a first order reaction we can now say that the performance of this n tanks of this arbitrary vessel approximated as an n tank sequence can be given by this equation 1 minus of x given to the right hand side where all numbers are known because rate constants are known sigma n mu have come from the experiment. So, this RTD test now helps you to determine the performance of an arbitrary system approximated using the parameters of the tanks in series model. So, this is where the advantage of this tanks in series model comes in we are in a position to tell what is the likely performance of an arbitrary vessel. We go on further the second type of descriptions that we want to do say conversions directly from RTD. What you want to do now? You want to directly take the RTD data and say what is the likely conversion? Let us look at this problem again. We have an arbitrary vessel, we have fluids coming in going out and one fluid element goes like this, another fluid element does this, does this, does this, goes out like this and so many fluid elements seem to spend various lengths of time inside the equipment. We know from our understanding that the extent to which the fluid elements would react depends upon how long they spend inside the equipment. Therefore, the time of residence inside the equipment is crucial to the extent to which the reaction occurs. Keeping this in mind, let us say our inlet fluid consists of number of fluid elements. All those fluid elements enter at some concentration C A 0. So, fluid element 1 enters like this and then goes around comes out that is I call this is C A 1. There is another fluid element C A 2 which goes around comes out C A 2 and so on. So, different fluid elements enter start with the same concentration, but go through the equipment and come out with different concentrations. Why? Because they have spent different lengths of time. So, let us say we have C A 0 which is this element, this C A element I will call this as C A element. So, one C A element 1 which starts at C A 0 and let us say the chemical reaction is A going to be with rate constant k first order. Therefore, this is C A 0 e raised to the minus of k t. This is the extent to which because it is spent time of residence t 1. This spends t 1 seconds, this spends t 2 seconds and so on. So, this fluid element 1 starts at C A 0, but emerges as C A 0 e to the minus k t 1. This is what we would expect because it is spent t 1 second. Therefore, it will be reacted and become C A 0 e to the minus k 1 t. What is the fraction? What is the fraction of material that belongs to this residence time? If you know the e function, we think it is e t 1 d t 1 is the fraction that belongs to time of residence in the equipment which is t 1 seconds. This is something that comes out of your RTD analysis. There are another fluid element C A 0 which is 2 which starts at C A 0, but reacts for a time of residence t 2 and the fraction of fluid elements in the equipment that belongs to time t 2 is e t 2 d t 2. In other words, you have various fluid elements entering, but it is going through the equipment for different lengths of time in emerging. Therefore, the C A exit or what comes out must be some average of whatever goes in, multiplied by the e function. Whatever goes in, multiplied by the e function, what are we saying? What we are saying is that, if you have a first order reaction and if you have an equipment in which fluid elements go through and then come out at different lengths of time and each of those fluid elements react as per a first order law, then the fraction that belongs to t 1 is e t 1 d t 1. Fraction that belongs to d 2 which spends time t 2 seconds in the equipment is e t 2 d t 2. Similarly, so many other fluid elements. Therefore, the average concentration of material that emerges from this equipment will be what happens to each fluid element multiplied by the fraction of material that belongs to that time of residence inside the equipment. So, this will be the average concentration that comes out at the exit. So, in other words what we are saying is that RTD theory directly helps you to tell you what is the likely concentration of fluid elements at the exit. If you can tell what happens to each element and what is the fraction of time each of those elements spend inside the equipment. So, this general theory helps us to tell what happens to the chemical reactions taking place. So, let us take an example. So, what we are saying is that as per RTD theory the average concentration that comes out is C A 0 e to the power of minus k t multiplied by the fraction that belongs to this time of residence. Example, let us take an example that this reactor which we are trying to understand is a stirred tank. Let us say it is a stirred tank which means the e function for this tank is 1 by tau e to the minus t by tau. This we know because if it is stirred tank this therefore, let us see what is the concentration that comes out from this reactor as per the RTD theory. So, it should be what minus of k tau k t this multiplied by the e function which is 1 by tau e raise to the power of minus of t by tau and d t. What are we trying to say? What we are trying to say is that if you have an arbitrary vessel of e function given in this case if that arbitrary vessel is a stirred tank then the e function is 1 by tau e to the minus t by tau. Therefore, if it is a first order reaction each element that enters with emerge with this kind of concentration. Therefore, the average that you will see at the exit from the equipment is the average of all elements between time of 0 to infinity that goes in and comes out multiplied by the e function of the equipment. Now, we can integrate this I mean it is quite common sense please you can check it yourself when you integrate this you get the output as c a 0 1 plus k tau s where tau is the residence line. I have not done the integration, but because fairly straight forward showing that the average concentration of material comes out is c a 0 divided by 1 plus k tau s. Now, this equation is something that we have seen for a very very long time this is the output from a stirred tank. Sturred tank gives you this kind of output what have we now saying then what we are saying is that if we know the e function of a system. If you know what how the reaction takes place then we have a way of telling what is the concentration of the exit. And the proof is that moment you put E t as a C S T R we get results that we have been using for a long time. It is a way of validating the way our new procedure of understanding stirred tanks it is validates the same understanding we already have based on our previous knowledge. Now, let us look at another model called the dispersion model. We have so far talked about what we call as the tanks in series model for describing an arbitrary vessel. Then we talked about what we call as the general RTD model we call also call as the completely segregation completely this particular model directly from RTD is also called completely segregated model completely segregated model. What are we saying here when we say it is completely segregated model what we mean is that every fluid element that enters goes through the equipment without recognizing the existence of other equipment it emerges. It is here that we do an averaging of the concentration and find out what is the exit concentration that means as per the model each fluid element moves through the equipment without recognizing the existence of other fluid elements and emerges. That means it is completely segregated as it goes through the equipment and only at the exit the mix and we measure the concentration. Some people also call this as a late mixing model late mixing. Why is it called late mixing model because we assume that the mixing occurs after the exit from the reaction equipment completely segregated model is also called as late mixing model. What is that model the models assumes that the fluid elements move through the equipment without mixing with each other they emerge outside and mix and we measure that average concentration. So, that is the completely segregated model the previously we looked at the tanks in series model what is the tanks in series model is an instance where as soon as the fluid enters the tank it mixes. So, it is an instance of completely micromixed model. So, this something that we did earlier this is the completely micromixed model for which we got our answers here this is the completely micromixed model completely micromixed. So, the completely micromixed model completely segregated model these two we have used already and we know roughly what kind of answers they give. Now, we are looking at a third model called the dispersion model let us understand what this model is. What are we saying here is we have a reaction equipment fluid comes in fluid goes out. Now, let us see what happens at any interface at any volume what is it that is going on here inside an elemental volume. Now, we know from our basic understanding there is convective flow and plus there is always a diffusive transport because of the molecular conditions at that interface. If we take these into account we can say that u a c at some x u a c at some x plus b. So, this is delta x plus you have the diffusive transport which is del c del x at x and then you have minus of a d del c del x at x plus delta x. What are these this is convective entry into control this is x and this is x plus delta x this is the volume delta v. So, this is convective entry input output diffusive entry input output and then you could have what is called equal to if there is generation reaction then you put a reaction term if it is not there then you have accumulation term which is del x of del c of del t. What are we saying what we saying is that if you look at an elemental volume inside a reaction equipment we can visualize that there is a convective transport and as well there is a diffusive transport of material entering that control volume. Now, we can divide throughout by a delta x and simplify and so on. So, that we will get minus of del c del x times minus del c del x I can cancel of a here, a here, a here and a here and a here delta x divide throughout. So, you will get u del c del x the minus sign and here we will get equal to d del squared c by del x squared plus plus equal to del c del t. This is del c del c where I have got to write minus x to the delta x. So, this minus sign is this is plus so this is this is fine. So, this is the differential equation that governs the motion of this fluid inside this.  So, let me make a small simplification simplification I make is that theta equal to t by t bar t bar equal to l by u and z equal to x by l. So, that this our equation now becomes del c del theta del c del theta this left hand side. So, it will become a t bar will come in the denominator equal to d by l squared del squared c by del z squared. So, I have taken the second term. So, this I have taken the second term here second term here I replace x in terms of z minus of u by l del c del z. So, u del c this x I put in terms of z. So, it will l comes here. So, it is I have done nothing new has been done. So, you can simplify this and say this del c del theta equal to d by l squared t bar minus of u by l t bar del c del z. Now, t bar by definition is u l by u sorry is l by u. So, this goes off. So, this becomes l by u therefore, this becomes del c del theta equal to d by u l minus. So, del squared c by del z squared I forgot del squared c by del z squared I forgot this del squared c by del z squared minus of del c del z. So, this is this is the differential equation that governs. So, our system is this this is the system and this is the control and then we have fluid entering and leaving to which at the here we are putting a tracer. We are trying to see what is the concentration of tracer at the exit. Let me restate the problem. The problem we are trying to understand and solve is that you have a reactor. There is an elemental volume to this whole reactor we have a pulse input going in. We want to know what is the concentration of the pulse at the exit here. What is this concentration? This is the question that we want to solve because moment you know that we have better understanding of the effect of this parameter diffusion coefficient and dispersion coefficient on the performance of the system. Now, what do we do now? Now, we recognize that our arbitrary vessel which is described by this equation del c del theta equal to d by u l del squared c by del z squared minus of del c del z to which we are having a pulse input the pulse input. And we want to know what is the concentration that we will measure at the exit at z equal to 1. Now, you notice here this is the linear problem. There are no non-linear is involved here and d by u l is called as the dispersion number, dispersion number. Some people call u l by d as Peclet number. This is a more common nomenclature u l by d whichever the way we look at it. This differential equation has one parameter which is called the Peclet number u l by d. Now, if you have the response to this curve to this to an arbitrary vessel going through here. So, you will have data on c t versus t. You will have data at position z equal to 1. So, there is some response. Therefore, once you have this response in principle you should be able to solve this equation. And then adjust the value of the parameter d by u l and fit this data parameter which is Peclet number which describes the arbitrary flow inside this equipment. On other words what we are saying is that if you are going to describe your system in terms of dispersion model you require what is called as the Peclet number which describes this system. To understand the value of Peclet number you have to do a pulse tracer test which you have done and found out the concentration as a function of time. Having done that all you have to now do is to try and fit this function to you will have a solution to this and then adjust the value of d by u l. So, that it fits the data. So, that way you can find out what is the value of d by u l that describes your equipment. So, essentially all we are saying is that if you know d by u l or u l by d whichever you like then you know what is the state of mixing inside the system. Now, in the literature solution to this equations are available for various types of boundary conditions. For the moment we will try to look at some of these things in our tutorial class. For the moment we can let us assume that we know the solution and the solution that is available in the literature is of this form. So, what people are saying is that the solution to this differential equation is available in the form of sigma square or the variance of this of the response divided by the mean value of the response. Second moment divided by first moment square this is given as in terms of Peclet number. On other words all that is being said is do a tracer test find out the variance mean and variance of the response that you will get. Moment you know the mean and variance the ratio is given by this representation 2 by Peclet number minus of 2 by Peclet number square into 1 minus e to the power of minus Peclet number. On other words if you know mu square sigma square and mu square then you can find Peclet number from this equation. So, you have now done a tracer test and on that tracer test you have determined what is the Peclet number that is appropriate for your kind of mixing in your equipment. Now, please refer at little earlier you said in this arbitrary vessel can also be thought of as a series of stirred tanks from sigma square and mu square. We also determine number of tanks that are required to describe this flow field. On other words the number of tanks is a measure of mixing of the equipment. Similarly, Peclet number is also a measure of mixing. On other words in these 2 models in 1 model the parameter is the number of tanks in another model the parameter is Peclet number. Or number of tanks is a measure of mixing in the equipment similarly Peclet number is a measure of mixing in the equipment. So, different parameters have different way of understanding mixing in the equipment. Now, that we know the Peclet number in the equipment or in other words which is the state of mixing as captured by Peclet number. Now, we are now in a position to use this information to understand how our reactor as per this model is called the axial dispersion model will perform. Let us try to do that now. Let us look at the dispersion model once again. What we said this is convective flow input convective flow output and this is the diffusive flow input diffused flow output equal to the accumulation. Generation term we removed suppose you want to put the generation term as minus of k and then concentration c times a delta x. Suppose, I put this term as the term corresponding to the generation. So, in the limit as a tends to 0 remove this this here you will get a term which is minus of k c. What are we saying now? What we are saying is that now that we know the Peclet number that describe the state of mixing in the equipment. Now, we are in a position to understand how this reactor will perform therefore, we have written the unsteady state equation taken into account the presence of chemical reaction. We want to understand the performance in system under steady state therefore, we remove the unsteady state term. So, what are we saying now? We want to now look at the performance of this chemical reactor at steady state in the presence of a chemical reaction. The steady state description of our equation is the following. So, we have d del squared c by del x squared minus u del c del x minus of k c equal to 0. This is what we have to solve to understand the dispersion model behavior of our system. Now, since it is only a first order differential sorry since only a difference equation in one variable. So, I will replace this like this d squared c by d x squared minus of u d c d x minus of k c equal to 0. Let us look at the system once again this is our system and we have taken an element and then we have written our balances and come to this equation. The question is how do we understand the boundary conditions for this problem? So, tremendous amount of literature in this for this situation, but let us try to understand the boundaries properly. This is boundary 0 boundary 1 z equal to x by l. How do we understand the boundaries? Now, a good way of understanding the boundary is to see what happens to flow in and flow out. So, what we have said here is that at x equal to 0 x equal to 0 minus you have u c a 0 times a at 0 minus must be equal to u c a times a minus d a del c del x at 0 plus d v. What are we saying now u a c a 0 this is the flux that means this is the flux at this is 0 minus this is 0 plus. So, at the boundary whatever material that comes in it goes out it goes out due to convection as well as due to diffusion. On other words what seems to be important to recognize here is that c a 0 if you make a plot this is distance versus concentration. You find that concentration at 0 minus is c a 0 concentration at 0 plus it is not c a 0 because of the del c del x is negative. Therefore, this whole term is positive therefore, this whole term u c a would be less than u c a 0 a. On other words it starts concentrations are like this suddenly drops and then it does this. This is the point that we should recognize the dispersion model explicitly recognizes the fact that at the boundary 0 there is a sudden drop in concentration because of the effect of dispersion. It is this effect which is not been appropriately accounted for in other models which makes this model so superior to others. Now at x equal to l what happens that is once again write u c a times a minus of d a del c del x this is at l minus must be equal to u c a times a at l plus. What are we saying? What we are saying is that our system which is our tubular reactor the actual dispersion problem exists inside and as soon as it emerges outside there is no such dispersion problem. On other words this term is appropriate to be used only inside the equipment and not outside therefore, that term has been deleted. So, this equality of material balance whatever is coming in at l minus this is convection this is diffusion and whatever is going out is by convection only because there is no diffusion term outside the chemical reactor that is the way we are understanding the chemical reactor. How do you make this equality? I mean this equality must hold at l minus and l plus. Let us look deeply at this we notice that del c del x in a chemical reactor is negative del c negative and between l minus and l plus we also know that this concentration c a cannot have changed because there is no reaction equipment. Therefore, we should expect that these two should go away therefore, applying the del c del x must be equal to 0 at del c del x equal to 0 at z equal to sorry x equal to l r z equal to 1. What we are saying is to understand the boundary conditions for solving this problem of axial dispersion where this chemical reaction occurring is to recognize the fact that there is there is convective flow outside at 0 minus inside the equipment there is convective flow as well as diffusion flow therefore, at 0 plus and the other end there is convective flow and diffusion flow inside the equipment at 0 l minus but outside the equipment there is no diffusion flow and therefore, that term has been deleted. In order that this equality holds and since there is no reaction happening between l minus and l plus we would expect that c a is the same at l minus and l plus implying that this term del c del x must be 0 at the other boundary. So, this is this or in other words del c del x equal to 0 at z is equal to 1 is also called as a celebrated dank words boundary condition. This issue was brought out and explained beautifully by dank words many many years ago and this is now very well recognized as we have understanding tubular reactors with axial dispersion. So, come to I mean summarizing this whole thing what we are trying to say is that our differential equation d square which describes the tubular reactor with axial dispersion axial dispersion. Now, can be solved solved with boundary conditions what are the boundary conditions the boundary conditions are this is the flux condition u c a u c a 0 at a minus equal to the flux at the other this one condition other condition del c del x equal to 0 at z is equal to 1. The solution to this to this equation I mean this huge amount of literature we just looked at this and then solve this problem. And we will probably have time to look at this once again during our tutorial classes, but as for now what we will do we will take the solution because it is not necessary to spend too much time. So, I am just writing down the solution just. So, that we can go forward our solution looks like this also where q squared equal to that the differential equation the differential equation that describes axial dispersion with chemical reaction inside is given by this. And the boundary condition that is appropriate to describe the problem is the flux equality condition at 0 0 minus and 0 plus. And then the no del c del x equal to 0 condition at x equal to l this is the two boundary conditions with these two kind of boundary conditions the solution looks like this. There is lot of literature in this available. So, we will not do this once again we will do it in our tutorial class. What is it that it is saying? What it is saying is now if we did not have dispersion on other words if dispersion was nil which means what it is a plug flow reactor we know how to solve the problem. Because the differential equations are much much simpler one term disappears this term disappears. So, you can solve this two straight away that is what we have been doing for a long time. What we have now down is added this term and try to understand the importance of this term. This differential equation solutions are available in terms of two parameters one is q which is which involves what is called as the Damkohler number the other one is the Peclet number. So, solution to the actual dispersion problem is available to us in terms of two parameters one is called as the actual dispersion coefficient or Peclet number u l by d inverse of dispersion number other is called the Damkohler number which is essentially k times t bar. Now what is it that we expect? What we expect is that when the when the dispersions are large or then our performance approaches CSTR when dispersions are small or performance approaches a plug flow. On other words real equipments either perform between plug flow and mixed flow. So, we will have great variations of performance between plug flow and mixed flow and our real reactors lies somewhere in between and to be able to capture the performance of real reactors we need to have an understanding of the flow field or understanding of mixing. And to be able to understand mixing we said we should have a model which quantitates mixing first we had one model which is called as the tanks in series model and where number of tanks was the way of understanding mixing then we had what is called as the dispersion model where the dispersion number u l by d which is Peclet number is a measure of mixing. So, depending upon the model the parameters vary, but they all describe mixing in their own way. So, we have looked at 3 models one is a completely segregated model based on RTD where there is no there is no other modeling parameter excepting the raw data directly plugged on with the reactant reaction kinetics. So, we have the completely segregated model based coming entirely from the RTD data there is no other modeling parameters. Then we have the tanks in series model which involves the number of tanks as a modeling parameter or you have the axial dispersion model where the dispersion coefficient or the Peclet number which is the inverse of dispersion coefficient it is used as a modeling parameter. There are 3 ways of understanding what is called as the real reactors. Please recall what we have been saying. So, far that if you have a dispersion model then this psi C A C A at l divided by C A 0 we already derived this which is equal to 4 times q exponential Pe by 2 divided by 1 plus q whole squared exponential Pe q by 2 minus 1 minus q whole squared exponential minus of Pe q by 2. We have derived this where q squared is given by 1 plus 4 k tau bar divided by Pe where this is residence time this is the residence time. We have said all these this is not new to us where Pe is the Peclet number. So, on other words what we are saying is that for a dispersion model the performance of the equipment phi which is C A by C A 0 is given by the right hand side where our parameters are q and Pe both q and Pe are numbers that we know about our reactor. That means if you have an equipment whose Pe and q are known then the dispersion model will be able to tell us how this system will perform. So, this is one way of understanding that moment q and Pe are known we know how to characterize our system. Now instead of dispersion model suppose we look at a recycle reactor model what we have been trying to say here is that we can look at a real equipment in various ways dispersion model is one way of looking at it of which we have already said what that model is all about. Now similarly we can look at the same equipment as a recycle reactor model where this is the recycle reactor this is our reactor this is our reactor. We can look at this reactor as a recycle reactor where R is the recycle ratio and the performance that means what is the conversion that you will get at the exit x 3 can be given by this equation for a first order reaction this is for a first order reaction all this we are doing it for a first order reaction. We can do for others but it is what is important is to understand the fundamentals therefore we are done for a first order reaction. So it says k t bar by R plus 1 is given by the right hand side where x 3 is the conversion at position 3. On other words what we are saying is that if we know the rate constant k t k t bar which is the rate constant multiplied by residence time and R is the recycle ratio there are two parameters what are the two parameters k times t bar and then R if you know k t bar and R and then we can say how the reactor will perform that means we can find out what is the extent to which the reaction takes place moment k t bar and R are determined through an appropriate experiment this is another way of understanding a real vessel. On other words the point we are trying to put across is that suppose you have real equipment which is giving you a conversion of x 3 for which you know what is k t bar from our experiment then we can tell what is the recycle ratio that is appropriate to this process that is another way of understanding the real equipment. There is another way of understanding the real equipment is the following in tanks in series model what we do is that we have a real equipment which we think can be modeled as a series of stirred tank which means we have done experiments on the real equipment and we find that the conversion is x and as per this tanks in series model which we already derived 1 minus of x is given by 1 plus k tau i to the power of n where n where n can be given by this equation which we already derived n is equal to mu n square by sigma n square and tau i tau i equal to and we also know that tau i equal to tau by n and what is tau? tau is equal to mu n by n where mu is the first moment of the tracer response. On other words what we are trying to say here is that if you have a real vessel and you want to model this as a tanks in series model so if you understand from your experiments what is the extent of reaction that you observed then using that data using the data you will be able to tell how many tanks are required to model this equipment. So if you look at the final expression 1 minus of x equal to this if you look at this if 1 minus of x equal to 1 by all these parameters k sigma n and mu n. So how many parameters are involved here? The number of parameters involved here is sigma n k mu n are the 2 parameters. So if you know these two then we can tell how this tanks in series model will perform. So we talked about three models now dispersion model the recycled reactor model tanks in series model. On other words if you have a real equipment you can use any of these models to understand how real equipment is performing and that is the idea of trying to develop models to describe real equipment. So just to summarize what we are saying is what we are saying is that suppose we have a real equipment giving conversion of x corresponding to different Peclet numbers corresponding to different tanks in series number of tanks or corresponding to different recycle ratio. For example suppose let us say our conversion that is expected that is been observed from experiment is x this is the conversion. Then you can notice here if it is a dispersion model it will give us a Peclet number corresponding to this which means this particular Peclet number would be able to describe that equipment or if it is tanks in series model this particular number of tanks will be able to describe the equipment or if it is a recycled reactor model this recycled ratio will be able to describe the particular equipment given that what is the value of this k t bar which is the residence time multiplied by the rate constant. On other words if you know the residence time multiplied by the rate the residence multiplied by the rate constant if this number is given then you can tell what will be the conversion or you will be able to tell what is the Peclet number corresponding to given extent of reaction or what is the number of tanks required to describe it under the tanks in series model or the recycle ratio that is required to describe it under the recycle reactor model. On other words what is important to recognize here is that a real equipment can be described by many models and then we can choose model that we think is most appropriate for our description and three models have been described here the dispersion model tanks in series model and recycle reactor model having said this there are few point that we want to take it forward a little. Let us say we have an equipment and which we want to describe by what is called as a completely segregated model what is this completely segregated model the complete segregated model tells us that fluid elements that is entering the reaction equipment they go through the equipment and emerge another fluid element goes through the equipment and emerges and these fluid elements as per this model it is assumed that they do not recognize the existence of each other as it goes through the equipment that means that completely segregated as they move through the equipment and they mix only at the exit this is the model what happens this is how we are visualizing what happens in the equipment. Therefore if as per this assumption if this fluid element goes through the equipment and emerges without recognize the existence of the other element then we can tell that if it enters at CA0 it would undergo chemical reaction depending upon the time that it has spent in the equipment. So what this completely segregated model tells us is that if you have a fluid element 1 then it goes through the equipment starts at CA0 and reacts as per this first order model if it is the first order reaction and emerges like this another fluid element enters at CA0 but spends time T2 therefore emerges with this kind of concentration therefore the mean that we see at the exit from the equipment will be what happens to each element multiplied by the time of residence of each element inside the equipment. So this is this is where we understand what is called as completely segregated model that we each element goes through and emerges without recognize the existence of the other therefore what emerges at the exit is the value of each element multiplied by the time of residence of that element this is now if it is the first order reaction then the CA element is given by the first order law if it is the half order reaction the CA element is given by the half order law if it is the second order reaction it is given by the second order law so what is what we are trying to say here is that if it is a completely segregated model is the description that we have chosen to understand this equipment then the average that you would see at the exit is the CA element as described by whether it is the first order reaction or second order reaction or half order whatever the case may be multiplied by the residence time distribution fraction that spends the time that is assumed okay that is the that is how we understand the completely segregated model. Now we can also look at the same the same phenomena through what is called as through what is called as the completely micro mix model so the completely micro mix model the completely micro mix model what do we do we have this material entering material leaving and material reacting equal to 0 this is the completely micro mix model okay material entering material leaving and then material reacting equal to completely micro mix model once again we can solve this and find out what is x versus the reaction parameter okay so what we are saying is that whether it is completely segregated model or completely micro mix model in both cases we can describe this reaction equipment in terms of conversion versus the reaction parameter okay now when we do this for the completely segregated model you find that for both for completely segregated model and for completely micro mix model for first order reaction the results are the same on other words whether you use five completely segregated model or completely micro mix model you get the same result if it is a first order process okay now if it is a second order process we find that if it is completely segregated and completely micro mix there is a difference roughly about 7 to 8 percent and if it is order of reaction less than 1 we also find a difference once again I have shown the difference once again 7 to 8 percent on other words what is being said is that when we try to describe a real equipment by completely segregated model or if you describe the real equipment by completely micro mix model the results are not the same if the order of reaction is different from one the results are slightly different but that difference is about 7 to 8 percent and typically the kind of variations that we might expect in an experiment on other words what we are trying to say is that you can use the completely segregated model or the completely micro mix model to describe the equipment you will get answers which are satisfactory because the fact that the difference between the two models are generally between 7 to 8 percent which might be in the acceptable range of the experimental errors that we will observe just to cut this long story short what we are saying is a completely segregated model assumes that the fluid elements mix only at the exit and therefore the average at the exit is the what happens to each element as per the order of reaction multiplied by the residence time distribution that gives us the average if it is the completely micro mix model the assumption is that as soon as in the completely micro mix the assumption is that as soon as it enter it mixes it is called early mixing in complete segregation it is called late mixing in the early mixing model or complete micro mix model what we find is that the extent of reaction against reaction parameter when plotted you find that the results are not the same there is a slight difference if the order of reaction is different from one but in both cases whether the order of reaction is less than one or order of reaction is greater than one the difference between the two models are 7 to 8 percent and therefore in the range of experimental errors that we would anticipate therefore for describing real equipment we might like to use either complete segregated model or complete micro mix model.


Now in the last video we started talking about the idea of array wise operations The entire idea is that if I say for example had Two arrays and I wanted to for example add the elements at their corresponding spaces together I could just do that Python or numpy Just has in the back end built What to do when it sees an array plus an array and it's perfectly fine with that And that's where we're getting things like this kind of output Now this actually expands. It's not just our mathematical operations that we can do this with But it also works in our comparison operations And really you could experiment with all of the different types see what they do in this case You can tell that if we're doing a comparison of if Array one is greater than a two it says oh well Let me look at each element and do that same greater than comparison and I'll tell you if it's In this case true or false But what happens if I want to see if my two arrays are Say for example equal in that case that becomes a bit more difficult now if I came in and I'll actually just shrink this down a little bit Back to Just a single-dimensional Array we should see that this is going to be false, right there One is not the same as ten etc. So I shouldn't see any problems here. I See a problem now. This is not going to crash the program specifically But as you can see it is starting to freak out a little bit. It's like hey, you know You can't do comparisons in the future So as NumPy is working you may not you know whenever you watch this video you may not be allowed to do what I'm attempting to do here So how do I make a comparison? This is where we get into the idea of array wise operations The entire idea here is now if I wanted to do an operation that Just is about the entire array not the elements of the array. I need to access these Functions that Python has our numpy has built for itself. So in this case, let's say I wanted to do a comparison of x and y Now we've already seen array by itself But as you can already see, you know if spiders being generous with me there is an array underscore equal and That Asks for two arrays a you know it's saying it's a one and a two My case it would be x and y. I do the same kind of comparison now What's happening is what I am effectively doing is I'm going to take my x array and my y array And I'm passing them to some function that Python or numpy has built in the background It's you know, and then it will do the for comparison And if it stays true the entire time, then this is a an equal array now again in our case We should not see that we should see a false We see a false no error message La da da and same kind of thing if I just came in and did a comparison on One-to-one so in this case x and y. Let's see what happens here They are now in fact true And so there are tons of these operations that we can work off of so say for example This is a comparison of the element variation versus the Array version operation. So if I came in and did x times y and just to space this out a little bit If I did x times y again, that is an element wise operation. It's going to go through each element and Multiply it by its corresponding element. So in our case we see one four nine sixteen twenty five However, you know, that may not be what you're going for you may be wanting to Produce something like a dot product well in that case I'll come in in P and the same kind of thing you can already see where some of these commands are coming in and you know If you're really feeling froggy, I'm not gonna go over each one of these in a video. That's weird, but specifically ah Look at that. Wouldn't you know it? There is a dot Function that numpy has in it where I pass in an x and a y and it will do I Don't have an extra parentheses there it will do The dot product so in this case it does the multiplication. So it takes the twenty five sixteen nine Four one adds them all together and it should give you twenty up a fifty five You


Assalamualaikum warahmatullahi wabarakatuh. Hello, this is Daud Kim. So today I prepared a special video. Alhamdulillah we are muslims so we pray five times a day but sometimes we face awkward situation in outside. Before prayer we have to do udu but in outside how can we do udu? Like in public place. Is it possible in korea? So today's video is about that. Can I take udu in public in korea? Okay then let's go. So I will find some probably last room. I think it's not easy to wash. It's okay if you can wash your hands. The problem is feet. If I'm alone then maybe I can wash my feet but if someone look at me I wash my feet then it will be really awkward. I came here wearing hongdae but I don't know if I can do it. The first problem is that it's hard to find the bathroom. And the second problem is the washing place is too high so it's really awkward to wash your feet. Definitely if I wash my feet on the public bathroom but I couldn't do it. It was too awkward. It's not easy. This is the playground for this lockdown. There is a public last room. I will go there. This is the same situation. It's a bit high.  This is front of apartment. Honestly I can do this much. Because there are not many people around. So maybe I can try. I came to the department store in the end. I'm here. Luxury. Wow. I think I'm here now. I think my face is swollen. I think I can see the Muslims. There is a large market here. My plan was to go here and prayer here but it's closed so I think I have to go back. Wow the bathroom is really nice. It's really clean. I think I can try here. The washing place. I can try here. But the always problem is the food. This is too high. I'm not sure that if I wash my food in here I think maybe almost Korean think it's lude if I do it in public. I'm sure. I can try. But I think no no no. I cannot do it. As I told you it would be really awkward situation. So what can I do? I have to wash my feet right? In here I wear special socks now. I will show you. Okay so now I wear the Udu socks. So there are many colors. My favorite color is gray but today I wear dark blue. I will explain about this. Okay so this is Udu socks. This is really good because this is waterproof. Wow it's amazing. It's not wet. It's not wet.  So this is very good for traveler, students, athletes or elderly muslims or disabilities that find it difficult to put their feet on the sink during Udu. And it's really good for muslims who live in non-islamic countries like me. It's really really helpful. I use it for about once. And it's totally amazing. Yeah it's quite helpful. So it's non-ridder, waterproof, retriever and anti-order. So when you need to do before prayer, you can just wipe over the socks like this. Then your Udu will work. Wow it's not even wet. Wow it's amazing. But what's really amazing is that it's not wet at all even though it was soaked in water. Isn't it amazing? It was soaked in water, right? And the good thing is this Udu socks is certified by multiple islamic institutions already. So I'm sure that we can use it. And as for the campaign, they will give the free tasbi each order in Ramadan I think. And if you buy this product through the link on the below, on the description. And I can get certain percent of money. And after Ramadan I will donate the poor people. It's called Sadaka, right? Sadaka? Zakat. And I've heard that many Muslims and scholars also use Udu socks already. So there's no reason to not use this. Udu socks. Please use it a lot. Thank you for watching my video. Take care and be safe. Alhamdulillah. Thank you. Happy Ramadan. Ramadan Mubarak. Ramadan Karim. Bye.


Hey everybody, this is Brett with Summit Auto and doing a little different lot walk today. It is Friday, January 5th, 2024. Hope everybody had a great holiday season and finished 2023 strong. We had a good year and I'm going to be doing a little bit of a review of our year from last year for sales, details, videos done, YouTube channel, just a little bit of insight into what happened last year. It was a good year. It wasn't the best year. Obviously, during COVID it was just insane, but it was a pretty good year yet last year and I'll get to that video that's going to be coming out later today, so definitely check it out. We're going to do a lot walk. I only have three vehicles because we took two trains in yesterday and I got one buy in with the holiday season. Buys were kind of slow coming in, but I'm going to get crushed next week, I just feel. Resume the lot walks consistently next year or next week starting Monday. But anyways, here's what we got. These vehicles will be listed in the description below. There's only three, but really, really nice trades. Check this out. This is a Chevy. I'm going to be videoing later today. This is a 2016 or 17 or probably a 15. Anyways, we just got that through detail. I finished up touching up a little bit stuff on that, but check out this Canyon. This is a 2022 GMC Canyon, 84 crew cabs, got the V6 in it, it's got heated leather seats, the backup camera, really nice gator tonneau cover, spring and bed liner. Good tires. This one has 20,000 miles on it and the interior don't mind the floor mat, but the interior is just pretty much perfect, very, very clean, non-smoker, nice tint on the windows and the paint is like new. So really a nice trade on this one. We're going to get that rolling today. We'll have pictures by the end of the day for sure. This is a one-owner clean title history, clean car facts from right here in Fond du Lac, Wisconsin. This is a local one-owner trade. It was bought new from Summit. Actually, we used to be called Holiday Chrysler Dodge Jeep and Ram, and that's, we were still Holiday at that time when this Wrangler was purchased from us. So it still has our old sticker on it. But this is a 2015. It's got about 52,000 miles, just a hair under 52,000 miles. It's a Sahara. It's got the heated leather seats. It's got the nice touchscreen radio, 18-inch polished aluminum wheels. And like I said, one-owner, very, very clean. I didn't see any dense dings, no major scratches or anything like that. The paint's in really nice shape, so this is going to be a very, very nice piece of inventory for us. Look at those seats. They look brand new yet. Just a really nice, really nice Wrangler. I'd probably venture to say that this is our deal of the day, if not that GMC AT4. And then I got a Ram 2500, a little bit more traditional inventory that we have. There's an F350 that's already through the shop. That's a new truck. Or actually, that's a Trayden. And I got to get a video of that. Hopefully we got the airbag light fixed on it. That's a truck. I just did it. That's a 2022. 2022. No, this is a 2023. I just did a video on last night. There's a Wrangler. I'm going to be doing a video on later today. There's a Tundra we just did a video on last week. This is a 2022 Big Horn with leather. This is a really nice truck. It's all through the shop. Just did a video on that. That's going to be on the YouTube channel later today. And then this is the 2021 Ram 2500 that we just got in yesterday. This is a Big Horn level A. And really nice truck. It's got the heavy duty snow plow prep package, the 20 inch polished aluminum wheels, the 4x4 off road package. And this one has roughly about 30,000 miles on it. So really nice condition. And we're going to get that rolling today as well. I wanted to get the video before my guys start grabbing vehicles to clean up here. So anyways, I hope everyone is having a good start to January. It's been a pretty good start here. I think we got maybe nine or 10, probably about 15 sold, used, seven delivered. So we got pretty good start to the month here. And like I said, stick around for the update for 2023, the year end review video for our dealership as far as sales, details, YouTube channel, everything like that. Got some great insights there. And if you want to see all these vehicles once again right up there, summitauto.com. All these vehicles are listed with full descriptions, pictures, and most of them have videos right now because we are super caught up on our detail process. So almost all of our used inventory has videos now. Anyways, thank you so much for watching. Remember to like, subscribe, and share. Click the links that are going to be popping up here in just a second. And let's get 2024. Make it your own and let's go.


Good morning or afternoon, whichever it is, I live in dog years as mayor, so it goes rather quickly. So, today, I'm holding a hearing in bill signings that support our small businesses that fulfill the commitment and promise that I made on the campaign trail, we're actualizing it today with these important assignments, small businesses we hear over and over again, they are the heartbeat of our community and for far too long they've been overlooked. We are here to really change that conversation and lift up our small businesses by these important pieces of legislation or bills that we're signing. A few months ago I outlined my blueprint for economic recovery and I spoke about restart in our small businesses and our large corporations, they go hand in hand to improve our economy. Later on, a plan to strengthen our commercial corridors across the five boroughs, it is so important that what our bids are doing on our local communities, particularly as you see more and more businesses are moving into neighborhoods, those neighborhoods were often overlooked. We are pleased with the plans that we're doing to really strengthen these small businesses and all of our agencies are aware that we're zeroing in on how do we keep doors open. Historically, you got agita. Every time an agency walked into your business or small business in our city, those days are going to end. We must figure out how we keep the doors open and that's my commitment and promise. And I promise that I would expedite the creation of business improvement districts in the city. You heard this saying over and over again, promise made, promise kept. Today we're signing one of those promises into existence. Intro 47 creates the Castle Hill Business Improvement District in the borough of the Bronx. And so if you're from the Bronx, you'll understand when I put up the X. Intro 73 establishes the West Village Business Improvement District in the borough of Manhattan. So it's so important to do so. We are, what's your symbol? We are sure that the bids launch this July in time for the start of the fiscal year. So businesses in Castle Hill and the West Village can thrive. We cannot have an economic recovery unless our neighborhoods recover at the same time. It must be the equity that we have been looking for for far too many years. And this is a huge win. And for all those who have advocated for this, we heard you were responding. And that is how government should work when you get stuff done. The law will reinvent our city and our economy today, tomorrow and generations to come. And turning to, which is an important bill, many of the advocates have pushed for a long time, and I want to thank the commissioner for your advocacy on this issue. Intro 134, which will strengthen our pay transparency laws and clarifies the law applies to employees who are paid hourly or through an annual salary. We heard far too often how this law was not clear. And as Justin Brennan walks in, I noticed it was something he pushed for for a long time. Congratulations to you, the finance chair. This means that every listing for a job that is paid an hourly wage or an annual salary must disclose what the minimum and maximum salary wage is. This is an important bill. And advocates have pushed for it. And Assemblyman, what are you doing sitting there?  And what you got, two earrings in one, I got to get my other earring, man. This means, this is an important meaning for the advocates who have pushed for this. Employers who promptly submit, this was the piece that was important. We were not trying to be punitive. We were trying to change the mindset of those who were not listing the minimum and maximum salaries. So the important part that we were able to come to and resolve, employees who promptly submit proof of current, their first violation will not be subject to civil penalties. But we're not going to play the game that you could keep saying, oops, I forgot to do so. No. We're not going to use that to state, if you do it again, then we would take those actions to send the right message for any future violations. This classification, make sure that the law works for both workers and employers. And so I want to thank all who are part of bringing these bills to the signing. Councilmember Williams, Councilmember Brennan, Councilmember and Chair of the Economic Development Committee of Councilwoman Forrest, Councilmember Farrell-Lewis, Councilmember Eric Botcher, Tony DeRosa and Brooks Scowley, Chair of the West Village Bid Steering Committee, and the Castle Hill Bid Steering Committee as well. So now I would like to turn it over to Councilwoman Williams, the sponsor of 134, to say a few words. Thank you. And thank you, Mayor, for holding this very important bill signing, and I also just wanted to acknowledge Commissioner Palma, whose agency will be tasked with implementing this important measure. Again, I'm Councilmember Natasha Williams, representing the 27th Council District in Southeast Queens, not the Bronx. It's official. And as I stand here before you today for the signing of my first bill, this is a significant moment because it expands on landmark measures which were critical to the fight in economic equity. This work would not have been possible without the value partnership of both the advocacy and business community. My colleagues here at the Council, as well as my co-sponsor, Councilmember Justin Brennan, and of course our history-making speaker, Adrienne Adams. With this legislation, we are leaning on Shirley Chisholm's words. Everybody is getting a folding chair, so no one has to worry about not having a seat at the table when it comes to pay equity. To my small businesses, these changes were common-sense amendments, and this will ensure that you do not face undue harm. So the advocacy community and the unions who fought so hard for this measure let us use this to build up the moving path of enclosing the deficit of $10,000 that we as women share or, in contrary to what our male counterparts make on their salaries. For those who may have missed the opportunity to hear the adjustments we've incorporated and conveyed during our prior public hearing, I'm excited to reshare what our signed legislation really means. And I know the mayor mentioned a lot of this already. So we have clarified that jobs paid in hourly wage be subject to salary transparency requirement. We have also removed general notices that state employees can hire without reference to a particular position. We insured that nearly all virtual jobs performed in New York City or for a New York City employer can be covered under this bill. Lastly, we have worked to keep an extension to allow viable time for small businesses and our agencies to comply with this new law. Seeing the foundation to enable women to be at a space where they can truly compete with men means a lot to me. And this moment makes me truly value even more the hard work that it took to galvanize women across this nation, NDC, as a national organizer of the Women's March. In closing to all my women out there, you deserve this moment. As a black woman standing before you who recognizes the hurdles that we have constantly absorbed because who we are, I understand you and I see you. But I am a conscious optimist and I believe our future looks bright. I look forward to working with you all, the mayor's office and my colleagues as we ensure that we continue to build past this point and beyond. Thank you. Thank you. Let's say. Thank you for that. We needed that and want to also bring on Councilman Eric Botcher. This is about the West Village bid. I am so happy today that after many years of effort, we are witnessing the creation of a business improvement district in what I call an overloved part of the village. The 7th Avenue South Corridor, parts of 6th Avenue South and the side streets. This area gets a lot of foot traffic from residents, tourists, commuters. And that's great, but it generates a lot of litter, a lot of wear and tear and other issues and we've really struggled a lot for many years to keep up with that. And the small businesses on this stretch have also struggled historically. And bids provide help on all these fronts. They provide supplemental sanitation services, beautification and landscaping, social services for unhoused New Yorkers and they are a great partner to elected officials in solving issues as they arise, which is why I'm a big fan of bids and to all my constituents watching. If you would like a bid in your neighborhood, I will support you and help you. In Hell's Kitchen, for example, I feel strongly that 9th Avenue and 10th Avenue could benefit greatly from bid coverage, also Chelsea as well. And the residents here today have shown how it can be done. One of the unique things about this West Village bid is that it came from a true grassroots effort. It started with a meeting in Brooke's schoolies living room a few years ago and Brooke and her fellow residents hit the pavement, reaching out to thousands of property owners in the proposed bid area and presenting to the community board, block associations, hosting community presentations and more than once they were told that it could not be done, that it wasn't going to happen. But here we are and soon we're about to see the creation of West Village bid and we're going to see real improvements in sanitation and quality of life in the West Village. Thank you, Mr. Mayor. I want to thank my staff, Patrice Comerford, Sean Coughlin, Wynn Pariasami, everyone in the council and at SBS for making this happen. And thank you, Brooke, to you and to our neighbors for all that you're doing for our community. Thank you. Thank you. Well said. We have a different model here from it can't be done to it will be done. That's the way we have to look at it. We're going to bring up a council member, the chair of the Economic Development Committee, a council member, one of my favorite people. Councilwoman Amanda Parias. Thank you. I am, hi everyone, council member Amanda Parias is previously mentioned by the mayor. I'm thrilled to join Mayor Eric Adams today as he signs these critical pieces of legislation into law. These bills have a huge impact on New Yorkers across all five boroughs with open and transparent salary range disclosures and also in my own district with the creation of the Castle Hill bid. I look forward to supporting our employers in the successful implementation of intro 134. I am a co-sponsor. Ensuring all businesses have the time and resources to find the right talent we have here in New York City. This is an exciting moment for black and brown New Yorkers, both in our businesses and whom are looking to bring their skillset to the workplace. Our communities have so much to offer and building up one another in our neighborhoods is really the only way to improve all of us. Additionally, and why we're really here today. I'm excited to see intro 47, the Castle Hill Business Improvement District, come to fruition after the years of organizing. Truly, the steering committee headed by Tony DeRosa and our leadership at the Westchester Square bid, and I'm super lucky to have one of my predecessors, former council member Annabel Palmer, who really have worked tirelessly over the years to bolster one of our community's most important commercial corridors. Coming in this year, I'm proud to be able to close the organizing chapter, pass through the agencies with the help of SBS, and get this passed in the council. Today's signing is meaningful as it helps start the real investments going to be made in Castle Hill that it truly deserves. I look forward to working with Mayor Eric Adams, my colleagues in the council, and my local businesses to pass more legislation that focuses on equitable recovery, supporting small businesses, and most importantly, protecting our hardworking New Yorkers. Thank you so much. Councilman Farias is all over the place with us. Is this your second bill with us? I thought you went earlier. We're not your mob, you know? And I know Councilman Justin Brennan, please say a few words. Councilman. Thank you, Mayor. The salary transparency bill is a really big deal, and as they say, as goes New York City, so goes the nation, it's important that we got this right. I was the co-sponsor of the original bill, and we did something pretty groundbreaking. We brought everyone to the table and heard everybody out. We're ending the era of my way or the highway politics. We're bringing everyone in, everyone around the table led by my colleague, Natasha Williams, to really get this done. The business community, the small business community, the advocates, we got together and we didn't come up with a compromise, we came up with a better bill. And that's what this is all about, getting this right. This is the first in the nation law. We already have people from other states reaching out asking for the text, because they want to steal it and do it in their town. So that's why it's so important that we get this thing right. And I remember when I first became a lawmaker, I wondered what was there left to do? It feels like, and how many hundreds of years, it seems like everything has been done before. What could there possibly be left to fix? And then you find that there's a lot of stuff that still needs to be fixed. But you don't want to walk around with a handful of solutions looking for problems. You don't want to have the problem come to you and then find a way to fix it. And that's what we did here with this bill. And we're confident now that you're going to see in other cities and states across the nation, they're going to be copying what we're doing here today. So, thank you very much. Thank you. And I'm talking about fixing things. No one does it better in Brooklyn than our Councilwoman Farrell Lewis. Good morning. Good morning, Mr. Mayor. I know you love me. So, first, I just want to congratulate my colleagues, Councilmember Williams, Farias and Batra on the first bill signing. I'm so proud of all of you. I'm a co-prime on intro 47. And I think this mayor got it right. It's the rebirth of small businesses in New York City. His plan for the recovery of all small businesses is the way to go with these bids. So, I'm really excited about what's coming in Castle Hill as well as Middle Village and look forward to seeing as well as Middle Village and look forward to continuing to support the mayor's plan to rebuild New York City and our small businesses. Thank you. Thank you so much. Please come say a few words. Let me sneak it up in the house. I know many of you are wondering what the hell is a state lawmaker doing in City Hall. But this really is a full circle moment for me personally. For those of you who don't know, my career started here in City Council. Right here, former councilwoman Ann Bopama. And I tell folks, literally the first day that I started in government was working on the Castle Hill bid. First day in government was walking the streets of Castle Hill, talking to business owners, meeting Tony, meeting Yasmin, and talking about how we can improve that area. That was once so fruitful, had so many fruitful businesses, people walking the streets, it's kind of falling to disrepair. But now today, thanks to our new councilwoman, Fadia, thanks to the mayor but now we're what? Five months into administration and this bid is done. So I want to thank all of you who have worked on it, thank SBS, really thank you to Yasmin as well, Tony, Annabelle, Amanda, everyone who's worked on this bid. But this is a full circle moment for me and I'm just proud to be here to see it done. Thank you. Love it, love it, love it. So we want to now open and invite the public for comment. Okay, don't need to do that. So I guess I'm going to I got a couple of pens here. You know, signing a team so I can get this right. We're my lawyers. Where am I signing exactly? Down in the front please. I'm sorry. I got my, you know, it's never known how much we need a pinky. Okay, thank you. I'm going to take my bandages off for the first time. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you so much. To I'm going to say one word for my auntie. I'm going to say one word for my auntie. Since you started from the bottom, now you're here. I love you. Have a good one. Thank you. Thank you. Good job. Good job. Thank you. Thank you. Thank you so much. Thank you. Thank you. Thank you.


Hello and welcome to this course on program analysis. This is a course at the University of Stuttgart. Usually it's a master level course, but if anyone else wants to just watch this or maybe participate in the course, even if you're not at the University of Stuttgart, you can of course do that. This course is going to be about program analysis. What is that? Well, we'll see in a few minutes, but in essence, it's the technique underlying many of the tools that software developers are using every day, tools like compilers and for example, bug detection tools. In this very first episode of the course, we'll look at some basics. We'll talk about what this course is actually about. And I'll also go through the organization of the course so that you know what to expect. Before doing any of this, let me just briefly introduce myself and my research group. So my name is Michael. I am a professor at University of Stuttgart since about a year now, so since September 2019. And before joining the University of Stuttgart, I've been at a couple of different places. So at some point I started my computer science studies at Theo Dresden, then went to Paris for two years to also study engineering and then joined EPFL at Lausanne for my master thesis. I did my PhD at ETH Zurich in Switzerland and then went across the Atlantic to visit UC Berkeley for a postdoc. I then came back to Germany where I've been an assistant professor at Theo Darmstadt, then went another time to sunny California to join Facebook for a sabbatical. And since about a year, I'm back in Germany as a full professor at the University of Stuttgart. The research group that I'm heading here is called Software Lab. So we are interested in all kinds of tools and techniques to make software better, where better can mean a couple of things. So it can mean that software is becoming more reliable. For example, because you eliminate bugs, it could also mean that software is becoming more efficient because you, for example, identify parts of the program that are not as efficient as they could be or should be. And finally, it can also mean that you're making programs more secure because you eliminate vulnerabilities that attackers could otherwise exploit. To do this, we are working on techniques for program testing and for program analysis, which is pretty much the essence of what this course is also about. And we're also very interested in machine learning where we apply some neural networks and other deep learning techniques, for example, to also analyze software. We always have thesis and job opportunities in my group. So if you're interested in these topics and want to dig a little bit deeper, then feel free to just contact me by sending an email. This very first lecture of the course will consist of three parts. The first one is the one that you're currently seeing where we'll look at what this course is actually about, why this is interesting to you, and also how it can help you even beyond the knowledge gain and the academic credit that you will get for it. Then the second part will be about the organization of the course. So I'll talk about what different parts this course is actually composed of, how the grading works and what to know about these different parts. And then in the third part of this first lecture, we look into some of the basics this course builds on, so things like grammars, abstract syntax trees and control flow graphs, some of which you've probably already seen somewhere, but this is just to make sure that everybody is on the same page. All right, so let's start with the question what this course is actually about. So the title is Program Analysis and this course is about program testing and analysis. If you've ever developed a piece of software and I'm sure you have if you're attending this course, then you have already done some of this while you were developing software. So what you probably know is a manual form of testing and maybe a semi-automated form of testing and also a manual analysis of programs. So what do I mean by that? By manual testing, I mean that you're just running your program, you give it some inputs and see what happens and see if it's behaving the way you expected. And by semi-automated testing, I mean using tools like JUnit or maybe Selenium where you can test particular units of your software or maybe test an application through its user interface. By manual analysis of programs, I mean things like inspecting your code. So not running it, but just looking at the code and trying to understand what it's doing and why it's maybe not behaving the way you want it to behave. And there also mean things like interactive debugging where you're stepping through your program looking at intermediate states to understand why it's doing what it's doing. Now this is not exactly the focus of this course, but it's related. The focus of this course is on automated testing and automated program analysis. So the idea is that not you as a human have to look at and analyze the program, but we're looking at tools and techniques that do this automatically and then understand something about this program, for example, by pinpointing bugs or vulnerabilities. So why do we need all of this? Well, first of all, the main problem is that software has bugs. Every piece of software that is non-trivial and interesting has some bugs. So for example, there was a book by Microsoft a couple of years ago that mentions that there are between 0.5 and 25 bugs per 1,000 lines of code in delivered software. So this is not some prototype that someone has hacked together, but it's actually delivered software that still contains a lot of bugs. Now, these numbers are per 1,000 lines of code. Real programs often have thousands, tens of thousands, hundreds of thousands, sometimes millions of lines of code. So this is actually a pretty high number. Why is that? Well, the problem is that bugs are pretty hard to find. So there has been a study that looks at bugs in the Linux kernel. So a piece of software that many people have looked at, that many people are running and where you would assume that there shouldn't be that many bugs, but even in this pretty solid piece of software, it still takes on average 1.5 years from the point in time where someone introduces a bug to the point in time where this bug is actually found and then it takes again a bit of time until the bug is actually fixed. So bugs are pretty hard to find. So it would be good if you had techniques that help with this task automatically. Finally, all of this would be no problem if bugs would be harmless, but actually bugs can cause pretty serious harm. So here are just three examples, some of which you may already have heard about. The first one is the Ariane 5 space rocket that unfortunately did not really make it into space because due to a software bug, it exploded before it really reached space. In the middle you see a satellite image that shows the Northeast blackout, which was a huge power outage that happened in the United States and Canada a couple of years ago and that left millions of people without electricity. Again, due to a software bug and on the right you see an image about a Thera25 radiation machine. So that's a device that is supposed to emit doses of radiation for medical purposes, but unfortunately because of a software bug, it was emitting too much radiation, which then had unfortunately the opposite effect of what it was intended to do. So it was actually threatening the life of people. So now that you're convinced that bugs are a problem, let's have a look at one possible way to address this problem. And this is program analysis. So program analysis means the automated analysis of the behavior of a program to, for example, find programming errors or to optimize the performance of a problem or to find security vulnerabilities. So the term bug here basically means everything that happens in a program that is not supposed to happen. So it can be just a traditional programming error where the program is simply not doing what it's supposed to do. It could also mean that a program is much slower or much less efficient than it is supposed to be. So that an app, for example, becomes unresponsive or it could also be a security vulnerability that allows an attacker to exploit the program and gain some privileges that that attacker is not supposed to have. Now what does program analysis do to prevent these situations or to at least detect these situations? Well, usually if you have a program then you feed an input into this program and as a result the program behaves in some way and produces some kind of output. Now what you wanna do in program analysis is to gain some additional information about this execution of the program. So for example, you want to see that in this execution some misbehavior was exposed or that some vulnerability was exposed. Ideally you do not just want to do this for one input that leads to one behavior and one output but ideally you wanna do it for multiple inputs maybe even all possible inputs so that you can then reason about all possible behaviors and all possible outputs of this program and in some cases you may be even able to say that some class of bugs may not occur in this program at all. In program analysis there are typically two ways to approach this problem. One is static analysis, that's what you see here on the left and the other one is dynamic analysis, that's what you see on the right. So in static analysis the basic idea is that you're analyzing the source code or byte code or maybe binary of a program but you're not really executing it. Instead the analysis reasons about the code and typically tries to consider all possible inputs that this code could have and that means that it's over approximating all the possible behavior of the program. We'll see in a minute what exactly this over approximation really means but basically it means it's considering more behavior than is actually possible. On the other hand dynamic analysis executes the program and then analyzes a concrete execution of the program and that typically means that it is considering only one input so the current input that is given to the program and that also means that it's under approximating the possible behavior so it's not looking at all the possible behaviors but just the behavior triggered by this one input. To give you a few examples of tools or techniques that you've probably already used. So an example of aesthetic analysis is everything that happens in a compiler. So compiler is for example type checking your code or it's looking for particular kinds of errors and this is aesthetic analysis. The same is true for lint-like tools so lightweight bug detection tools which for example maybe just executed by your IDE and highlight a couple of bugs in your code. As examples of dynamic analysis that you may already have used there are automated testing techniques. So if you have anything that automatically tests an application for example the monkey testing tool for Android and then this is actually a dynamic analysis and as another example there are profilers where you look at an execution and try to understand which parts of the code are fast and which parts of the code are not so fast so that you can then optimize that code. So let's make these concepts a little bit more concrete by looking at some examples. So what you see here is a piece of JavaScript code that calls the math.random API to get a random value in the range between zero and one including zero but excluding one. And then we have this variable called out which eventually will be printed to the console down here and depending on the value that is returned by math.random we may assign a different value to out than yes. So if r the value returned by method random is smaller than 0.5 we will say out will be zero sorry will be no and if r is equal to one then we will assign maybe to out. So now the question is what are the possible outputs of this program and at this point and also other points in this lecture I'll ask you to stop the video for a second and maybe think about it yourself before you continue. So what are actually the possible outputs of this program? So now that you have thought about an answer let's have a look at what a program analysis might say. So one answer a program analysis might give is an over approximation which could say well the behavior could be yes or no or maybe. So it's basically giving all possible outputs that seem to be possible on one of the different paths that you can go through this program and based on the limited knowledge that a program analysis may have about what math.random is actually doing this sounds like a legitimate answer because the program analysis may not know that math.random may not return one so we will never take this branch and this path is actually infeasible and because it does not know about that it believes that out could be maybe and therefore it's giving this over approximate answer of yes, no or maybe. Another possible answer that a program analysis could give is yes. So in this case it would under approximate the possible behavior for example by executing this program once and seeing what happens and it sees oh the output is yes so it's telling you well the possible output is yes. And finally there's a third option and this is what you would like to ideally get from a program analysis and this is what is called sound and complete answer which would be yes and no because these are exactly the outputs that this program may actually produce based on the different path that it may actually take. So given that this path down here is infeasible yes where we do not take this if and no where we actually do take this if are the two outputs that may actually be produced. Now to understand why most program analysis do actually not give a sound and complete answer but either under approximate or over approximate let's have a look at a second example. Again this is a piece of JavaScript code and again the code is calling the math.random function and then it takes the return value obtained by this call, multiplies it by two and then outputs the result of this multiplication. Again the question for you first is what are the possible outputs and again please maybe stop the video for a second and think about it. And then we look at the possible outputs that a program analysis could tell you. So again one way to address this problem would be that a program analysis gives an over approximate answer. For example it could say well the output could be any value. This would be the case if this program analysis does not really know what math.random is returning so it does not know that the values are in this interval and therefore it just says well it's some value multiplied by two so again some value that I don't know anything about so I just can tell you that any value is produced. Again there could also be an under approximate answer which for example could be any value in this range of zero and two. For example the analysis may execute the code once and then see that the output is 1.234 and it will give you this answer as a possible output which of course would be an under approximation because it's missing some other possible outputs. Now could we get a sound and complete answer here? Well in practice that's not really possible because it would mean the analysis has to give you all the possible outputs and in this case there are practically infinitely many values in this range of zero and two that's the analysis that the program may actually output and exploring all these possible outputs and enumerating them is practically impossible. This is actually the case for most real world programs and the reason is not just that there are many different values the reason usually also is that there are many different paths including potentially infinite paths because of loops. Now let's have another look at this question of under approximation and over approximation by looking at things a little bit more abstractly. So let's say we have a program called P and we're given inputs to this program and let's denote an input by I and then what the program will do is to have some behavior which we call P of I. Now let's look at the space of possible behaviors that the program might have. So let's say there's one behavior if we feed input I one into this program let's say there's another behavior if we feed I two into this program and then let's say there's yet another one which is P of I three. Now what you would like to ideally know about is this set of possible behaviors. So this blue circle here shows the set of all possible behaviors and this is what we want from a program analysis ideally. Now there are different reasons why we can't get this and you've seen one we'll see more throughout this lecture and what you typically get in practice is either an under approximation or an over approximation. So an under approximation would mean that we only get a subset of all these possible behaviors. Let's say this red circle here which includes the behavior triggered by input two and input three but not the one by behavior by input I one. So this is an under approximation and this is what you typically get if you're for example, testing your program. So if you test the program by executing it with some finite number of inputs then you do not see all behaviors. And the same is what you get from most dynamic analysis because most dynamic analysis just reason about the execution that they are actually seeing and this means they can only look at a finite number of executions and then typically miss some behavior. So what's the problem here? Well there may be some behavior in here which is one of the possible behaviors but that is not seen by the under approximation. And in practice this means you could have false negatives which for example could mean that you're missing some bug. So if you're testing your program but you've missed a bug during testing this is exactly what is happening. And then the other option not under approximation is over approximation where you consider more inputs than those that are actually possible in the program. And this is what most static analysis are doing. So this sounds like a good idea but of course there's a problem with behaviors like this that are outside of what the program can actually do but that according to some over approximation are possible. And if you have a tool that is based on over approximation then this tool may report false positives which for example, if your tool is a bug finding tool means that you may have some benign warnings that look like maybe there's a bug but then if you look more closely it's actually something that cannot really happen during any of the possible executions of this program. All right, so now we've talked about static analysis and dynamic analysis and the pros and cons that they have. Let's now talk about the third kind of technique that we look at in this lecture and this is test generation. So test generation is something that can be seen as an enabling technique for dynamic analysis because a dynamic analysis requires some input to actually run the program. And what test generation is doing is to automatically create these inputs. So instead of needing a human that is using the piece of software or maybe someone who writes inputs for this program a test generator is actually automatically producing inputs. So there are examples of this on all levels of using a program. So for example, you can think of unit level test generators where an input typically means a sequence of method calls that could for example occur in a J unit test and you can of course generate these inputs and we look at some techniques to do that. You can also think of this at the UI level where you have some application that has a user interface and an input for example is a sequence of events triggered on this user interface. For example, you can think of some Android app where you're automatically clicking on particular locations or swiping and so on and the sequence of these events is also an input that a test generator could produce automatically. And finally, you can also think of other kinds of programs. For example, if you have a compiler then the input to this program is a program itself. So in order to fast test or randomly test a compiler a test generator would automatically produce programs that are then given to the compiler to see if it behaves correctly. Finally, let's come to the question how all of this helps you. So one thing you'll get out of this course is of course some academic credits and some additional knowledge of things you didn't know before. But beyond that, I think there are three very concrete outcomes that help you in your work as a software developer. One is that after having taken this course you'll be able to use program analysis tools which will eventually help you to improve the quality of your code. So you'll know more about what kinds of tools actually exist and how they work under the hood. And this will help you to use the right tool so that you have to spend less time on manual testing and manual program analysis. Second, understanding program analysis actually also makes you a better developer because you will get a better understanding of program behavior in general. If you know how a program analysis is reasoning about code then you also will adapt some of this reasoning to reason about your own code and then prevent some errors that a program analysis may have helped to find. But because you know how the analysis would do it you just avoid this error altogether. And finally, at least some of you will hopefully also create their own tools. You'll do a little bit of this in the project that comes with this course but even after the course some of you may move on to some position where you're actually working on program analysis tools because large companies typically have people who do this to solve some custom problems that only they have or to just advance the state of the art of existing tools. All right, so this is the end of this very first part of the first lecture of this program analysis course. I hope you know what program analysis is. You know why it is important and you hopefully also have an idea of how it can help you in your life as a software developer or maybe as someone who actually develops these analyses. Thank you very much for listening and see you next time.