 You can follow along with this presentation using printed slides from the nano hub. Visit www.nanohub.org and download the PDF file containing the slides for this presentation. Print them out and turn each page when you hear the following sound. Enjoy the show. So let me get started. So this is lecture 19 on numerical solution of transport equations. As I have mentioned to you already that there are essentially this 3 or 5 transport equation depending on how you count it. One is Poisson equation, two continuity equation and each continuity equation is complemented by this drift and diffusion component, these 5 equations and in the last class we discussed how to solve the problem analytically. If you remember the Schrodinger equation solution of it, we did it in two ways. One is analytically with sin x and cosine x or e to the power alpha x e to the power minus alpha x, we did that, matched the boundary conditions and solved that and in many cases as I said is very useful to be able to approximate the problem and solve it quickly in the back of the envelope in 5 minutes and that is how historically it has been done before the days of computer. But fortunately or unfortunately we have big computers today and that allows us to solve the problem with very little approximation and as a modern student, a student now, it will not be appropriate if you don't learn a little bit about how the numerical solutions of these equations proceed and you actually have already been using it through nano hub. So I want to understand, I want to show you what is the machinery behind the program that does your calculation. When you hit return on a problem, it does a bunch of things, you see a number rolls down on your screen and then it is trying to do something and eventually it gives you a result. What is it doing in the background? It is actually solving those five equations and I will try to give you a flavor of it. I cannot do a full justice, a flavor of it that what is going on in the background. I will talk about braiding and finite differences, talk about how to discretize equations and apply boundary conditions very similar to the Schrodinger equation, very similar. So you will see many, many similarities between these two and then I will conclude. The reference, this is not here any book that I can refer to but Professor Lundstrom has a primer on semiconductor device simulation on nano hub.org. You can take a look many of those features, I have simplified it but essentially comes from there. So you remember the first equation is the Poisson equation and we will show that a graphical solution of this is called drawing a band diagram. You will see people are saying can you draw me a band diagram of your, you have invented a new device let's say and somebody says can you draw me a band diagram, let me see whether it works. He is asking you to solve the Poisson equation and you can do it in five minutes, easy, less than five minutes for any problem whatsoever. And then there will be a bunch of equations, continuity equations for electrons and holes and we will solve it in various approximations and in the last class we already solved a problem if you remember in the diffusion approximation where drift was not important, the electric field was very small and then we also involved minority carrier transport because it was a small perturbation on the majority p-dote material, a few electrons there and we tried to solve that problem that allowed us to simplify the recombination term. If we tried lots of carriers we couldn't do the simplification of the recombination term that we did last time. So we are already doing it, I will also show you how to do ambipolar transport when both electron and hole numbers are comparable. So in that case the approximations that we made in last class doesn't really hold and I will show you later on how to handle those cases also. But today my goal is not analytical solution but to solve the numerical solution of this problem. Now generally people write it in two sets of equations, one is that they write conservation laws, conservation of fluxes, this is the first thing is Poisson equation and the second and third is continuity equation, what is the difference between this continuity equation and the one that was in the previous slide, do you see, steady state, I am simplifying it, there is no d and d t term that I have written here. So steady state you remember right, all the fluxes essentially balance each other so no net charge change in net charge in any given volume. So I have just done a simple thing because transient involves a little bit more complexity so I want to avoid that and then of course you talk about the various relationship where physics comes in. The left hand side you can write it 2000 years ago, I mean there is nothing fundamental about it, flux coming in, flux getting out, it could be water, it could be electrons, it could be anything from the left hand side. The right hand side is where physics comes in because right hand side you have to find an expression for p and n, you have to learn about drift and diffusion and in the diffusion coefficient and in the mobility you will have to know about this effective masses and the scattering time, that is why all the physics is hiding in this in the right hand side. The left hand side are general conservation law. So let us try to see how to solve this problem on a computer and the generation recombination is just another term. Now how do you solve it, the first thing is what do I solve, what do I solve, what is the unknowns in these equations. Now do you see what the unknowns could be, first of all there is 3 equations and there are actually just 3 unknowns, what are the unknowns, electron concentration, hole concentration and electric field or potential, either one would be fine, electric field or potential, these 3 things. Do you agree, the first one the Poisson equation involves electric field on the left hand side, on the right hand side it involves electron and hole concentration. So those are 2 unknowns. The second equation, electron concentration what does it involve, well again electron concentration of course the continuity equation that is right but what about the recombination generation that involves electron not stock to the holes, so that equation involves holes and also the drift term and the diffusion term that involves the electric field component of it also right. So therefore you can see that there are essentially 3 equations and 3 unknowns and the 3 unknowns are potential, electron and hole concentration but not just 3, 3 at every point and if you have a lots of point within the device then it will be concentration will be going up and down and so at every point you will have a corresponding solution at the end of the day. So we will try to see how to calculate these numbers in a general way, in a simple way and many of you may already have seen it in different context. Why is it coupled? Because you can see the first Poisson equation the solution of that will give me the electric field but the electric field now determines the current but as soon as it determines the current you can see it sloshes around the electron and hole concentration. That changes the Poisson equation. So these have to be solved in a coupled way until we have a self consistent solution everywhere. This I have mentioned and I want to emphasize it again because many of the equations that you will be learning may not apply in your research career in the sense that the conservation laws will always remain with you 50 years from now at the end of your research career maybe it will stay with you but the transport equations you will see this is already changing in a significant way. Professor Mark Lundstrom talks about ballistic transport when there is no scattering. Professor Shupriya that talks about when quantum interference is very important at every point. So we work on non random material transport through random material where many of the assumptions fail and therefore the transport equation will change the drift and diffusion the form of it will change but the conservation law will always remain the same hopefully Now let us talk about grading and finite differences. So how do I do that same way I did it in the Poisson equation not Schrodinger equation the same mechanics same way. So what should I do let me take a device that two sides on the left and the right side let me assume those are contacts meaning that is where I will attach my battery. So when one side may be grounded connected to zero potential the other side of the potential depending on whether it is a plus voltage or minus voltage it will be at various potentials. Now in between I do not know how the potential varies I do not know how how the electron concentration varies that is something I will have to find out. So the first job is to grade it, grade it meaning connect the first and the last point between the two contacts and essentially divide it into many segments. Now here I have drawn each segment to be the same this is called uniform grading uniform grading essentially allows this region to be segmented in uniform sections but it need not be uniform in fact the problems that you are solving in your computer for this homework if you just tried uniform grading it would have been too big a problem many times to solve the problem accurately so many times non-uniform grading is essential for practical solution but for conceptual reasons here I will just assume this to be uniform. What is this A? A is not atomic dimension it is not 5 angstrom it depends on the problem if your whole thing is about 100 micron let us say then you would probably grade it maybe in a hundred small segments or maybe 200 small segments so a micron or a tenth of a micron that would be typical size so that you can use effective mass at every point. If you try to grade it on the atomic scale of course the notion of the effective mass is not there anymore so you should not try to do that you should have grade it a little bit bigger in size okay. Now every point I will mark it as I node I and the node I has an unknown V sub I is the potential at that point N sub I and P sub I are electron and whole concentration at that point and in the beginning these are all unknowns every point I do not actually know anything about this only thing I know is on the boundaries I have attached a battery of a given voltage so V sub 0 I know because that's the battery and V sub N or N plus 1 on the other side that I know because that point is grounded apart from these two information I know nothing at the end of the day I should be able to calculate all this through the help of the three equations we talked about so in order to do that I need an approximation just like we did in the Schrodinger equation an approximation for the first derivative and numerical approximation for the first derivative and the second derivative and this you know so this you may have seen many times so let's say I have a grid point at x ith grid point at Xi and the I plus 1th grid point at Xi plus 1 right let me take the middle point and let me try to see what is the derivative of any function at that midpoint between Xi and Xi plus 1 now fx what is that eventually it could be potential it could be electron concentration or whole concentration it's a generic representation for effects how do you do a derivative of this sort very very easy so you write it again in the Taylor series you write that f at x0 x0 being the middle point let's say that is x0 plus a plus 2 right the value on this right on the magenta the color is not coordinated I see but you can see minus a over 2 df dx right because you want to know how much is a little bit before that point at the first derivative you know and correspondingly the red one you can correspondingly write x plus a which is at xi plus 1 do you see that and then it will be derivative multiplied by a over 2 because it's a half the distance right so now if I subtract these two things two quantities then what will happen do you realize that if I subtract the magenta will go and the blue and the red I will write it as Xi and I plus 1 you see that and then there is a plus a divided by 2 after subtraction that becomes a so that's a sitting on the denominator so the slope of the function at the middle point why in the middle point I'm coming in a few minutes but in the middle point is given by this function if I know the two of node point solutions which I don't but if I knew then I could calculate the derivative easily what about the second derivative now this I have copied from the Schrodinger equation you can see so I shouldn't have to explain too much I say that at node x i plus 1 that's the value right Taylor series expansion and at x i minus 1 that's the value in the equation on the second one what do I do here do I subtract not really if I want the second derivative then I simply add and when I add this I get the second derivative because the first derivative drops out now the one that I wrote in the previous slide and this one is the same expression actually in the previous slide I simply didn't carry around the second derivative term the square term but other than that is the same thing so when you add this you can get an expression for the second derivative and then you write it in terms of functions at three node points second derivative of course you should know it's like a parabola going through three points so you have to know about three points now the thing is that this is called a three-point formula right now there are higher order discretization also in 1d even that will give you five point formula nine point formula if you go in Google and search finite difference they will give you the list of formulas but this is the simplest three-point formula that we'll be using and this is what is also in your device simulator that you are using on the nano hub all all three based on three point formula in 1d and five five five point formula in 2d because you can see 2d will involve two side points and top and bottom so that will give you five points five point formula okay so I have the discretization of the functions let me see whether I can discretize the equations the drift diffusion equations properly so three unknowns at each node and I know need three equations each node then therefore I can connect them all up how do I do that so the first thing is of the long chain between the two contacts I have just focused on one grid point the IA grid point then I could be anything I could be five for example the fifth grid point and I am focusing on the two neighboring points I minus one and I plus one and I have divided this segment into bisect I have bisected the difference it's just like what was this algorithm called Wigner site algorithm do you remember that if you bisect it is two points in the midpoint so this is what I have done so that's why I wanted to know the derivative at the midpoint because that will help me and this volume here in new numerical discretization it's called a control volume control volume essentially you just focus on this write all the equations for one node and essentially just copy and paste for every other node then you are done so let's start with the Poisson equation now the left hand side I have written the Poisson equation being the second derivative of the potential and you should notice with a minus sign where does this equation come from I have not been writing the equation in this form until now but you can easily see from the from the extra equation that I have within the box that where it comes from I was generally writing it in terms of displacement D so divergence of displacement D I said that that's equal to the charge 0 but the displacement is proportional to the electric field right up to the dielectric constant so that that you can see the displacement I can write it in terms of the electric field but the electric field is minus of the gradient of the potential right so therefore you can see that if I insert the expression for the displacement then I will get a second derivative of the potential with a negative sign that is where that equation came from same Poisson equation okay and then so how am I going to discretize this equation now in many ways this looks like almost like a Schrodinger equation do you see that instead of V if I had a psi then it almost looks like a Schrodinger equation so it should be the discretization should be very similar there's no no complicated thing here so let's let's try to write it do you agree with this statement the first term is a second derivative I'm solving a one-dimensional problem and in the one-dimensional problem the the divergence of this nubbler square that will be equal to essentially second derivative of with respect to the position and then in the previous slide I already told you that if I knew a function f I wanted to calculate the second derivative that should be the expression on the left hand side so no problem right I need to know the potential at I and the two neighboring points I minus one and I plus one I don't know them yet but that's what I need what about the right hand side do you agree with this statement so in the right hand side I have Q and you know the dielectric constant that's fine but I also have the electron and hole concentration but at node I right node I because this is why I am thinking about and similarly the doping concentration at that node now if you have a uniform semiconductor then the right hand side will always be the same however if you have part of the region n type part of the region let's say p type then you can see in some of the I some of the grids you will carry one type or the other type nd or na but not both of them let's say and so you can just throw it in in this one this is given already and the unknowns are v pi p sub i and n sub i that's the information in general if you have wanted to write this whole equation in terms of some compact form you could say that the Poisson equation essentially is a function of three potentials at three neighboring node points and the carrier concentration at that node point so this is just writing the previous equation in a in a compact form essentially looking at the functional dependence okay so I have one equation so if somebody gave me if somebody gave me pi and ni at every point I can solve this equation right can I because on one side I know potential is zero and another side I know the potential is equal to the battery voltage and then three each three I keep connecting them up so just like the Schrodinger equation I can solve for the potential so that will be the solution of the numerical solution of the Poisson equation now what about the current equation well that's a little bit more tricky but not too much let's see how it work so I will have to do dj and dx right the electron current and then there is this generation and recombination term that's fine and I have already I know that the carrier concentration current is given by the drift term and diffusion term do you recognize the first term as drift because it was q n mu n electric field e I have just written it as minus dv dx so that's the electric field and the second term do you recognize where that came from well I have used Einstein relationship to replace d sub n the diffusion coefficient y dn of d over you d over mu is kt over q I always say it rhymes right so that's how you should remember so you can see that's why I have replaced it with kt mu n and d and dx that's the gradient that's the gradient okay so how do I represent this current again not too difficult I have divided both sides with kt mu n and so you can see that how it works but in terms of the value n which is in magenta how do I know value at a given point well I can take the average of the neighboring two points ni minus 1 plus ni divided by 2 now you could say why shouldn't I take average of the other two ni plus 1 plus ni divided by 2 you could do that no problem there it will give you the same answer at the end of the day what about dv dx the dv dx do you recognize that the first derivative we just derived a few slides ago df dx that gives you dv dx between these two points and now you also realize why I took the derivative at the midpoint because that allows me to connect get the derivative in terms of the function known functions at i and i plus 1 okay so this is the first term and the correspondingly the derivative term d and dx there is a simple the same thing and so you get this j and insert it in the first equation then that gives you the a corresponding equation that you can solve and at the end I didn't do that step but just to give you a flavor then you can see do you agree with this statement that this continuity equation will actually depend on all the potential where is the potential coming from from the drift run that's all the potential and carrier concentration throughout this throughout this region for the for this node and so therefore you can solve this equation that will give you the carrier concentration at every point if somebody gave you the v and p let's say the whole concentration then you could easily calculate the electron concentration on its own so the minority carrier diffusion that we did in the last class we didn't solve for the Poisson equation right do you remember we didn't because we said the electric field is zero so in that case the potential was sort of given right and the whole concentration was very large and uniform so we didn't worry about that one either we just solve for the electron continuity equation so this is why what we are actually solving in a simplified form okay so this is electron continuity equation and you can correspondingly do a whole continuity equation and you are done so you can see the three unknowns at each node and if your device has 100 nodes how many equations do you have you have 300 equations because each node connects to the neighbors and the first and the last one is spatial because that only connects to the one side but other than that you have about three times the equation that you have to solve in a coupled way okay this is non-linear in the sense that these are coupled this solutions one solution depends on other one and in that sense you cannot solve them in a decoupled way or individual way so what is done in the computer is at the end of the day if you just wanted to solve Poisson equation you will just do it in the same way we did it for for the Schrodinger equation you will discretize it and put it in the matrix it will essentially be just banded matrix connecting the neighbors so therefore I have drawn essentially the three lines essentially the three lines and then the potential at every node v1 v2 v3 vn these will be the solution coming out v1 and vn are known from the known boundary condition so one can one can solve this maybe I should assign a homework problem for you to write this code so that you really understand okay now the boundary condition is very important I told you about the potential boundary condition that's easy but the boundary condition which are a little bit tricky are the electron and whole boundary condition but you already know that how to handle this one potential boundary condition I write it here no problem now when you want to write the boundary conditions for the electrons and holes you have to assume and this is an fundamental assumption that electrons and holes are always in equilibrium device may be non-equilibrium electron hole flushing around potential going from one point to another but the two contacts these always has to be in equilibrium now if it is in equilibrium what is the relationship it must follow it must follow n0 multiplied by p0 is equal to ni squared do you know remember this this is the detailed balance right law of mass action and the of course comes from the detailed balance also now if that contact is in the p region then what is the value of p0 that is equal to na right whatever is the doping at that point and from that you can immediately get the value of n0 right so that in the boundary by assuming that relationship you immediately know the value of n0 and p0 but only at the contact same thing on the other contact also same thing on the other contact because that contact is also in equilibrium and as a result again the multiplication of the two is ni square and as a result as soon as you know the majority carrier concentration from the doping then you immediately know the minority carrier concentration from this relationship and then you put them in that is the boundary condition for electrons on one side boundary condition for electron on the other side and in between this differential equation connects them up right so that's that's the solution now remember in general although I have written ni squared in both cases if one side is gallium arsenide and another side is aluminium gallium arsenide like there are transistors that have this type of things then is the ni squared same on the both sides obviously not because ni squared is n capital n sub c n sub v and band exponential of the band gap and different material has different band gap a different effective density of state as a result this number on both sides need not be the same that's a material dependent parameter okay but once you have this on the two sides and once you have the potential then you can solve everything inside so so the equation you are solving every time you're hitting that key in nano hub is it is going in and internally solving this humongous equation but it's really not humongous you can see this in the following way you see the vector that is multiplying the whole unknown the unknown this matrix contains all the mobility terms the discretization the a terms you know everything that's multiplying vi and vi minus one all this is inside the matrix i have three equations so i have a n continuity equation the whole continuity equation and the Poisson equation and this vector starts from x1 to xm first point to the last point and similarly the unknowns are p to pm and potential on the first point the last point and this is what i'm trying to solve for and that's the boundary condition i just told you about right n naught you got how n naught multiplied by p naught is ni squared so that's how you knew that n naught and similarly on this side i the boundary condition i just told you about so that one is from the other contact and so on the right hand side you will have these terms sitting in there and similarly you can do for the holes at various points again the boundary conditions i just told you about and you can do it for do it for the potential and the boundary conditions are again from the two contacts and so that's the right hand side is the boundary conditions these are bunch of unknowns now do you remember that when you simulated for the homework that a column of numbers comes through there's the first column of numbers second column of number third column of number coming through did you remember to see this so that numbers is solving the n after finishing the solution of n the solving the p and then inserting this information of n and v in and solving the p and solving the v so you will see an n written on the top of the column a p written on the top of the column and a v written on the top of the column as they swing through your screen so next time you do it pay notice that that is actually what you are doing now this one so this one is is a potential that that's fine but you see this column at this grid at this box what does it represent this one represents how the Poisson equation talks to am i doing something wrong this one gets multiplied this with the Poisson equation i'm sorry i should have put it in here so essentially because you know Poisson equation talks to the number of electrons and number of holes that's its needs right so it should have talked to the continuity equation that's where the solution would have been coming from and correspondingly to the to the electron concentration so there is this two of diagonal component that it has to talk to from the continuity equation of n and p and similarly there are these terms these are because of recombination generation because only when you have recombination generation the electron needs to talk to the holes and so therefore the n continuity equation will need to talk to the p continuity equation to get the whole concentration so that's on of diagonal term if you don't have any recombination then you will not have that term and similarly for the electrons likewise there will be a corresponding term for the recombination because anytime one electron disappears a hole disappears right so anytime you make one electron disappear from one of the columns there will be a corresponding hole disappearing from the respective other column and so therefore this cross term takes care of any recombination you have if you don't have any recombination then essentially it will be diagonal except that the potential equation will couple the electron and hole considerations but apart from that it will essentially be decoupled so the general way that you solve start solving it is you start on the right hand side focus on the right hand side the column of information so you'll start by gazing a potential for v n and p at every node points you will solve the Poisson equation assuming electron and hole concentrations are kept fixed once you solve the Poisson equation you will get that drift term and correspondingly you will solve for the electron concentration and from assuming the hole concentration potential are fixed and that gives you the electron concentration and similarly the hole concentration and you will keep doing it you see that's why we don't do it on a in a in in pencil and paper the computer doesn't mind it can go around doing it and until everything is satisfied and you have a full solution okay so that's about it for the numerical solution there will not be I will not be asking any detailed question about this but I want as a graduate student you to appreciate the complexity that goes behind it and that's what every time you solve a problem actually a lot of things happening behind your back and understanding this physics is very important so that you don't make a mistake while you are doing a numerical simulation so the summary is that we may we said two methods of solving drift diffusion equation analytical and numerical I gave you one example for analytical and throughout the rest of the course will give you many more examples under various conditions how to make approximations but the numerical one is general numerical one it doesn't care about approximation so once you can give it a proper problem it will solve it for you it may take time but it may not converge even if you don't do it right but otherwise it is a general thing that doesn't make any approximation here now I want to emphasize that the analytical solution provides inside numerical solution it is it is like trying to drive a car that even when you don't know anything about the machinery of the car or the physics of the car or how it works you can still drive a car and many people if you teach them a little bit technicians and others many time in companies they can do this I mean run this but if you want to design a new device if you want electrons to go in a certain way in a certain place you know numerical simulation will not tell you that that you have to do it in your head with analytical solutions and sort of thinking about that if I do this what happens you should know that answer in your heart in some way and that is the only way to be a engineer you learning how to run the programs doesn't make you an engineer right okay and numerical solutions of course once you know how to use it it's more versatile that even when you cannot see the solution on a piece of paper most of the time you can start with numerical solution in that case and once you look at the solution then you can develop back your intuition over a period of time so it goes back and forth it should be done it should be done in both ways so you got a flavor of this okay