Hello and welcome to today's lecture. So, right now we are in module 2 of the course on Microwave Remote Sensing and Hydrology. And before I begin the lecture, let me give you a quick sneak peek into what is included as part of this module. So, it is titled Imaging Radars and How Do I Interpret? So, here we shall be learning about what is synthetic aperture radar abbreviated as SAR and how are these images formed? We shall understand SAR as a complex number and learn about the different types of SAR imagery. In addition, we shall also be learning about key terminologies like azimuth resolution, ground range resolution, a backscatter, sigma naught and so on. And slowly, we shall introduce ourselves into the image defects, the geometric and radiometric distortion and we shall learn about what is peckle, the different data formats in which SAR data is being made available and what are ratio images. And slowly towards the end, the concept of texture, contrast and polarimetry shall be discussed. And remember parallel to the lectures, we shall also learn how to work with SAR imagery in SNAP and Python through the upcoming tutorials. Alright, so with this background, let us move into our first lecture of module 2. Let me begin today's lecture with a question. You know, when we mention about SAR images or for that matter radar images captured by satellite, where do these satellites exist? Now for that, we need to go and view the earth from a higher altitude. So, what you see here is the Jim Khanna ground of IIT Bombay. So, let me move a bit farther and farther away into the exosphere and let us assume that these satellites are say about 600 kilometers from the earth surface. So, assume we have a satellite which is looking towards the earth. So, the region that is illuminated in light blue color that is known as the footprint of the satellite that is at an instant of time, the area on the earth surface that is viewed by the satellite is known as footprint. Now again, you know, let me start with the question as in how do satellites detect microwaves? Since we are talking specifically about microwave remote sensing. Remember the example I gave you in one of the earlier lectures about radar guns and then I mentioned that radars send out microwaves which then hit the target, come back, they are received back at the receiver and the time of travel is used to compute the range that is the distance from the target on the earth surface to the satellite. So, let us try to understand this clearly comparing it with echolocation of bats.  Similar to radars that send out microwaves just like the microwave used in your kitchen oven, you know, it sends out microwaves and then it gets the echoes back from the ground to create an image. Now again, why am I comparing bats and radars? Because both of them can see in the dark. So remember when I mentioned in one of the previous lectures that microwaves have the ability to penetrate through clouds, which means they are not blocked by clouds, they can see in the dark as well as through bad weather. So, it provides all day, all night weather sensing, pretty powerful. So, now I mentioned that radar sends pulses and these pulses hit the target. So, by target here I mean the earth surface and then the echoes that return from the earth surface travel all the way through the atmosphere and they get captured by the satellite. So, here as I mentioned earlier you see the footprint and then whatever is highlighted in red is the echo that is getting scattered and then which is pointing, returning to the satellite and of course you have some amount that is lost, you know, that are getting scattered in different directions which are again indicated by small elliptical drawings. So, you have the footprint, the radar sends the pulse, the pulse hits the target, some amount is scattered in different directions and some amount of this is scattered and then it is returning back to the satellite. So, for an example, let us try to understand how a single pulse is traveling. Now shown here is the illuminated area from the instrument. So, now I am not showing the instrument, I am showing the illuminated area and now we can see that the pulse sent from the satellite is traveling towards the illuminated area and then it hits the target and the resulting echoes are getting scattered. As I mentioned before, some of the echoes go back to the radar and they are the ones that shall be registered to create the image. Now, once again what the satellite would observe would be these few echoes that are getting scattered back.  So, I am confused because how does the satellite differentiate between two echoes that come from two different targets because we need to understand what target has caused what echo and then how bright it appears on the radar image which means there should be some mechanism by means of which we need to separate these echoes from each other. So, if we can estimate the exact time at which each echo was received back by the satellite, we can calculate the exact distance of the target from the radar, is not it? And by some means we need to differentiate the echoes from one another. So, for this we need a solution and to explain the solution, let me take the help of sound waves. Assume I am playing you three keys, I am taking the example of sound waves and if you are a music lover I am playing you three keys that is three piano notes in E4, A4 and G4 frequency which is mentioned here. So, let me play you the first audio. You hear the three piano notes separately, is not it? Again why are we doing this? Because we are trying to understand the mechanism by which satellite, radar satellite gets to differentiate between the different echoes that are returning back after getting scattered from different targets on the earth surface. We are trying to understand it through a simple example wherein first I played you three piano notes. Now, let us introduce an echo. You hear the same notes but you are able to identify or differentiate when the echo is received back, is not it? Because every time an echo is received the pattern of notes is repeating itself from the beginning and I am able to identify it clearly. Which means if I replicate this somehow in imaging radars, we shall be able to identify and differentiate between individual echoes. So, what did we do? We tried listening to three piano notes separately without echo and then the same three piano notes again with echo and because you are familiar with the pattern of notes, it is easy for you to differentiate when the echo has occurred correctly because you are aware of these notes. In a similar way, if an imaging radar has some mechanism by means of which this can be replicated, it is easy for us to differentiate between echoes as well as differentiate between the different targets that has resulted into this echo. So, let us move forward. At this point, it is worthwhile to remember that when the pulse is incident on the near part of the footprint, that shall send the echo first. And as it moves through the footprint, more and more echoes will be sent out. Now, there is still one more problem because we do not know where the echo has exactly come from because there are certain regions which are denoted by the blue lines within the footprint which are equidistant to the radar, which are at equal distance to the radar. So, which means if there is an echo, it can be from any point on the line but we do not know where exactly the echo has come from. So, let me try to explain it with a simple example. So, what I have done is I have divided the footprint into two. One is the shaded hatched region here, the front portion and the backside is left as such and there is a center line separating the two regions of the footprint. This is the center of the beam. Assume this is the center of the beam. So, remember the footprint is not stationary as the satellite is moving, the area illuminated on the ground is also moving. So, all of these that is towards the right side, they are moving towards the satellite with the satellite and all of these that is towards the bottom, they are moving away from the satellite as the radar is looking sideways and as footprint is the area that is illuminated on the ground that is the area that the radar sees as it is moving. So, here let me try to introduce the Doppler effect and we gave the example of an ambulance or any vehicle with a siren. When it approaches you, you observe a change in pitch and even if the vehicle with the siren is stationary and you are the person moving, still we observe a change in pitch that is relative. So, let me come back to the radar. So, given the pitch of an echo, we can estimate where exactly the echo has come from. With all this background, the next question is how bright do these echoes have to be in an image? Which means, these echoes how do they appear in the image? How bright do they register in an image? So, at this point, image we can define it in the form of a matrix of numbers, they are made up of different pixels, image made up of different pixels where by pixel I mean the smallest unit of an image and generally we consider image as a matrix of numbers. So, in simplified terms, small objects shall give rise to smaller echoes and larger objects shall give rise to larger echoes and these eventually get recorded in an image something like this, with bright and dark pixels. Larger echo, medium echo, smaller echo. So, if we zoom out slowly let us try zooming out what you see here is the IIT Bombay campus and then you can see the Powai Lake and let us zoom out a bit further, we see the Mumbai Metropolitan Paths of Maharashtra and what you see here is a sample of synthetic aperture radar image from Alo's Pulsar that is captured in the L band. So, now we know how a synthetic aperture radar or SAR imagery is going to look like. Remember we have still not introduced the technical terminology, we have been trying to understand it in simpler terms. So, what we will do is let us try to talk a little bit technical now. So, we started with the operation of a radar and that is when I mentioned that a radar system is able to effectively measure distances by transmitting large power microwave pulses to illuminate a target or a surface and by making extremely precise echo delay timings. So, the two way distance between the antenna and the target which is known as the range, the distance is known as the range, it can be computed by using the simple relation c tau by 2 where c is the speed of light, tau is the duration of pulse and why are we dividing it by 2 because the two way travel is considered, travel from satellite to the target and from target back to the satellite. So, then let us come back to our original question you know how to detect or collect and then quantify microwaves. So, remember I am making a distinction between collection and then quantification because our interest is to estimate the average intensity or the energy of radiation at microwave frequency. Of course, it may be of interest to measure other properties of the electromagnetic radiation like say polarization or the phase. But remember I am making distinction between two terms here how to collect the data by data I mean microwaves right now and second is how to quantify it. So, let me introduce antennas here which collects the incoming radiation. So, till now in the initial parts of the lecture we were just referring to satellite sending pulses and satellites receiving pulses. Now, let us be more specific and I am going to mention that antenna collects the incoming radiation antenna on board a satellite and receiver amplifies and detects this collected radiation ok. Sometimes a third element is also essential which is specific to measurement technique which is data handling system which is normally used for digitizing, formatting, calibration, housekeeping of data etc. So, since we are talking about imaging radars. So, imaging radars generally they tend to have huge data rates that the bulk of processing has to be carried out by a separate system within the ground segment. We will discuss about that shortly in upcoming lectures. But just to be clear in remote sensing literature the visual metaphors dominate you know it is the visual metaphors that exist widely because always in remote sensing the eyes and the camera lens are considered as examples of remote sensing instruments which capture information about a target without coming into physical contact with the target. Unfortunately, you know our familiarity with remote sensing in the optical region or visible region is not going to be helpful here because we are discussing about microwave remote sensing. So, if I have a background on remote sensing I will be refraining from understanding microwave images using the example of eyes or camera lens. So, here I would insist that you compare microwave systems analogous to your ear you know analogous to your ear. So, because we as humans how do we detect sound when you are say in a dark room which is pitch dark. So, as soon as you hear a sound you are going to automatically turn your head and your ears to the direction of sound isn't it? And this motion of your head points to the direction of highest sensitivity of ear towards the sound source isn't it? Let me play a video for clarity so that you assume ears analogous to a radar antenna which has to point towards the direction of highest sensitivity towards the source of what of microwaves. Now at this point let me again mention that the transmitting and receiving antennas can be different. So, transmitter and receiver the transmitting and receiving antennas can be different but then it is usually more efficient for the same antenna to both transmit a narrow beam as well as receive a return signal. And microwave systems as mentioned here will collect energy from a comparatively wide range of directions even though it may be more sensitive, most sensitive to a small range of angles. We will follow this up with the relevant derivations but for now I want you to understand that microwave systems they compare they collect energy from a wide range of directions even though it is most sensitive to signals within a small range of angles. So, in camera an aperture opens to let light in isn't it? So, similar to that in microwave remote sensing an antenna on a spacecraft or an aircraft it can be considered as an aperture synthetic aperture radar okay aperture. So, an antenna on board a spacecraft or an aircraft can be considered as an aperture and re-iterating and the use of decibels in microwaves is very common okay just a fact for us is our ear sensitivity to loudness has a logarithmic relationship with power okay. So, till now we have made a distinction between antenna and a receiver and we mentioned that it is usually efficient for both the antenna to transmit as well as receive the signals. Now let us try to understand what is synthetic aperture radar SAR. So, generally larger or longer the antenna more is the information that can be obtained about a target okay but in real world antennas in space are not that large or long. So, spacecraft's forward motion is used along with signal processing techniques to simulate the existence of a long antenna large antenna. So, what are we doing? An arbitrarily long antenna is synthesized by recording the echo or the signal as the satellite moves forward along its orbital track and the results are combined with appropriate techniques which we shall discuss later but for now I want you to understand how synthetic aperture radar functions. Synthetic what does synthetic mean? It means something that is not existing okay you are artificially creating. So, here by synthetic aperture radar I mean an arbitrarily long antenna is getting synthesized because with the movement of the satellite along the orbital track signals are being collected what you see here are the footprints it is also combined with appropriate techniques to generate synthetic aperture radar imagery okay. So, with this background let us try to discuss in detail about SAR images. In the first module we discussed about electromagnetic waves what are amplitude, what is wavelength, what is phase, what is frequency. So, whenever an electromagnetic wave is getting scattered from a position say a position x, y, z on the surface the physical properties of the terrain cause change in both the phase as well as amplitude of the wave okay. Let me rehydrate an electromagnetic wave when it strikes a target on the surface of the earth the physical properties of the terrain are going to change the amplitude of the wave as well as the phase of the wave and what a synthetic aperture radar measures is this number pair that is a cos phi a sin phi where a is the amplitude and phi is the phase because of which SAR data are also known as complex images okay. In the middle of the lecture I mentioned that image as a matrix of numbers now let us go a bit further and say that SAR data that is synthetic aperture radar data are also known as complex images. Now revisiting SAR as a complex number we already discussed what the bright and dark pixels mean that is the strength of echo received and if I zoom into one single pixel it is going to be a complex number with real part as well as imaginary part okay just for you to visualize what is happening because the phase as well as amplitude is changing whenever electromagnetic wave is striking the target. Now there are different types of SAR imagery okay because from the complex image a variety of other products can be formed for example images of the real part images of the imaginary part amplitude images phase images intensity images log intensity images and so on. So using the complex image of SAR using that we can also create a variety of other products. Now here the use of intensity is synonymous with power or energy. So shown here is the amplitude image again from LO's Pulsar data by now I assume that you know what is V and what is H vertical and horizontal polarization and shown towards your right side is an intensity image in VH polarization vertical horizontal okay and this is again of parts of Maharashtra. So typically the real and imaginary images they show some structure but then they appear extremely noisy you can see the noise which is pretty evident in both these images isn't it and usually the face image is noise like and does not show any structure while the amplitude and intensity and log images though they are noisy they are relatively easier to interpret. So which means out of all the types of SAR imagery the amplitude and log images are preferred usually preferred since the large dynamic range of intensity image can reduce the perception of detail okay. So to summarize in this lecture we started our class with an understanding about imaging radars the basic operation of a radar and in simpler terminologies we understood how a synthetic aperture radar images formed we understood what is an aperture and then put together what is synthetic aperture radar how do SAR images look like and what are the different types of SAR imagery and we have just started understanding SAR images as complex numbers. I hope you found this lecture informative and I will see you in the next class. Thank you.


the two Come on that was sick. How's he going everybody? Dato do I hear back with another round of dragon ball fighters rank matches this time playing the suggested team of Krillin Piccolo and Yamcha. I guess it's like a pseudo Saiyan saga I mean Yamcha wasn't there for the longest, but he was there. He was doing some training. All right I just hope Goku blue doesn't oh The confidence in the run-up down heavy was too much that was hitting regardless dude that was so Sick finally the 2m comes in clutch the two. I mean not the 2m, but the the post The two Come on. That was sick. He thought that was gonna be a fake again But that was just a real genuine light after of it Okay, but can you take two ah? So you can't take two two beams not a problem for this guy All right, he's got the young to TN. I'm done for Yamcha player. We are he's a young to player as well Hold on. I gotta respect him. I gotta respect the art form. I Didn't respect the art form there. Ironically did not respect the Yamcha art form regardless of saying it six times Yeah, guard cancel kind of eat the option alive. I was very lucky. The jabs just went my way there demon elbow Oh, that doesn't work It didn't work exactly I put tag Come on Krillin. I Am the dumbest man alive No, I'm guard cancel you get it. I deserve this. I deserve whatever whatever happened there.  Why did I grab afterwards? Now that will forever remain a mystery. I wanted the spark did not want what came after They were good. Oh, come on Okay, pick a little just go ahead and leave you've caused me more trouble than you're worth Thank you Fortunately, also lost the ton of blue hot yamcha the panic out to assist knows no bounds except for this Getting real rough out here now. There we go. Go clean it I'm just gonna go ahead and pop this real nice and fast try to get a mix if we can I don't think so. I think he might pop spark in here Doesn't matter. I kind of got stuck in the it doesn't matter. We got to kill anyway There we go. Oh my god, I thought it dropped, but we're good All we have to deal with is a level three sparking option not even too much health left on the docket God if I could win this I feel so good Get down get down.   Control it control the neutral. You might be able to kill here, but maybe not Depends on how fast the burst. Oh just fast enough dude. We almost got outpaced Dude shout out to the after images there. They really helped out that man Yo Krillin looking fine. Everybody else that this team is bruised up Krillin's like wait.  You almost messed me up there. We should be good now. Just calm down calm down Good super-dash Dude was it obvious I was gonna throw those keep on who's switching The low was real fast there. I thought he was gonna go for a overhead Just one quick one. Well, he was falling. You didn't have to be too complicated If you're gonna give me that much time to mash. I'm out. Oh, I didn't have it and that corner carry was kind of ridiculous I should I knew the super-dash was coming there, but I felt like maybe if I could beat it Wow level three Spending all three bars getting Goku back. Is it time to spark? It just might be I don't want to really take a mix here All right, the spark was definitely worth it. Now if we could kill here, that would be the real I Wasted too much bar. I Wasted too much bar now. I just kind of have to play around that Yep, I respectfully disagree. Oh No Help me click a button dude.  I'm gonna start playing for that. It didn't block it. It did not block it in time Medium I'm gonna stay down He dragon rushed But why? But it was a mate, but it was great. That's why oh If I just didn't wake up reflect that would have been a two-in punish that that would have pretty much guaranteed that was sick, dude I'm feeling good about this game I was almost so sick. He's gonna down take care. Why did I do this? Why? Well, I guess it doesn't really matter He was dead regardless, but I definitely could have left that 2h rock a little more. Oh, excuse me All right. All right. Do I slow the pace of the game down or do I keep it up? Let's slow it down a little Just a little just a little I don't want to slow it down too much Yeah, let's go. All right, I slowed it down real nice there. I was gonna take my time I think too many times against the ends.  I think but yeah, I was really again I was trying not to mentally outplay myself He's realistically if you have a character lead in this game, you should win unless it's like I mean, there's special cases like Super Saiyan Goku with so much My boy rushed me Switching any super dashes anything you want to say? No. All right, then get on. Let's go. I'm coming in any Super Dash Oh, there we go. Oh, no What up, Krillin? Oh, we're not Going up down to the ground. Let me see. Oh Krillin.  Let's get it. I actually have not used that properly ever I don't think that's something I've always thought of but I just don't do for some reason Which really I should do more of like tech dragon rushes. That's another thing I should do more of But yeah after image in the corner might be really nice. That's a really nice tool Don't think about it too much. But yeah, it's good. All right. Hold on. I got to block this I got it down back at real quick. I hate when people find my kryptonite.  Was it too off?  Yamcha's in the back. Thankfully dude. Thankfully Yamcha's in the back where he that's the that's why he's the anchor Okay, okay, we're cooking. We're cooking with gas. Oh We're not cooking with anything. Oh We're not cooking with anything. We're not cooking with anything you ready? Come on Piccolo. No talk to the man hit him with your head.  I can't take the mix anymore. I don't want to get mixed. I don't like to mix Well, at least yamcha's made a full recovery, but seven bars Why am I holding on to seven bars jump over me? Yeah, that's good Okay, come on. You know what I should probably switch in yamcha. Oh Yamcha get this man mix mix mix mix mix mix All right, you drag and rush me. Do I drag and rush you back for that? Could let it rock No, he just jab me up. Whoo. He's gonna go behind the back No, he's not jab jab jab Nobody ever finishes that for some reason. Obviously the reason is it's negative, but Come on, dude. All right. All right. Hold on You don't want to compete.  Am I really giving up two bars this to do this? And go.  What am I doing? Oh no, stop stop stop. Stop clicking buttons. Stop clicking buttons major alert major alert Major alert. Oh god. I'm not going anywhere, dude Let's go. We take a win whole lot of points going around and this was the yamcha be yamcha match Actually, no, this was the after image a match. What am I talking about after image is everywhere. See you around, dude Thank you for the games dark biscuit. Hopefully the person that suggested this team enjoyed it Hopefully and hopefully you guys enjoyed it as well. Thank you so much for the suggestion If you want to leave me one yourself You can do so down below in the comments But while you're down there make sure to leave a like and subscribe to the channel If you're enjoying all things fighting games here It's a lot of fun And I appreciate the likes as it lets me know you guys want to keep seeing this other than that though There's also some videos on your screen that you can check out if you missed any of them or any of them catch your eye And once again, thank you for watching this video to the end I've been dr. Dua, and I will see you in the next one


So in my last lecture we looked at least square approximations, method of least square approximations was used to discretize a boundary value problem. Now unlike orthogonal collocation or finite difference where we took some finite number of points and force the residual to 0, in this case we said that some of the square of something similar to some of the square of errors that is here integral square of the square of the residuals. Now we wanted to minimize that instead of setting it equal to 0 in the domain we wanted to minimize the square of the integral over the domain. So this was conceptually different from what we have done earlier and we looked at a specific problem. So the problem that we looked at was a linear problem. So we looked at solving this, so this was a boundary value problem with two homogeneous boundary conditions equal to 0 and then we wanted to get a solution for this problem. Now we constructed an approximate solution not exact solution. This approximate solution was u cap z was where u1 cap to um cap are some known functions and idea was to find out idea was to find out unknown coefficients alpha 1 to alpha m such that so we want to if we say theta that is equal to alpha 1 alpha 2 alpha m if we define this vector theta then we wanted to find out theta least square that was minimize with respect to theta norm of l u cap z minus fz 2 square. So this is nothing but the residual this is nothing but the residual square or integral of the residual this is minimize with respect to theta inner product of l u cap z minus fz. So we wanted to find out least square estimate such that well we had chosen the basis functions in this particular case such that the boundary conditions are met. So we had a special case and then with this we derived the normal equation we derived something that look like a normal equation. So basically idea was to minimize this with respect to theta. So here between any f and g or say h and g inner product is defined as 0 to 1 f tau. So this gave us this gave us the equation that was needed to solve this particular problem. Now to minimize this or to get the solution if we take this as phi if we take this objective function to be phi then we use the condition dou phi by dou theta is equal to dou phi by dou theta is equal to 0. This particular condition can be used and you can obtain alpha 1 to alpha m numerically but in a special case where l is the linear operator we could get the so called normal equation we could get the solution analytically. If it is not a linear operator we will not be able to solve alpha 1 to alpha m analytically we will have to use some numerical optimization to get the solution and then whether there will be a unique minimum and all that is not guaranteed but in this case when l is a linear differential equation we could actually find solution to this problem that is we could find theta l square analytically using equation that look almost like normal equation. So this was the way we went about doing this. Well there is a small modification suppose here what you do if you want to take a general case and see what if this is alpha what if this is some a and this is some b they are not equal to 0. Suppose this is equal to a and this is equal to b and so well in that case what we do is we do a simple linear transformation and then try to map it to 0 to 1 in such case we define instead of uz I will call a new function say vz which is I will define a transformation I will define a new variable vz which is uz plus b minus a times a plus a what will be vz you know in terms of this new variable in terms of this new variable I will get it is very easy to see that I will get l just check this we will get z1 and z0 so we can do a little bit of a transformation can do a transformation here at 0 at uz at z equal to 0 okay you will have this is 0 okay sorry this is a this is a this will be okay so now uz equal to vz plus so now it will fall out now it will work out so uz is equal to vz plus b minus a times z and plus a so we take let us take a specific operator that we looked at yesterday so instead of l let us look at the specific problem that is d2u by dz square minus uz is equal to 1 this was the problem that we looked at okay if you use this transformation then the transform problem will be d2v by dz square minus v is equal to 1 plus b minus a z plus a so this gets transformed to this and you can check here boundary conditions get boundary conditions in terms of u will become in terms of v will become v0 is equal to 0 v1 is equal to 0 just just check here so at 0 at 0 we have at 0 we have this nicely following and at 1 well will it be vz is equal to at c equal to 1 so if I put 0 here if I put 0 if I if I put b here so b equal to yeah 0 0 will cancel and bb will cancel and you will get 0 v0 so the problem gets transformed like this so this is one way of dealing with the problem the other way of dealing with the problem is modifying the definition of inner product so now we have to work with instead of working with the space of twice differentiable functions we have to work with product spaces and define a inner product slightly differently so this is one way of dealing with non-homogeneous boundary conditions you could do a transformation and then solve this problem so when you take derivative of this second derivative of this this will disappear right I am taking second derivative of this second derivative of this will disappear this part will disappear what remains is still d2 v by dz square and then when you substitute this for u here when you substitute this okay it will be minus of this which on this side will become plus so the problem gets transformed to this problem and the solution will still work but there is more general way of this is this looks like a fix by which you know we have done some transformation and we got this a better way is to change the definition of the inner product itself so what we can do now is that this equation which we are looking at this equation that we are looking at L is a map from L is a map from twice differentiable continuous functions to set of continuous functions over 0 to 1 cross r cross r this we have seen so this is the product space and now we have to define the inner product in slightly different way so if I define the inner product see this I have to define the inner product on this space and if I define a proper inner product on the inner product on this space then I can solve the problem in slightly different way so what I do now is I have to define a inner product I want to define a inner product of a function say h ht then a scalar c1 and a scalar c2 with inner product of with gt c3 I am defining inner product on this product space I am defining inner product on this product space now this inner product will be modification of this inner product will be modification of this plus w some positive weight which is w1 times c1 c3 plus w2 times c2 c4 the inner product now the inner product now is defined as integral of ft gt inner product is defined as this is ft gt plus w1 times c1 into c3 w2 times w1 and w2 are positive weights okay so w1 and w2 are positive weights okay so with this with this what I can do is earlier how did we how did we derive how did we arrive at the optimality criteria we defined the residual square we defined the residual square and then we took derivative with respect to theta remember that we took derivative with respect to theta theta was nothing but also our alpha to the multiplying coefficients with the basis functions okay so now with this with this modified definition of the inner product what what happens is the residual square that is 2 log of residual this is equal to residual okay actually residual will be will have to be defined so I should say I should say residual and okay now I am taking three residuals one residual is over the domain okay now that is that will be taken care by integral over 0 to 1 and the two residuals at the two ends two boundary points okay I am defining two residuals and now I am going to take square of this so my objective function which I minimize is going to be this plus this plus this so the way it will change is this integral it will be it will be so this will be equal to 0 to 1 okay see now just look at this this was already there earlier we are minimizing this earlier right in addition now I have two terms I am minimizing difference between u0 and a b0 and u1 and b okay now when I actually minimize this so how do I get how do I get theta what is my approximate solution my approximate solution is my approximate solution is u cap z is alpha 1 okay and my theta is this vector alpha 1 to alpha m okay and here this residual square okay this residual square I am going to call as phi and then how do I get the conditions to how do I get my conditions to solve the problem it is dou phi by dou theta is equal to 0 but now phi is going to be this so there are two additional terms okay now the trouble with this approach is that the boundary conditions will not be exactly met that boundary conditions will be met in the least square sense this equality may not be there you know well you can make it you can make it you know go closer and closer by increasing this weights you put more weight to this the optimizer will try to squeeze in and make sure that u cap 0 and u cap 1 are closer to each other okay now by this approach I do not have to choose the functions which are giving this equal to this and this equal to this okay let us say I am choosing shifted degenerate polynomials the two boundary points are not you know a and b but by this approach I can choose the coefficient such that some of the square of you know difference between the solution and the exact boundary condition is minimized and together with you know the differential equation is obeyed in the least square sense not exactly equal to when I minimize this when I minimize this this term will not be exactly equal to 0 because I am minimizing I am finding a least square solution okay true solution for this problem will be some you know infinite dimensional space I am taking a finite dimensional approximation okay so that is how I get a solution here that is that is one way to solve this problem now there is one more variant of this method okay this is the method of least squares and you will get of course that equation by which you can get analytical solution of theta if l is a linear operator then you will get a close form solution for theta and once you get that close form solution alpha 1 to alpha m will if you put those values back you will get this least square solution of okay so by this approach now I could choose a polynomial expansion nothing stops me I can choose a polynomial expansion here so this functions could be you know one t t one z z square z cube up to z to the power m and then I can minimize this objective function with respect to alpha 1 to alpha m and get my solution okay so earlier particularly for Taylor series approximation and for approximations using orthogonal collocations we were only considering you know interpolation solutions we are mainly considering the polynomial approximations here too if you want to work with polynomials in principle you can work with polynomials not an issue okay so that will not be a limiting factor so but we have choose we might we can as well choose some convenient basis like sine cos or shifted general polynomials and work with that okay so this almost now brings us close to end of this discretization there is one more point to be discussed now this is this is a method called Galerkin's method and I am going to just briefly touch upon this method in Galerkin's method we do not attempt to minimize we do not attempt to minimize this okay in least squares method we try to minimize the sum of the square of errors okay Galerkin's method is just an extension of just an extension of the idea of projection okay just an extension of idea of projections now I am not going to derive it in any way I am just going to propose this method and what is the basis for this method should be now clear to you when I write the equations the basis is idea of projections okay so what I am going to do in Galerkin's method what is different here is that we do not put this objective function we do not put this objective function or we do not put any of the minimization problem and so on but we use one fact see what we know in projections that the error should be orthogonal to the subspace span by the basis okay whatever is the subspace which are given so here if I take a set if I take a subspace S which is defined by span of u1 cap u2 cap um cap okay then I could derive I could derive an approach let us say I have I have defined my inner product like this okay I have defined my inner product like this I am not interested in minimizing the square of the residuals but what I am interested in doing is just using the fact that when you do projections the error is orthogonal to the subspace okay so what I am going to do there is I am going to say that u1z u1z is equal to rz this is equal to 0 I want the error I want the error to be orthogonal to the subspace span by okay this u1 to um so I am just taking this basis vectors and I am forcing the condition that this to be equal to 0 okay this I have to use together with my two boundary conditions to solve the problem now you may not be able to force it equal to 0 for all the points in some cases because in some situations where you have boundary conditions you may want to force it force this equal to 0 only at m-1 vectors and then two points come from the boundary conditions because two conditions will arrive at the boundary conditions I will look at a specific problem to just give you an insight let us go back to the tram problem now this particular condition this particular approach of solving will reduce to the square problem when the operator is linear okay when the operator is linear the square method and Galerkin's method will become identical but when the operator is not linear okay so you will get a solution which is which is different so this is this can be applied Galerkin method can be applied to any other operator which is not necessarily a linear operator it could be a non-linear differential equation and you are trying to solve it and basically what we do is we do not get into minimizing the residual we just say that the error between the solution and the subspace okay that error is orthogonal to the subspace by the basis functions of the solution that is the simple idea which is used so this is let us go back to the tram problem and now that you are solid it using orthogonal collocation and finite difference you will be able to appreciate this third method how do you choose this basis functions you know how do you choose them to be orthogonal there are different ways of choosing basis functions here we actually get into Galerkin method is belongs to the class of finite element methods and you will because it involves this particular method would involve integral over the entire domain this methods tend to give very accurate solutions and I am not going to get into the details of how do you choose these basis functions you know there are some continuous basis functions which are like no cap function and so on so if you want to know more about this well it is there in the notes you can check this also book by Gilbert strand okay his latest book on applied linear algebra and his first book on linear algebra with applications both of them give you very very good introduction I think the latest book on computational science and engineering here is the latest book on computational science and engineering and the other one is on linear algebra the second one gives very detailed introduction to this topic but this becomes little more involved I just want to mention this more for the sake of completeness so if you go back to our TRAM problem so this is 1 by Peclet number into d2c by dc square so this is the problem with two boundary conditions dc by dc is equal to Peclet number into c-1 at 0 and dc by dc is equal to 0 at z is equal to 1 you already know about this problem and what I am going to do here now is my solution here is going to be this is going to be my approximate solution okay and to get the equations what I do here is to get the equations so this integral or this inner product this inner product is equated to right hand side is 0 anyway right hand side is 0 for i is equal to 2 m-1 so we equate this we equate this to 0 for i is equal to 2-1 now this is you know even if you take some nice functions just remember that I have to take second derivative of that first derivative of that and then square of this function and then calculate all the integrals okay it is a fairly involved job in terms of computing the coefficients finally what you are going to get is a m-1 equations in m-1 unknowns sorry m-1 equations in m unknowns we will get m-2 equations because we are starting with 2 and going to m-1 okay so putting this will give you m-2 equations m unknowns okay m unknowns are alpha 1 to alpha m okay the rest 2 equations will come from boundary conditions so these 2 equations these 2 equations together with m-2 equations will give you m equations in m unknowns whatever m unknowns alpha 1 to alpha m so these are non-linear equations and the terms that appear in the coefficients of these non-linear equations will be all integrals which you have to integrate which you have to find out okay so numerically this particular scheme is very very involved but the dividends are very high okay you get good solutions that is why you know the finite element methods FEM methods are so where is this finite business comes when you construct this basis functions you divide the domain into a finite number of elements and on each one of them you define some nice functions which are orthonormal and those functions are used to see for example one could use one of the one of these functions one of the popular functions are I mean you might wonder why where is the discretization where is the finite element business coming here okay so you define functions over this domain which look like this and so on you divided into finite domains so this is divided into say 3 or 4 domains so this is 1 this is second this is third so you have this cap functions okay which are continuous at these points in this region so you have to divide the integral from integral over the domain 0 to 1 you have to divide between this point to this point this point to this point and this point to this point you divide the integral into 3 parts and then evaluate each integral okay and then likewise you have to do it for every one of them okay these are not differentiable so there are ways to construct differentiable functions I am just giving you just the idea so you can construct differentiable functions you can construct smooth functions which are okay and then those smooth basis functions can be then so you can construct smooth functions not an issue so just to give you an idea you can construct a basis which looks like this over finite domain so this function basis over only some domain it will be non zero value it will have zero value elsewhere okay that is why it makes it into finite so because the function value is zero from here to here you do not have to evaluate the integral okay you just have to evaluate between this point and this point and because of this special class of functions that you consider what happens is that finally the equations which you get have some kind of a sparse structure okay and you can exploit that to solve some big problems so I am going to stop this Galerkin's method only here I just wanted to connect everything into place you know I am not getting more into Galerkin's method because it if I have to now expand on the finite element methods it will be fairly complex it will not be as easy as orthogonal collocations and finite difference finite difference and orthogonal collocations are very finite difference is the easiest to understand but I would in terms of understanding the complexity I would put orthogonal collocations next it is not it is not that difficult to understand it is basically interpolation and then you know you are just transforming the problem into set of non zero algebraic equations here too you will finally get non zero algebraic equations the coefficients will be integrals and those integrals will be fairly complex to evaluate they are quite cumbersome so it is not that if you have to write a program for this so that is why you get now commercial programs which can actually do all these integrals and solve them okay so all those together will give you a set of equations which have to be solved simultaneously to arrive at the solution you can do that yeah m that m is notional see you can have the problem is that here these equations can be forced only at the internal segments not at the boundary points at the boundary points you will need to enforce the boundary conditions okay so unless you use some trick what we did earlier we had modified the inner product definition right that trick could be used you know you could modify the inner product definition to include the two end points then you know then the boundary conditions are satisfied in the least square sense not exactly okay so you could play all those tricks of modifying the inner product definition and then including the two end points and then all that is possible so now see because this why that is possible because each of these functions if you look at this function here this function is defined over the entire domain okay so this function is defined over the entire domain so you inner product can be modified to include this point this point and integral over this point okay so then this this inner product here will get modified with two additional terms for the end points okay and then you can have you don't have to have your force this you can just force M1 to M and be done with it that is also possible okay but in that case see if you do this these two will be exactly satisfied if you do it the other way you know where you include those two as some of the squares in the inner product definition then they will be satisfied in the least square sense not exactly exactly satisfied okay so we have looked at now let me sum it up what we have looked at is you know method of discretizing problems from so what happens here even in this case you start with a problem which is in the infinite dimensions you construct an approximation which is finite dimensional and then finally what you are going to get here after you do all these integrals and everything what are you going to get here you are going to get M equations in M unknowns in this case there will be nonlinear equations okay if L was a linear operator if the square wasn't there you will get linear equations and you can solve them very easily okay but we have this square here so because of that you will get you know all kinds of square terms alpha 1 alpha 2 and you will have to do complex integrals of you know u1 with u1 square u2 u2 square in all kinds of all kinds of terms will appear in the integrals now because because you get because of that you will get nonlinear equations but what is happening if you realize is that a problem which was originally in the infinite dimensional space is transformed into a finite dimensional algebraic equation solving problem okay so I am transforming a problem which was originally solving boundary value problem differential equation is getting transformed into problem of solving M equations in M unknowns okay so the transform problem looks completely different from the original problem solving nonlinear algebraic equations is completely different problem from the original problem okay so there are some issues like errors in discretization so when you actually solve the problem okay see there are variety of errors that creep in see we said that we wanted to solve y inverse problem y is equal to t of x where x x belongs to some space x and y belongs to some space y we wanted to solve this problem okay but we are not able to solve the original problem in most of the cases in you might wonder well I am doing a course on solving partial differential equations and linear partial differential equations okay I can solve them analytically you know I can do all these series expansion why do I need all this just go back and check when you can solve those problems analytically you can solve those problems analytically when the boundary conditions are very nice geometry is a simple okay when the geometry is simple if I ask you to solve Laplace equation to be formulated for this room and if you do not approximate walls to be smooth walls suppose I want to say well there is a you know small lot here and then it comes out and then okay my boundary is no longer my boundary is no longer you know straight wall then suppose I have a problem see if I if I take the reality that well the you know the conductive the convective heat transfer from this wall is different at different places okay in some region there is wall okay so the they will not be heat transfer they will be you know they will not be convective heat transfer there will be some something like you know insulation okay but in between there are windows so if I take all these realities into account my boundary conditions even for the simple Laplace formula linear operator will be very complex and I will not be able to get those closed form solutions those closed form solutions work they are very nice they give us they give us insight okay and when you can approximate geometry to be spherical cylindrical okay or perfect you know square or some parallelogram you can actually solve those problems very but those you should look at them as some kind of limiting conditions approximate in this room okay with smooth walls and you know only one kind of boundary conditions across this wall and all these walls are exactly constant temperature is a simplification and probably that was relevant you know 40-50 years back when computing was difficult now you can compute you can say that well there is a small notch here and I want to compute for this what happens here okay so when even for a linear problem when the analytical solution can be found for nice boundary conditions they may not be computable when the boundary conditions become weird so even for even for linear partial differential equations you would need to solve them numerically the class of problems which can be solved analytically is very small most of the problems you know in real life have to be solved using numerical methods so you better understand this numerical methods so what we are doing here is we are actually transforming this as I said into yn is equal to t tilde xn where xn typically belongs to some finite dimensional space some finite dimensional space and yn belongs to some finite dimensional space well do not confuse this x this y and this x this y okay probably maybe I should use some other notation x and some different kind of y okay so this is some finite dimensional space this is some finite dimensional space so you have taken the problem and then transformed it okay for example finite difference method you are not able to force acetyl 2 equal to 0 at all the points you know you have to take finite grid points how to save it say that is equal to 0 so actually this problem is an approximation of the original problem this is an imposter this is not a true problem this is just you know this looks like this but not this is not equal to this okay and further see how many errors we commit first of all we are not able to solve the original problem we transform it into something which is computable then you know you say that this is this is belongs to some Rn let us say this is the transform problem is in n dimensions and this is in some m dimensions so let us say this is Rn to Rn okay n equations in n unknowns you have got and this T cap is a different operator all together we solve a differential operator these are algebraic equations you know something else now when you go to computer okay you cannot solve using real numbers you have finite precision you do everything using rational numbers okay and then see nonlinear algebraic equations you cannot solve them exactly you use Newton Raphson so you further approximate this see you started from here you approximated this from here you again approximate because you know Newton Raphson is required Newton Raphson requires tell us the approximation again okay so there are series of approximations just imagine so what you get finally okay so there is an approximation for you end up with you know you end up with yn tilde xn tilde suppose suppose the true solution of this this problem transform problem was actually y star or let us say yn star xn star and the true solution here is y star x star so the true true solution is y star x star then you have a transform problem which has a true solution suppose you forget where it came from okay that was a true solution so that will be yn star xn star okay but nonlinear algebraic equations suppose you get you are not able to solve them again okay so you get a approximation to this so that is yn tilde xn tilde okay what would be of interest to you is what is the difference between y star minus yn tilde well first of all can I compute this sometimes in many cases you just cannot actually define this because you know your true solution will be a continuous function and this finite element method for finite difference method you got some finite points so what is the error between this and this this is defined only at finite points this is defined everywhere in the in the domain so you know this this animal is difficult to even think about okay so this you start with something you want to solve something you actually transform it that also you cannot solve then you re-transform it okay what you will see that when you go from here to here now these lectures I'll start post midsem when I go from here to here again I have to use approximations again when I when I solve this problem I am going to again go back to Taylor series I am going to go back to we are stars theorem polynomial approximations interpolations same idea okay so Taylor series and you know interpolation gave me this but again I am not able to solve this so again Taylor series again you know the interpolation kind of approximations and then solve that problem okay so finally what we get and what we intend to do is completely different hopefully you know they are close and that is where your insight as an engineer comes into picture are these numbers which computer is throwing does it make sense is this close to this well in many situations many situations you do not know what is true through why or you do not know what is true x but as an engineer you have gut feeling that what is true what it what should true x look like okay you know that you know if there is a pfr the concentration of the reacting species will reduce as z you know this okay so if that is not happening here okay you know that there is something wrong computer is giving me garbage so that is where that is where in spite of in spite of all these you know advanced techniques in spite of availability of you know very very powerful computing tools we are still in business because your intuition as chemical engineers is required otherwise you know computer would do everything you wouldn't add you and me will not be required okay but fortunately that is not the case okay we still get our jobs because you have to make a comment whether this though you cannot define this difference whether this why and tilde which you get finally does it make sense okay is it a good solution so that is where we come into picture now to do all this business you have to solve many things approximately to solve approximately you have to give initial guess how do you initial guess only if you are a good physicist engineer chemist chemical engineer you can generate a good reasonable in initial guess and then you can solve the problem otherwise you will not be able to solve the problems okay so this this brings us to end of problem discretization so what we have seen till now is that first of all we have seen that a problem can be represented most of the problems in chemical engineering or engineering literature can be represented by this generic form where why their inverse problems we are given y and t we want to find out x okay we cannot solve them in most of the cases so we transform them to this problem so we have come up to this point okay now post mid-sem I will begin how to go from here to here and how to compute the solution okay so now I will get into solving tools like solving linear algebraic equations solving sparse matrix equations solving them you know using some iterative methods all kinds of things nonlinear algebraic equations we have looked at one method Newton there are many weeks enhancements how do you do those enhancements and then the second thing which we have to look at is only initial value problems because many problems get transformed to only initial value problems so how do you integrate differential equations subject to initial conditions all those Rande Kutta methods predictor character methods all their integration everything will come in that so post mid-sem we will look at tools till now we have looked at problem transformations okay


Okay guys so I'm back with another destiny video and today I bring you this top 5 warlock supers of the week. Now if you want to be in the chance of winning this resurrection is the emblem simply drop a like and leave a comment on the video details are on screen now but guys I hope you do enjoy this video and I will see you on that next one.


Hello everyone, today we are going to look into some programming aspects of this engineering statistics. So, as we know or as we discussed so far we are talking about various distribution data generated from distributions and if you are given a data we want to see that what is the underlying distribution that is generating this data and all. So, to do this we may need some tools to or mostly the software tools to analyze this data and for that we are going to talk about Python today which is one of the languages widely used in statistics ok. So, we are just talking about Python there are other possibilities like one can use MATLAB one can use R and other languages, but here I am going to talk about Python. So, to begin with we will talk about how to get the things running for this. So, first I will talk about very briefly about how to install and how to set up our environment. So, Python is very easily accessible it is open sourced you can just to go to the python.org websites and just download the latest version. So, here when we try to do this the version 3.10.6 was the latest version and you can choose whatever the latest stable version available when you visit the site you can download that. And here we are talking about installation for windows, but you can follow the instructions given on the python web page to get it installed for if you are using either Linux machine or Mac OS machine. So, once you do this you just to follow the instruction and you let check these options like you need to set this to be set up in certain paths and give access to other users use are like a standard checkboxes you do this and go for customized installation and then maybe the installer ask you to specify the location where we install it either choose a default one or if you want to put it as a separate location just specify your location and once you are done this is done. So, the python gets installed. Now with this you have a python you may just launch your terminal and run your code there whatever you code ok, but often we want execution the code to be more interactive and maybe if we have something like an IDE kind of environment is there then it is better. So, for that we will look for what options we have. One of the popular option is Anaconda and Jupyter Notebook. So, Anaconda is basically a one of the open source python distribution platform. So, it supports maybe other languages also not necessarily python it is like a very comprehensive tool you can use it. When you use Anaconda it comes with many ideas I will come to that, but just let us quickly follow the steps here to get your Anaconda installed and here you can just go to the website of Anaconda click the download and just follow the steps get to get your Anaconda installed. Again it will the installer will ask you to give you the path and it will you have to check certain options choose the options as necessary for your machine and check you need to also be careful whether your machine is a 64 bit has a 64 bit processor or 32 bit processors accordingly you select and then you are ready. As I said Anaconda is like a platform it comes with various ID tools like Eclipse, Ninja and I do not know maybe there are several others, but one of the popular ID is in it for running python code is Jupyter Notebooks and that is what we will be using that is what we will be discussing in this tutorial session. So now once you have the Anaconda successfully installed what you need to do is you need to open your terminal. Let me see my terminal is over or maybe I will just come out of this presentation mode. Now I will open my terminal here and in that I will just simply type Jupyter Notebook and this will open Jupyter Notebook and here Jupyter is an web based IDE. So when you write this Jupyter Notebook it will directly open inside the web browser. Now here in whichever directories you want to write the code or you have already written the code go to that directory. So here the codes that I have put are in this Python 001 folder I am just going there. And now I have a notebook already created Python 1, when you click it will open this where I have already written some content which I am going to discuss. And if you want a new Python sorry a new notebook you can just go here and open a new book here and do all your code executions here. So let me go back to the ones I have already created. So the first thing in any programming languages just to understand how to create variables and strings and Python gives a very easy and intuitive ways of creating these variables and strings. So let us say if I want to create a variable x for which I have to assign a value 2 I have to just write x equals to true. And if I have to create a string of word hello word I have to put it under this inverted commas and assign it to a variable which I would denote it as string 1 here. So let us see how does this work. Now I am going to run this when to run either you can click here or you can use some shortcuts like I am using a MacBook here there my keyboard shortcut is to shift and enter then it will run.  So let us say I want to see what is that x I have assigned and now I am going to simply execute by pressing shift and I return so it shows me the value that is assigned to the variable 2. And now if I want to see what is that is assigned to string 1 again I write string 1 here and write enter and you will see I see that the string 1 has this string hello word. But also Python gives us very easy way to accept inputs suppose like I want to instead of assigning value x directly here I want user to give a value here so I can for that I can use users through this function input. Let me execute this and let us see what happens so now see it is asking me to enter a number let me enter number 10 and then for the next step it is asking me to enter a string let us say engineering statistics and now I can press enter now these two outputs are shown. Notice that now I have another return I have basically converted this number x to a float and store it under num x. So basically if I want to store this numbers in a particular type then I will just use the type and then store them. And here also like because like users here just have taken input user even though I asked to enter a number if let us say user has entered some characters or maybe he just entered a number I want to store it under float so I use it and suppose when I asked him to enter a string so numbers are also some kind of string. So if users has entered a numbers as string instead of interpreting them as numbers I want to interpret the string that is what I use this function string and then store in this variable str1. So now let us see what I will get if I print this num x and string 1 so notice that since I have stored it as float it is taken stored the value I enter 10 as 10.0 and a string since I entered a proper string it has just stored it as a string. And now you can go back if you are just have a variable and you want to check what is its type you can use the function type here to get what kind of variable it is and for string you will see that string 1 you see that it is simply string 1. And here I can convert this number to string see that I use this function string on this number x now it is showing me under this inverted commas that means when it is coming as inverted commas this is clear that even though 10 is an integer but now it is treated as a string here. And now we can do this conversions between various types suppose if I have a number which is like a float or which has been given to 5.5 but I want to convert to integer I will just apply this function integer and then when I see what it is you will see that it is just shown as 5 ok. And to when we have to assign some variables we have to be careful and names to the variables we have to be careful we it is not that anything we can take as a variable name. For example, this I want to define a variable called this 10 dual curve but here 10 I have to replace by the integer 10 and I want to store in that variable value 56 if I do that it gives me error because this is not permitted I cannot use numbers and characters in defining a variable. Similarly, if I want to save this name Khuli under the variable class this is not accepted and Python will show me error because this class is a kind of a reserved variable ok. So we have to keep these things in mind like I cannot mix up numbers and characters in defining a variable and similarly I cannot use some reserved names for variables. Python allows us to do various operations and the good thing is like we can do additions and all in a very intuitive way without the syntax is so simple that we while writing they scored it is as if you are writing something on a paper. Like if you want to do this add two numbers a and b it is simply we have to write it as a plus b and if you have to subtract two numbers we have to simply write a minus b and if you have to multiply two numbers a and b it is simply a star b and if it is a division it is going to be written as a this backslash b and it is a division or with the floor that let where we ignore the fractional part then it is a two backslashes divided b and if you are only interested in the modulus then it is a percentage b and if you want to exponent a to b you have to use a this double star b and if you have to negate the number it is simply minus a. So here are some examples let us say I have this two values which I have stored in a and b here a is 34 and b is 3 like you see that like I can simply do the addition by doing this and I can print the value. So this is as simple as that. So notice that when I did a by b here that is the true division I got 11.33 like that but when I do a backslash b that is the I did a floor division I only get it as 11 the integer part was ignored. I hope these things are clear and also Python makes handling of the strings also pretty easy and very intuitive. Suppose I have two strings let us say one is two words hello and another one is word and I want to do concatenation of them it is like as if I am adding these two words or strings. So I can simply say a equals to c a plus b and when I print it you will just see that hello word. But when it did a plus b it just concatenated them back to back but if you want to add some space between the two words one option for that is like you add space by using this plus symbols here. So what it first did is like when I use this when I use this plus here it is adding space to a and after that it is adding b to that string. So that is what you will get the word which looks like this hello with a space and word. The multiplication is also pretty straightforward even if you want to use it on a strings. Suppose I have a string a b c then if I want to appear the strings three times all I need to do is take this a into 3 and if you want to add a space and then do multiply and add multiply and repeat them three times I have to add space this part will adding space and then repeat it three times. So this is how the output looks. Okay, so these are like a basic how to create variables and how to do some basic operations on numbers as well as strings. Now if you want to do now if you want to do coding maybe we have to do a lot of repeated task over numbers for that we need to check certain condition or do some looping operations. So let us look into the conditions how to check and some looping operations. First let us look into the if else conditions how it will work in Python. Suppose if you have a number n has a number and if I want to check whether this n is greater than 2 all I need to do is write it like this check whether n is greater than 2 and notice that after that I have this colon here and then I am going to check and write this like print the statement is correct and after that I do not need to write anything here. So the one important thing is after I write n is greater than 2 complete that with this colon and then print the statement but you have to properly index it align it. And for example if you after writing this you do this Python will automatically take where you should be writing the next condition here. Now let us write this now here since we have already put 18 in n this is true and that is why the statement is come out to be correct. And similarly if you want to check whether n is less than 2 I will do the same thing but now if you execute it say I am executing by compressing control sorry shift return but nothing is executed because the condition is failing. And now if you want to check we want to now check both like which of them is correct whether like the condition n is less than 2 holds or not we can first check where n equals to less than 2 put a colon there then print a statement the statement is correct if that is true else. So when I say else it is always going to be taken as a complement of this condition whatever the condition you have written for the if statement and again you have to end it by a colon and then print the statement is false ok. Now this could be expanded it is not that else cannot take any condition here else could also take a condition but in that case we have to write it as else if. So this is same thing we do in other language like c c plus plus. So if you want to check whether 2 numbers x and y let us say I want to check the condition x less than equals to y you check it and if that is true you want a statement like x is less than y and if x is greater than y that also you want to be stated and if none of these 2 holds then the only possibility is that both are equal and that you are going to write in the last case. Now we can also do so let me execute this now it is clear that since x is having value y phi and y is value 6 phi is less than 6 here is the correct value and now we can do the nesting of this under else conditions also we can put further if else for example if I want to check whether 2 numbers how they are first I can check whether they are equal if they are equal I am going to print x is equals to y else there are 2 possibilities either x can be greater than y so I write this and write the want to print it x greater than y else if x is not greater than y obviously it has to be less than y I am going to still print like this. So notice that the things is like this has to be properly this lines has to be properly indented you do not need to write like end every time like we do in you know c or c plus plus language here this end is automatically inferred by looking into the indentation. Now loops so we will stop here and we will continue discussion of loops in the next module.


TfNN, headline, news update. Welcome folks. We have the Dow Industrial has finished up $221, Nasdaq up $210, S&Ps up $45, Gold contract down $7.60 trading at $19.86 an ounce, Silver up $2 cents, $22.98 an ounce, LightSuite crude flat, $80.90 a barrel, notes and bonds, big movement out here folks. You get the 10-year up 28 ticks, remember 32 ticks is one full point, you don't see the 10 move at 32 ticks. But I guess what? You get 27 today. $107.01, the 30 up before point plus 12 ticks, had won 10, 26 in Kingdollah. Kingdollah just barely positive that gave it up. As soon as Powell came out and the Fed came out with the statement, the dollar is up but 10 ticks, had 10 ticks, had 1006, 673, Euro 105, yen trading at the price point of 150, British Pound at 121 to 1 U.S. dollar. If you heard the Fed folks, bottom line is that, you know, my take is that we're done. We're done. And I, you know, when you take a look at the 10-year, all you take a look at the home builders, look at these home builders, man, these, the market, the market is going to dictate this deal here. And these home builders took off like a rocket ship once Powell starts speaking. He had, they're all up like 5%. You get toll brothers up $3.50. You get wide price spread. You get accelerated volume. You broke the downtrend. And this was, you know, this is a decent downtrend. When we're talking about breaking the downtrend there, you're at 74, toll brothers wants to go to 84. You go into LaNah, you're going to see the exact same thing inside LaNah, you know, because what you're going to have here is that, oh, look at LaNah. This is even heavier, man. This is a trip. It broke the whole downtrend. Look at this. So in LaNah's case, you're talking 111 to 133. And what you have here, okay, is that bottom line is that if in fact the Fed's done, well, the way it works is that you get the Fed done, then you stay at a certain point and then what happens? You start going down. That being said, it's the market that's going to take it down, folks. Okay. If we go over to the 10-year right now and take a look at it, what you're going to see is that just as I said a year and a half ago, the bottom line is that the 10-year took the rates up and before, three months before the Fed moved, and what you're going to see here is that the 10-year is going to take the rates down before the Fed actually moves, because the Fed probably won't move for four or five months. Right now, the 10-year is at 4.75, and we were at 4.99 only 10 days ago. Have a great night, folks. Have a safe night. Come back and visit Tommy tomorrow morning. Kicks us off at 9 a.m.


What a narcissist trying to achieve a question Which many of us may ask ourselves And I know it's something I Asked myself for a long time.  It seems as though they do all of these mindless pointless things and It clearly seems to be very important to them. It's a big deal It's a significant part of their lives to engage in these behaviors Well, they have to pull you down and Influence your every action and decision Your every thought and feeling They have to be in control and it just make you it just may make you wonder Why? What is the purpose of that? Why do you need to do that?  There is something that they're trying to achieve By doing these things But you may not notice it initially Because you're more focused on yourself You're looking at yourself and thinking What if they're right? What if What I'm doing is wrong. What if by following their advice Maybe it could help me and Correct It gives us doubt It makes us uncertain but The narcissist is not trying to help you They will try to make you think That they're trying to help you, but really they're not Because if they were They would be doing the right things Things that actually could make a difference for you But if you look at what they're doing It's tearing you down and If they're trying to help you why would a Do things that tear you down? Of course they lack empathy They can't even see The effects that it's having on you half the time Unless you point it out to them and even then it just Causes shame and rage and then you can never get through to them, but I don't want to go too off topic of The video title here we're talking about What narcissists are trying to achieve And it really is Quite simple when you look at it. It's very clear.   Well, here's a question for the narcissist Why can't you just be?  How is that helping you in any way? Is it not just distracting you from your own misery? But yeah Probably is Anyway, it's a beautiful day today The sun is shining If it's sunny where you are I hope you all Go out and have a good time Go for a walk in the forest Or on the beach Just make the most of this While it lasts, you know It's not going to be around forever But yeah Peace, love and light to you all I'm hoping you all have a good day And I will Talk to you in another video very soon Peace