 So, in this lecture now what we are going to look at is some other characteristics of non-linear systems which is equally important, I mean typically when you talk about non-linear systems we want to analyze I mean of course, if you are looking at a non-linear system without any inputs then what you would like to analyze is the equilibrium points and you want to find out whether the equilibrium points are stable or unstable what sort of characteristics the equilibrium point has. Now, another characteristic which non-linear systems display are limit cycles. So, there are these limit cycles that could exist in a non-linear system and one would like to know whether these limit cycles are stable unstable and so on. Now, of course, this has a lot of practical use like for example, oscillator circuits are designed by using non-linear circuits such that the non-linear circuits actually have a limit cycle which is a stable limit cycle. So, what happens is when the circuit traverses through this limit cycle, it is a stable limit cycle. So, if there is any sort of perturbance you sort of get deviated from the path, but because it is stable it comes back to the path and therefore, this limit cycle keeps getting described again and again. Now, one important thing about the limit cycle is that suppose you draw a phase plane diagram of this non-linear system. So, you have this limit cycle which is really a close curve in the phase plane. Now, if the system is evolving along a limit cycle and you look at, you know, you sense the signal somewhere in your system, because it is going through this limit cycle, the signal that you sense would be periodic. So, if one wants to analyze or detect limit cycles in a non-linear system, then necessarily there must be periodic solutions or I mean if you are sensing the non-linear circuit somewhere, you should be getting periodic signals. So, one could now utilize this idea of periodicity in signals to try and capture limit cycles in a non-linear system. Now, from what we had discussed earlier, if you have a general non-linear system, then you can split it up into a linear part and a non-linear part and think of a linear part as an independent system and the non-linear part as an independent system with some feedback connection. So, the linear, you could think of the linear plant as being in the forward loop and the non-linearity in the backward loop and some sort of negative feedback loop that you have and analyzing this close loop system is the same as analyzing the original non-linear system. So, let us look at what it is that I am saying. So, suppose you have some non-linear equation and this we have discussed in some earlier lecture, you can split it up into a linear part and a non-linearity and then think of the original non-linear system to be analyzing the original non-linear system is like analyzing this close loop system. Now, in this system, suppose you look at this, you have some methodology by which you can see the signal that exists at this place. Now, if this system is going through a limit cycle, so you have the phase plane, so suppose it was an order 2 system, so you have x and x dot and if it is an order 2 system and it has a limit cycle, maybe it has a limit cycle which looks like that. And so, let us suppose that the given system is traversing through this limit cycle. So, if it starts from this point at time t equal to t0, after some time capital T, it will get back to this original point. So, what it means is that it will get back to this point. So, it was at this point at t0, the next time it would be at t0 plus capital T, then t0 plus 2t and so on. And so, the periodicity is t. And if you are sensing the signal here, what you would get would be periodic signal like that. I mean, this being the period and this period, this is capital T and this keeps getting repeated. Now, when you have a non-linear system, one would like to know if it has limit cycles and if it has limit cycles, then whether the limit cycles are stable or not and things like that. So, one way that one could detect limit cycles is by sampling or seeing these signals, let us say on oscilloscope or something. And then if that signal is periodic, then you know that this system is right now oscillating in limit cycle. But analytically, if one wants to find out if this given system has a limit cycle, then one of the methodologies used is what is called the method of harmonic balance. Now, the method of harmonic balance is based on some basic principles of periodicity. You see, for the linear plant, if you give as an input to the linear plant, if you give a periodic signal and the most common periodic signals that we think of are the sine or the cosine waves. So, if you give a periodic signal as the input to the linear plant, the output of the linear plant will also be a sine or a cosine. The only difference being that the amplitude might have got magnified. And in fact, if you give a signal with frequency omega, then you know that the output signal for the linear plant would have magnitude and the magnitude was let us say a. So, you give a signal like a sine omega naught t, then the output would be g j omega naught. I mean, you evaluate what the transfer function would be at omega naught and take the modulus of that times a. So, the magnitude would be or the amplitude, if the amplitude of the input was a, the amplitude of the output is a times the magnitude of g j omega naught. And then what you would get is sine omega naught t plus some alpha, this alpha would in fact be that alpha would in fact be the angle of g j omega naught. So, this is what happens in a linear plant. On the other hand, in a non-linear plant, I mean and in fact, this property that when you give a pure sinusoid as an input to a linear plant, you get a pure sinusoid of the same frequency as the output to the linear plant is in fact the defining property of linear plants. On the other hand, in a nonlinearity when you give a sinusoidal input, the output that you get may not, I mean for example, if you give the input to be a sinusoid, the output may not be sinusoid. But of course, depending upon the nonlinearity when the input is a sinusoid, the output may still be a periodic signal having a period which is the same as the period of the input signal. So, what one does is one tries to use this idea. So, suppose you have a nonlinearity. So, what you do is as input to the nonlinearity, you give sinusoidal input to the nonlinearity. So, sinusoidal input with a particular frequency omega and the magnitude A. Now as an output, you get something, but this something of course need not have, I mean it would be periodic, I mean depending upon the nonlinearity, it may be periodic. Now if it is periodic, if the output is periodic, what one could do is one could take a Fourier series of the output. Now if you put certain kinds of constraints on the type of nonlinearity, then if you give a periodic input, you can say more things about the output. So, for example, if this nonlinearity is a memoryless nonlinearity which is time invariant, of course memoryless is not that important, but suppose this nonlinearity is time invariant. Now the nonlinearity being time invariant essentially means that if you give a certain type of input now, there is some output you get, but if you give the same input after some time T, then the output that you will get will again be the same. Now if the nonlinearity is time invariant, then when you give a sinusoid with the period being T, so suppose you give a sinusoidal input and this period here is T, then the output, of course you do not expect it to be a sinusoid, but you expect it to be something which is also having period T. Now if the output signal has period T, then what one can do is you find the Fourier series of this output. Now, if you find the Fourier series of the signal, so let me call this signal phi of T, the input let us say was psi of T and the output of the nonlinearity was phi of T. And so if you write down the Fourier series of phi of T, what you would get is some constant term, let me call it B0 plus you will have B1 sin omega, omega being the same frequency that you gave, omega T plus B2 sin 2 omega T because omega T has periodicity T, sin 2 omega T will have periodicity T by 2 and therefore the time period T is a multiple of that and so on. So, this will also be a signal which is having time period T plus B3 sin 3 omega T and so on. And then you might also get C1 plus C1 cos omega T which is also some signal which has periodicity time period equal to T plus C2 cos 2 omega T plus so on. So, this periodic signal phi T in fact can be completely characterized by if we know B0, B1, B2, B3 and so on and C1, C2 and so on. So, now as far as the nonlinearity is concerned you give an input psi T which is a sin psi sin let us say omega T, A sin omega T and as an output you get this signal phi T and it has the same period T as the input and what you do is you take the Fourier series. So, when you take the Fourier series you get phi T to be let us say B0 plus summation Bi sin i omega T i going from 1 to infinity a very large number plus summation i going from 1 to infinity Ci cos i omega T. Now, if this nonlinearity was not a nonlinearity but was a linearity. Suppose this nonlinearity was I mean this was not really nonlinear but it was linear. If it was linear then this B0 would not be there and the Bi's and the Ci's the Bi's and the Ci's for all i not equal to 1 would have been 0 and you would have had a let me use not i but k because i can have some other meaning. So, I will just substitute k here. So, k equal to 1, Bk equal to B1 and C1 would be nonzero and all the others would be 0 and then what you have is B1 plus j times C1 this in fact is going to be if it was a linear plant. So, let us say if it was G of s then this B1 plus C1 is really going to be a times G of j omega. One does is one assumes that this nonlinearity is not I mean one assumes the closest linear system to this nonlinearity by saying that if you give a sin omega T as the input then the output is really B1 sin omega T plus C1 cos omega T. Of course, this can be put together this can be put together as B1 plus j C1 sin omega T may be I could do this. I could just call it B1 plus j C1 sin omega T by saying j C1 what I am saying is that there is a component with this magnitude which is lagging the sin omega T by pi by 2. Of course, this could also be written out as you take the magnitude B1 square plus C1 square and then you have sin omega T plus alpha where alpha is this angle which this complex number would have. So, now this number that you have you can think of this as the gain and this as the phase of the nonlinearity when the frequency is omega and the amplitude is A. And so for a given nonlinearity what one could do is one could keep varying these various omegas and for each omega you vary the amplitude A and so for each omega and each amplitude you find out what the gain is and what the phase is. So, what I am saying is you have a function phi which has omega the frequency of the input and A the magnitude of the input. So, it has these two this function has omega and A as the input and for this nonlinearity so suppose I call the nonlinearity N so I call this phi of N. So, phi of this nonlinearity is such that given an omega and given the amplitude it gives the gain G and the phase phi or let me call it alpha since I call this thing alpha. So, it gives the gain and the phase obtained in this way. So, how do you obtain this? Well what you do is you take the input to be the sinusoid with this particular amplitude you look at the output and the output then you take the Fourier series of the output. You neglect all the higher harmonics and look at only the primary harmonics. So, you look at only b1 and c1 and that b1 and c1 together you use to calculate what the gain is and what the phase is and so this gain and the phase you put down as G and alpha. So, now such a function so this function of course takes as input the omega and the amplitude and gives as an output the gain and the angle. Now such a function is called a describing function of the nonlinearity. One thing that I would like to clarify here is that of course when you just take the b1 and the c1 you get this. So, this will not be the G the gain I mean the if you want to talk about the gain this would have been the gain had the amplitude been 1 but right now the amplitude that I am giving is A. So, this gain G is really square root of b1 squared plus c1 squared divided by A. So, depending upon the amplitude you see by how much so the gain is precisely the number by which you should multiply the input amplitude to get the output amplitude. I hope that is clear. So, the gain is really you look at the Fourier series you look at b1 and c1. So, you look at the magnitude b1 squared plus c1 squared square root of that but then you divided by the amplitude of the input signal. So, this gain you purely I mean whatever is the magnitude of the gain you multiply to the amplitude of the input signal to get the amplitude of the output signal. So, this particular function is called the describing function. Now the best way to understand the describing function is to probably look at an example of a describing function so what we will do now is we will take a particular nonlinearity and we will look at how one calculates this describing function. So, the nonlinearity we look at so let us look at the sine function. So, we are looking at a nonlinearity and the nonlinearity does the following if the input is psi t the output is the sine of psi t. The best way to draw this nonlinearity I mean the characteristics of this nonlinearity is the input is psi the output when psi is positive it gives plus 1 and when psi is negative it gives minus 1. Of course, instead of just taking sine one could also one could also just take let us say capital M times the sine in which case here you will have M here you have minus M. Now for this given nonlinearity let us find the describing function. So, now suppose psi t you give psi t to be a sinusoid. So, assume that psi t is a sinusoid a sine omega t what do you expect the output to be so this is phi. So, in this case the output like this so here is the input so it is a sinusoid. So, this is the input psi t so this axis is t t and let us see what the output looks like. Well the output will be plus M till this point then it will be minus M till this point so the output that you get is a square wave. So, now if the output is a square wave of course this is also periodic with the same time period as the original input. So, now one can find out the Fourier series. So, how does one find the Fourier series? So, this particular sequence I mean this square wave is essentially if I am taking that this phi of t could be written as plus M for t k t k plus half t and minus M for k plus half t less than equal to t less than equal to k plus 1 t where t is the time period of the signal. So, it is the same as t is really the same as 2 pi by omega. So, now if you find the Fourier series, so how does one find the Fourier series for this square wave? So, the Fourier series for the square wave is found by, so for example, b k the way you would find b k is multiply phi t to sin k omega t and then take the integral over a period. So, here of course omega t so in case of t if you are taking the period in case of t you could take this integral from 0 to 2 pi by omega that is capital T which is the same as capital T. And then this they would also be a multiplication factor here the multiplication factor let me just call it k capital K. So, this multiplication factor will depend upon how you take this integral, but if you are taking this integral over the whole period then in that case k is going to be 1 by 2 pi. So, for this particular nonlinearity that we were looking at, so we have the square wave and this is m plus m, this is minus m. So, suppose we have to, so this is how you find b k and how you find c k is again you have the proportionality constant 0 to capital T of phi t cos k omega t. So, this phi t cos omega t by multiplying by cos and taking the integral will give us the c k's and of course the b naught you get by just integrating 0 to t of phi t. Now, in this case when you calculate it should be clear that if you take any, if you evaluate any of the c k's in this particular case you see what you have got here is an odd function and any odd function if you are going to I mean if you have a periodic odd function and you are going to take the Fourier series all the c k's will turn out to be 0. On the other hand if you calculate the b k's in this particular case you will get b 1 to be m by, you will get 4 m by pi if I am not mistaken. Maybe perhaps I should just calculate it out. So, let me calculate b 1. So, this b 1 is like integrating from 0 to pi 0 to pi of m times sin theta d theta plus integral from pi to 2 pi of minus m sin theta d theta. But this integral is really the same as this integral of course there is some constant. So, I will fix the constant later. So, this is the same as 2 times integral from 0 to pi m sin theta d theta. Now, this so I can pull out the m. So, I have 2 m and I have integral of sin theta is minus cos theta evaluated at pi and 0 and so this should give me cos theta evaluated at pi is 1 cos theta at 0 is also 1. So, I get 4 m. So, as it turns out that this whole thing is 1 by pi of this whole thing. So, it is 2 by pi here 2 m by pi 4 m by pi. So, I was right here in the first place this constant k should have been 1 by pi. So, this b 1 turns out to be 4 m by pi. In general, we can see that Bk will turn out to be. So, if you have to calculate Bk, this is like. So, if you evaluate all the Bk's, these Bk's will turn out to be 4 times k m by pi. No, sorry. Maybe we just calculate B3. So, B3 turns out to be 1 upon pi and now you have to take the integral from 0 to pi of m times of m sin 3 theta d theta, which is 2 m by pi and this integral is minus cos 3 theta by 3 evaluated at 0 and pi. And so this turns out to be. So, that is 1 third plus 1 third that is 2 thirds. So, you get 4 m by 3 pi. So, in general when you calculate Bk, what you are going to get is 4 m by k pi. I have to be a bit careful here because I am going to get Bk equal to 0 when k is even and equal to 4 m by k pi when k is odd. So, why I am saying this is because we are looking at a square signal, I mean a square wave like this and so suppose I take a sinusoid which is an even multiple, you see. So, suppose I am taking an even harmonic, then if you look at the first half, the positive thing is multiplying the sine and then second half, it is a negative thing which multiplies the same signal. As a result when you do the integral which is what you are doing to calculate, so in order to calculate B2, then B2 will turn out to be 0 because there is as much positive as there is negative. On the other hand, if I am looking at the primary harmonic, then that is the positive half and that is the negative half. So, when it was positive, this was also positive and that is negative. This is also negative. So, the B1 turns out to be as we saw 4 m by pi. So, whenever you take odd harmonics, you will, so odd harmonics Bk will turn out to be 4 m by k pi whereas B, for the even harmonics, it will turn out to be 0. But anyway, we are not concerned with all this, all the Fourier series, what we are only concerned with is this particular thing B1. So, now coming back to the non-linearity, so you have this non-linearity and when the input is psi t, the output is pi t and what we have just seen is when the input psi t is A sin omega t, then the output phi t is square wave with magnitude capital M. And so if you want to talk about the gain, the gain is going to be 4 m by pi, as we looked at the Fourier series of the output of the square wave, we saw that B1 was 4 m by pi and C1 was 0. So, the output, the primary harmonic of the output, the primary harmonic of the output is going to be 4 m by pi sin omega t and therefore if you want to now talk about the describing function for this non-linearity phi of n, then phi of n of omega A is going to be 4 m by pi A with angle 0. Why is the angle 0? The angle is 0 because when you give a sinusoid, the output of the primary is in phase with the input. So, there is no angle alpha here, that is why the angle is 0 and when the primary and the input is A, we saw that the output magnitude is 4 m by pi. So, the gain is the output magnitude divided by the input magnitude, that is why it is 4 m by pi A. So, the describing function for this particular non-linearity is 4 m by pi A. Note that this non-linearity, the describing function is independent of omega. So, it really does not matter what this omega is. As you change the omega, you get periodic signal of a different time period but then the analysis for B1 and C1 is exactly the same as what we have done before and so again you will get the magnitude to be 4 m by pi. It does not matter what this omega is, you will always get 4 m by pi sin omega t as the output if A sin omega t is the input for whichever omega you think of. That is why the describing function, though I am writing here that it is a function of both omega and A, it really is only a function of A, this omega does not play a role. So, in this particular non-linearity, we could suppress omega if we felt like it and we could just think of the describing function as only depending upon the input magnitude A. Now, one can also look at describing functions of more, I mean that was probably a very simple non-linearity. One could look at other non-linearity like for example, one can look at a non-linearity which is let us say a relay with dead time. So, if you look at the input output characteristics of such a relay with dead time, so this is the input, this is the output and it could be that for some time, for some input there is no output and then there is an output and here similarly for some negative inputs there is no output and then there is an output and let us say this magnitude is again m and this is minus m. So, up to some value let us say d, up to some value d there is no output, beyond d you get plus m and similarly up to minus d there is no output and beyond that you get minus m. So, you have a non-linearity with this characteristics. Now, suppose to this non-linearity you give an input which is A sin omega t. Now, if you give an input A sin omega t, what would be the output? So, let me write down what the output is. So, phi t would be equal to k. So, let me mark what one would get as an output by doing something here. So, let me draw the sinusoid here and then I can just directly check what the output would be because on this axis, if I draw the input like this then I can check what the output is. So, suppose the input is like this. So, some sinusoid like that where the magnitude A is less than the small d. Now, you see if the magnitude A is less than small d then when this is the input, the output as you can read off from this map is 0. So, the phi t will be 0 if the magnitude A is less than d. On the other hand, if you consider input where A is greater than d then what is going to happen is that is d and that is minus d for u. So, what will the output look like? So, let me draw output here. So, initially this is how the sine wave took off. So, initially for this much time, so up to this point for this much time the input is 0. Then for this portion of the input it is plus m. Then after that it becomes 0 and it is 0 for all this time. So, it is 0 for all this time and then it goes negative and then it again becomes 0 and this could be the time period t. I could also write this as let us say 2 pi. It is simpler just to use the angles. So, you have this signal with this being plus m and this being minus m you have this signal. Let us think of this angle as pi and this is 2 pi. You will get this signal and periodic repetition of this signal. So, the phi t for A less than d is going to be 0 and for A greater than d greater than equal to d, it is going to be 0 up to this point and what is this angle? This angle is precisely when do you get this angle when the input has precisely become d which means d is equal to A sin alpha or in other words alpha is sin inverse of d by A. So, this angle here is alpha. Then of course, you can calculate what this angle is and it should be clear that this angle is pi minus alpha. This angle here is going to be pi plus alpha and this angle here is going to be 2 pi minus alpha. So, the output signal if you want to describe the output signal for magnitude A, I mean the input magnitude greater than d, then this signal is going to be 0 for theta less than alpha. Perhaps I will write it in the next page. So, the output phi of t for A greater than equal to d is going to be 0 for angle 0 is less than theta is less than alpha and then it is going to be plus m for alpha less than equal to theta less than equal to, so I should not be using less than equal to, but I guess you understand what I mean by that, pi minus alpha. Then it is again 0 pi minus alpha less than theta, maybe I will just consistently not use less than only for the lower limit and for the upper limit less than equal to pi plus alpha and it is going to be minus m for pi plus alpha less than theta less than equal to, so let me call it phi of theta less than equal to 2 pi minus alpha and then it is again going to be 0. So, the full cycle is given in that way as we had drawn earlier, this being alpha, this being pi minus alpha, pi plus alpha, 2 pi minus alpha, this is 2 pi, this here is pi is 0. So, now if we have to now calculate the primary harmonic, again this is again an odd function, so we can straight away say that all the C i's are going to be 0, all the C k's are going to be 0, but we of course only interested in finding B 1 and so if you have to calculate B 1, B 1 turns out to be 1 by pi integral 0 or rather 2 by pi integral 0 to pi of phi of theta sin theta d theta. So, how much is this? Well, this integral from 0 to pi can further be broken down into 0 to alpha which will be 0 and pi minus alpha to pi which is also 0. So, what is just left is alpha to pi minus alpha of phi theta, there is m. So, I pull out the m and I just have sin theta d theta and this turns out to be 2 m by pi and I will have minus cos theta, so I have 2 times cos of alpha. So, what this means is that for this particular nonlinearity that we are looking at, phi of A, I mean I am suppressing the omega because when you give the input to be sin omega t, then for the input is psi t and the output is phi t and then the primary harmonic of the output is going to be 4 m by pi cos alpha times sin omega t. Of course, this cos alpha, you can write this down because we already know that alpha or sin alpha we know is d by a and therefore the cos alpha is going to be square root of. So, we can write this cos alpha in terms of A and D which are parameters that came from the nonlinearity. Therefore, in this particular case the describing function and again here the describing function is independent of the omega because every time you give A sin omega t, you will get a square wave of that kind and when you calculate the B1 for the square wave, it would be like this and so phi of A is going to be 4 m by pi cos alpha, but this is not the gain, the gain is pi A. So, this is the gain and the angle is going to be 0. So, this again is the describing function for the nonlinearity which we showed in this way. So, we have sort of calculated two different describing functions for two different nonlinearities and so what we would do in the next lecture is talk about how we are going to use this describing functions in order to detect whether a given system has a limit cycle or not.