 11th lecture on wave shaping circuits and if time permits we shall introduce the topic of natural response of circuits. As I had talked about yesterday we were considering a different wave shaping circuit C and R and if this is VI this is V0 then V0 is approximately equal to RC the VI DT provided provided the product RC is much less than capital T where capital T denotes the time period of VI the input voltage. And I have said that if the input voltage is a rectangular wave like this if this is VI then V0 will be the differentiated form and if it was ideal differentiation if it was ideal differentiation then the slope should have been infinity alright so there should have been an impulse here and infinitely large amplitude 0 duration and there would have been a negative impulse at this point where the wave where the amplitude goes down alright. In practice what happens is as soon as this wave form is fed here the capacitor which was uncharged cannot change its charge instantaneously the capacitor acts as a short and the total voltage is dropped across the resistance R and therefore the voltage rises the voltage across the output rises from 0 instantaneously to the value VI then what happens then the capacitor gradually charges so this voltage decreases you see by KVL VI should be equal to VC plus V0 so when VC increases due to charging of C the voltage V0 decreases and this is what happens it rises to VI then gradually diminishes it diminishes exponentially alright and diminishes to approximately 0 till the voltage comes here at this point at this point the voltage goes in the negative direction and therefore I am sorry I made a mistake I wanted to take the general case of a voltage which goes positive as well as negative general case so by 0 level let us say is somewhere here this is the 0 level then what happens is the voltage goes up like this it diminishes like this then when it comes here the voltage goes down like this because the charge is approximately 0 here once again as soon as the input voltage changes to the negative level it goes to the negative level then again it the negative charge decays which means that the voltage rises towards 0 remains there then again it goes up it comes down and so on it repeats and these waveforms which are very sharp decay the duration of the waveform is very small are called spikes so what you would observe in the oscilloscope would be these spikes that the spike here a negative spike here positive spike here a negative spike here and so on and so forth alright this is the differentiating circuit now if you recall in the differentiating circuit the condition under which the circuit differentiates is that V 0 should be much less compared to V C alright V 0 should be much less compared to V C or the product R C should be much less than capital T question is can we obviate this constraint can we can we design a circuit in which this constraint is not needed in other words you see if V 0 is much less than V C what it means that the output voltage is a very reduced form of the input voltage reduced replica not replica reduced differentiated form can we do something to obviate this difficulty well this is offered by the op amp if you take an op amp in which the non inverting terminal is grounded the capacitor is connected here C and the resistor is here resistor is in the feedback part this is V 0 and this is V I suppose I consider this particular circuit it is the op amp is assumed to be ideal now if the op amp is ideal then you know this if this is ground this point shall be virtual ground this point should be virtual ground which means that the current through C would be simply C D V I D T and the current through R the current through R should be equal to V 0 by R agreed and by KCL the sum of the two currents should be equal to 0 because the op amp does not take any current infinite impedance and therefore you notice that V 0 is simply equal to minus R C D V I D T and this does not involve any assumptions whatsoever it does not involve any assumption about the product R C or that the output voltage is much smaller compared to V I know no assumptions are involved so this is a better differentiator this is what the op amp does it improves if you use the same elements a capacitor and a resistor that in between we use an op amp to improve the differentiation and this this relation if the op amp is ideal is exact there is no simplifying assumption involved here this is what the op amp does this is the op amp differentiator in a similar manner we can get an integrator an integrator is a series resistance and a shunt capacitance this is V I this is V 0 this is the passive circuit this is R and this is C and you see that V 0 yes previous case means what this case is in this case yes in this case if you make capital R very large yes okay C R will increase fine so say it may magnify the output voltage you see magnification or amplification the term is used when the waveforms are preserved that is if the output waveform was of the same shape as the input wave then the term amplification or magnification makes sense otherwise if you are changing the wave shape what is it that you compare the two shapes are different and that we don't say magnification what I am saying is that the R C product now is arbitrary it is no relation to the frequency of the time period of the input waveform all right okay in this case in the case of the R C circuit capacitor shunt capacitor as a shunt at the series resistor R which is exactly the the different heating circuit with C and R into change while V I is equal to V R plus V sub C and if V sub C that is the capacitor voltage is much less than V R then V I is equal to V R which is equal to if the current in the circuit is I it is simply equal to I times R and therefore the current in the circuit is given by V I divided by R all right if V C is much less compared to V R and this shall be valid if R C is much greater than capital T if R C is much greater than capital T which we will see later on but you see that the current in the circuit is is is determined by resistance only and therefore the output voltage that is V 0 output voltage V 0 which is the same as the voltage across the capacitor shall be given by Q by C that is 1 by C and Q is integral I dT but I is V I by R and therefore this is 1 by R C integral V I dT which means that the output voltage is proportional to the integral of the input voltage all right therefore this is an integrating circuit the constraint is that the output voltage must be very small compared to input voltage. Now to take an example if I have a square root once again like this like this then what happens is due to integration well physically you can see what is happening let us not go into the mathematics first physically what happens you can see that when V I is applied if it is a square wave suddenly V I rises from 0 to a value let us say capital V the capacitor cannot change its charge instantaneously so the capacitor starts from 0 charge and then gradually gets charged all right if sufficient time was allowed the capacitor would have charged to the maximum of V I all right when the the square wave goes negative when the square wave goes negative well the capacitor naturally charges like this suppose it it comes from starts from here the capacitor charges like this when it goes negative the capacitor gets charged in the opposite direction which means that it gets discharged so it it discharges like this and once again from here from here when the voltage goes positive the capacitor charges like this and so on ideally ideally this should be straight lines if we are really integrating then what we show as violet lines which are carved or parabolas not parabolas their exponential rises ideally they should be straight lines they would be approximately straight lines if the time of charging and discharging is small isn't that right for an exponential curve like this if you consider a small portion well it can be considered as line as a straight line and therefore it would be approximately an integrator if RC is far far greater than T that is the time available for charging on and discharging is much less compared to the time constant of the RC circuit this is the physical explanation of a passive integrating circuit now the the relation V0 equal to 1 by RC integral Vi dt is valid if RC is much greater than T and this restriction exactly like the differentiating circuit can be removed can be removed if you use an op-end let us see how this is done we have an op-end once again the inverting terminal is grounded to the non-inverting terminal now you apply a resistor and in the feedback path you insert the capacitor C this is V0 inverting terminal that is correct we applied the inverting terminal not to the non-inverting terminal no now you notice that if this is R and this is Vi then this current is Vi by R and this current would be C d V0 dt that is it being that this point is virtual ground VG and therefore this current is Vi divided by R and this current is C d V0 dt that is the potential difference between these two points is V0 and therefore the current is C d V0 dt and the sum of the two should be equal to 0 which means that V0 would be equal to minus 1 by RC integral Vi dt and there is no assumption about the RC product here there is no assumption and therefore this is a much better integrating circuit as compared to the passive integrating circuit an example now suppose I have a resistor R1 voltage V1 voltage V2 there are 2 2 voltages all right and let us say we have the op-amp and the capacitor C here what do you think the voltage would be the output voltage it can be obtained by superposition and can be written down by inspection it can be written down by inspection it would be minus 1 upon C all right the resistors are different and therefore we get integral V1 upon R1 plus V2 upon R2 this will be the total current multiplied by dt all right we have written this down by inspection consider a couple of more interesting examples is this okay suppose we have 2 voltages V a and V b connected through 2 diodes this is the end of the wave shaping and therefore we are working out a couple of examples and this is connected to ground through a 5k resistance and this is the output V0 this is V a let us say and this is V b the stipulation is this is given circuit all right 2 diodes 2 voltage resources 1 resistor and your output is V0 all right it is specified that V a and V b can have only 1 of 2 possible values V a b can be either belongs to the set 0 volt or 5 volt all right V a can be either 0 volt or 5 volt no just 2 to discrete levels either 0 volt or 5 volt that means I have a 5 volt battery which either connect to disconnect if I disconnect the voltage is 0 if I connect the voltage is 5 all right both of them could be plus 5 volt both of them could be 0 you are required to tabulate the possible combinations of V a and V b and the corresponding outputs you see V a V b and V 0 suppose V a is 0 V b is also 0 then V 0 shall be equal to 0 if V a is 5 volt and V b is 0 then 5 volt the resistance does not affect the voltage you see if V a is 5 volt then this diode conducts if the diode conducts the drop is 0 therefore this voltage must be 5 volt is that okay similarly if V a is 0 and V b is 5 once again this is 5 in volts if both of them are 5 it will still be 5 what will happen to the current through 5k look suppose I find the current I find the current under all these conditions just a minute suppose I find the current under all these conditions that is the current I here it would be 0 here it would be that means 1 milliampere here 1 milliampere here no it has to be 1 milliampere because the voltage is 5 volt the current is still 1 milliampere half of which is delivered from V a and half from V b that is basically we have 2 batteries now each battery will now give 0.5 milliampere alright now this is the this is the rudiments of logic or digital circuit alright you see if 0 volt is considered as 0 level logic 0 level logic then 0 0 leads to 0 and if 5 volt is considered as 1 level in digital in terms of digital circuits 5 volt is considered as the logic level 1 then 1 and 0 gives you 1 0 and 1 gives you 1 and 1 and 1 gives you 1 no this is an OR gate this is therefore an OR gate that is either of the 2 input levels are high so another terminology is high and low 0 is called low and 1 is called high so if either of the 2 terminals is high then the output is high if both of them are high output is high if both of them are low then the output is low and the traditional symbol for this is this there are 2 inputs a and b which are basically voltages V a and V b there are 2 inputs if and the output is let us say c then c is low if a and b both are low if either a or b or both are high then the output is high and this is the function of the OR gate or OR logic and this is one demonstration this is a demonstration of yet another application of the diode in logic gates a very simple logic why do we need diodes all right suppose we do not have the diode then you cannot make a gate without a diode without a non-linear unilateral circuit that is a circuit which passes current in one direction only you can try other combinations you will never get an OR gate what is the use of the 5k resistor what is the use of the 5k the current has to flow the current has to flow because you see suppose the 5k resistance is not there and I simply connect 5 volt battery here what does this 5 volt battery do it does not do anything these voltages will still be 0 unless the diode is shorted for the diode to be shorted a current must pass all right you might connect a 1 kilo volt here nothing will happen here till you provide a path for flow of current then the diode will drop 0 and you get the total voltage here is that okay let us take another example slightly tougher the question is I will read the question the output of a flow meter a flow meter is an instrument to measure flow that is the rate of flow or the total flow of typically let us say a liquid a flow meter typically may consist of a fan shaped mechanical gadget which when put in the path of flow in the path of flow rotates it rotates in a magnetic field and generates an emf which is typically measured to be able to indicate the amount of flow or the rate of flow all right this is called a flow meter so flow meter basically develops a voltage across it all right the flow meter the output of a flow meter is given by a voltage V which is equal to K times Q where capital Q is the rate of flow that is capital Q is let us say in centimeter cubed per second cc per second this is the rate of flow and capital K if V is in volts then capital K would be in second per volt second per centimeter cube capital K is given as 20 millivolt second per centimeter this is what is given all right a flow meter which is characterized by this relation small v equal to K Q K is given like this the effective output resistance of the flow meter flow meter has a resistance because it consists of coils rotating in a magnetic field the coils have a resistance and this resistance is 2000 ohms 2 K if the flow meter is represented by a voltage generator voltage generator then the voltage generator is K Q and its internal resistance is 2000 ohms all right the effective output resistance of the flow meter is 2000 ohms design a circuit that will develop an output voltage of 10 volt you have to design a circuit that will develop an output voltage of 10 volt 10 volt when 200 cc has passed through the metering point that is the total flow when the total flow is 200 cc 200 centimeter cube is the question clear you have a flow meter which develops a voltage V equal to K Q Q is the rate of flow and this voltage is not simply acts like a voltage generator it is a voltage generator with an internal resistance of 2000 ohms what you have to do is to design a circuit connect the circuit such that when the total flow is 200 cc the voltage developed should be 10 volts now what does this mean integrating circuit all right let us see if we can do that what we have to do is V equal to K Q I am not indicating a polarity right away we shall see this 2000 ohm for this resistance is already there so why don't you use an op-amp let this be grounded we have to use a capital C here capital C and this is V 0 so why do we use only the inverting terminal of the why do you use why don't we can use the non-inverting also so that we get the voltage in place now there is a reason the non-inverting terminal anything connected from the non-inverting terminal to the output causes positive feedback positive feedback is like if a half insane person is on a sagging bridge and you remind him that the bridge is sagging well he will make sure that the bridge goes down is this known to you no okay positive feedback encourages oscillations and once oscillation start the circuit will produce nonsense it will not act in the manner that you like for operation of an operational amplifier negative feedback is a mass and therefore we are we make a preferential treatment of the inverting and non-inverting terminals in most of the applications you will see the inverting term non-inverting terminal is not touched preferably it is connected to ground we do all operations with the non-inverting terminal because anything we collect from the non-inverting terminal to the output causes negative feedback and therefore it stabilizes the game you could not do this with the positive feedback this is a practical point and you must remember this all right now the point is that v0 is the result of an integration you notice that in this circuit v0 is equal to minus 1 over RC 2000 multiplied by C integral v dt all right integral v dt which is equal to minus 1 over 2000 C or v is K Q so K integral Q dt provided provided our polarities are like this now we do not want a negative voltage we want a positive voltage and therefore what we do is instead of collecting like this we want the plus sign here so instead of connecting the flow meter like this we connect it in the opposite direction then this sign shall be this is okay this sign shall be positive is that okay and integral Q dt what is given is that 10 v0 should be equal to plus 10 volts when integral Q dt that is the total flow is 200 centimeter cube therefore all that is required to find out is the value of C the capacitance and if I clear this out of the fractions we get 10 as equal to K divided by 200 C 2000 C multiplied by 200 and K is therefore C is well take this 200 out left with 10 so C should be equal to K divided by 100 and K is 12 millivolts that is 10 to the minus 3 centimeter per second cube divided by 100 so it is 2 times 10 to the 2 times 10 to the minus 4 farad which is equal to 200 micro farad and the solution is complete sir could we use a resistance in case of a capacitance could use a resistance in place of a capacitance then it will not integrate it will be simply inverting amplifier which is not what we want we want a voltage to be developed in a certain amount of liquid has flown and this voltage is required to be 10 volt we cannot use a resistance here no sir for integrating and differentiating circuits yes can we devise circuit in which we use inductor instead of a capacitor quite so we can do that we can do that for example your differentiating circuit is this all right you can use a R and L this is equivalent to this this performs the function of a differentiator and you can show this very easily all right similarly if you use series L and shanta this will act as an integrator this will be left to you as an exercise now we talk about we talk about natural response of a circuit all right your behaviour in the hostel is natural response when you are not when you are not monitored by your hostel superintendent it is your natural response on the other hand your behaviour in the exam hall is a forced response all right and if you are in between the exam hall and the hostel it is a combination of both because you are afraid that somebody is watching it similarly for circuits a given circuit or a system when excited by voltage sources and current sources it behaves it behaves in a manner which reflects the nature of the input and therefore that response is called a forced response all right for example to a rectifying circuit to a half wave rectifier if you apply a sinusoidal wave then you get half rectified signs all right half of the positive half of the sign if you apply DC what will happen it will be the DC itself all right the capacity rectifier or the diode will always conduct and you shall get a DC at the output as you saw in the in the OR circuit that we demonstrated so on the other hand if there are no excitations if there are no excitations from outside the circuit is left to itself then it will behave in a manner which is called its natural response now obviously if you have a resistive circuit circuit which contains only resistances no outside interference no outside source all right its response shall be identically equal to 0 everywhere in the circuit potential or current why because this circuit cannot have any initial energy it cannot store energy unless there is energy how can there be any response similarly suppose you have a inductance capacitance resistance circuit which has no initial energy none of the inductors have an initial energy none of the capacitors have a stored charge none of the inductors have a stored flux none of the capacitors have a stored charge then left to itself it shall be completely relaxed in other words all currents and voltages shall be 0 on the other hand suppose you have a capacitance capacitive resistive circuit a CR circuit it is the capacitor has a certain charge all right then left to itself this charge shall decay in a manner which is characteristic on natural of the circuit which is in the nature of the circuit and therefore such a response is called a natural response in the general situation you might apply a voltage or current to a circuit one of the things that you must understand is natural response determining natural response makes sense only when the circuit has one or more energy storage elements all right that is these are two different kinds inductor and capacitor so natural response for a resistive circuit is identically 0 it doesn't make sense to find natural response that if you have at least one energy storage element then natural response means something and you have to determine the natural response all right in the general case in the general case you may have a circuit which has some initial energy and then some voltage sources and current sources are applied to the circuit and therefore the total response of the circuit shall be a combination of forced response and natural response all right and the sum of the two shall be the complete response of the circuit there are two other terms which are used in this context this is called one of them is called the transient response and the other is called the steady state response steady state response of a circuit is the response that occurs after a long time has passed that is all the initial energies have had time to distribute or to decay the forced response has had time to establish itself formally all right then you say it is the steady state response and theoretically it happens at t equal to infinity after you leave the circuit after you excite a circuit and leave it for infinite amount of time if you observe the response later after infinity then you see what you see steady state response and what happens between the instant of application of the energy sources and the attainment of steady state is the transient response it is like Mukti or Nirvana all right before Nirvana before a person attains Nirvana he runs after money he does this he does that he he is in the rat race and so on this is all transient response all right for a circuit this is true till it reaches steady state what behavior it shows is called the transient response it is there is a common tendency amongst people who learn circuits at the first instance to equate natural response to transient response and steady state response to forced response these are not necessarily the same all right these are four different terms natural response forced response transient response and steady state response there are four different terms natural response may or may not be the transient response the steady state response may or may not be the forced they are not necessarily the same. In under certain conditions they may be the same but not in general, alright. Now in finding natural response of a circuit the first thing to determine is the order of the circuit that is how many independent energy stored elements are there in the circuit. If it is a purely resistive circuit the number of independent energy storing elements is 0 and therefore this is called a 0 8 order system. If the circuit is a differentiating circuit for example 1 capacitor 1 resistor or 1 inductor 1 resistor then there is only 1 energy storage element and it is called a first order circuit. The term order the objective order has another connotation which will come to in a minute. Now suppose a circuit has 2 capacitors and let us say 5 resistors. Now would the order of the circuit be necessarily equal to 2? No because the capacitors may be trivially connected for example if 2 capacitors are in series then you know this behaves like a single capacitor of value C1 C2 over C1 plus C2. Similarly if there are 2 capacitors in parallel then they behave as a single capacitor of value C1 plus C2. So you must be careful the number of energy storage elements does not determine the total number of energy storage elements in a circuit does not determine the order of the system. What determines the order of the system is the total number of mark the word independent. If there are 2 capacitors which are not trivially connected then the circuit shall have an order 2, alright. For example let us take a couple of examples. Suppose we have a circuit like this C, there are 2 capacitors C1 C2 a resistance here then a resistance here and a resistance here. The order of this circuit is 1 because C1 and C2 are in parallel they behave like a single capacitor. Number of resistors does not affect the order of the system alright. Number of resistors do not contribute to the order of the system it is the total number of independent energy storage elements. On the other hand if I have a circuit like this alright these 2 capacitors C1 and C2 cannot be combined with each other in any manner because there is a resistance connected here and therefore this order of the circuit is 2 alright. So one thing that we learn is that the number of independent energy storage elements in the circuit independent mind you that is not trivially connected determine the order of the circuit. Let us take another example. Suppose we have 3 capacitors in a loop like this and let us say this is the circuit C1 C2 C3 are these 3 capacitors? These capacitors independent of each other obviously they are not trivially connected you cannot combine C1 and C2 or C2 and C3 right. They are neither connected in series nor in parallel. They are not trivially connected but are they independent? Can anybody answer this question? That means they are not independent since I am asking the question that is the answer is no is not it? No that cannot be that cannot be the logic it must be the logic. Say it again say loud. What are you afraid of? That is correct. You see KVL is true KVL is valid and therefore the potential difference of C1 potential difference of C3 and potential difference of C2 cannot be independently specified. So the voltage across C2 for example if you specify VC1 and VC3 VC2 is automatically specified and therefore they are not independent of each other and the order of this circuit shall be 2 because only 2 capacitor voltages can be independently specified. We will go deeper into this uncomfortable questions a bit later but for the time being for the time being let us be happy with the with the identification of order of a circuit as the total number of independent energy storage elements. Now is it necessary that all the energy storage elements should be capacitors only? No. One could have a combination of inductor and a capacitor alright. You could have 2 inductors and 1 capacitor and still the order could be 2. Is that possible? Yes. Because the inductors could be trivially connected alright. Now how is it how is it that the natural response natural response of a circuit is determined by energy storage elements and not by resistors? Well the this statement has to be taken as a pinch of salt alright. Suppose you have a capacitor an isolated capacitor you charge it to a voltage of V0 and leave it understood leave it alone. Well it will never lose charge its natural response will be V0 whatever V0 you have said it will be V0. So there is no this such things are completely boring to an engineer. If if a signal a voltage or current does not decay with time or increase with time or value with time it does not qualify as a signal alright except for power supply. Power supply is necessary even because you cannot you cannot operate transistor circuits and operating circuits without a power supply. The power supply is a constant DC you require a DC there but in all other cases what you require what you require to be able to perform a given function are voltages and currents which vary with time. Well therefore in order that the natural response becomes interesting to an engineer there must be a resistance somewhere right a purely capacitive circuit totally capacitive circuit left to itself shall conserve all the voltages that is not given to it. A totally inductive circuit shall conserve all the flux which has been generated in it and therefore we do require at least one resistance otherwise the natural response does not make sense alright and you could have for example an inductor in series with a resistor well this is the equivalent circuit of a practical coil. If you wind the coil around the former this is the practical circuit you get an inductor in series with a resistance and suppose suppose you have a switch here alright which which is originally connected here and there is a current source I0 here originally connected here then if sufficient time is passed the inductor current inductor current shall be equal to I0 alright then at t equal to 0 the switch is thrown open to this point which is connected to ground alright at t equal to 0 the switch is thrown to the other contact then the current generated is disconnected and the flux generated in the inductor due to the current I how much flux L times I inductance times the current this flux now finds an easy path through this and therefore therefore the flux gradually decreases or the current in the circuit I which at 0 minus was equal to I0 I of t shall decrease as t increases I of t decreases as t increases and that is the natural response this is what is of interest to us and we shall explore this point further on Friday. So we say in natural response we can have a charge energy storing device which energy stored but we cannot have external voltage. So initially this charge then it is left the sources are removed.