Applied Calculus for Engineers - Part 2: Vectors, Param.Equations, Partial Derivatives,Linearization | Mark Misin | Skillshare

Applied Calculus for Engineers - Part 2: Vectors, Param.Equations, Partial Derivatives,Linearization

Mark Misin, Aerospace & Robotics Engineer

Applied Calculus for Engineers - Part 2: Vectors, Param.Equations, Partial Derivatives,Linearization

Mark Misin, Aerospace & Robotics Engineer

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
80 Lessons (13h 35m)
    • 1. Promo Video

    • 2. Vectors intro - 2D

    • 3. Vectors intro - Multiple D

    • 4. Vector terminology & disclaimers

    • 5. Vector magnitude meaning

    • 6. Vector components - exercise

    • 7. Vector operations

    • 8. Forces on a box - dot product

    • 9. Cross product - intuition

    • 10. Cross product - calculation

    • 11. Electron + Magnetic Field example

    • 12. MEGA Application - Water tank example 1

    • 13. MEGA Application - Water tank example 2

    • 14. MEGA Application - Water tank example 3

    • 15. CORRECTION: MEGA Application - Water tank example 3

    • 16. MEGA Application - Water tank example 4

    • 17. CORRECTION: MEGA Application - Water tank example 4

    • 18. MEGA Application - Water tank example 5

    • 19. SIM: MEGA Application - Water tank example - Complete

    • 20. MEGA Application - Water tank - Exercise 1

    • 21. MEGA Application - Water tank - Exercise 2

    • 22. SIM: MEGA Application - Water tank example - exercise

    • 23. Mega Application - Water tank massflow

    • 24. Distance VS Position vectors

    • 25. Displacement VS Velocity VS Acceleration vectors

    • 26. Graph Displacement, Velocity, & Acceleration vectors

    • 27. Acceleration vector - intuition

    • 28. Vector derivatives

    • 29. 2D Cartesian VS Polar coordinate systems

    • 30. 3D Cartesian VS Cylindrical VS Spherical coordinate systems

    • 31. Apply 3 dimensional coordinate systems

    • 32. Going from Polar to Cartesian

    • 33. Going from Cartesian to Polar

    • 34. Going between 3 dimensional coordinate systems

    • 35. Intro into Parametric Equations - Intuition

    • 36. MEGA Application - Landing Airplane in 2D

    • 37. SIM: MEGA Application: Landing simulation

    • 38. MEGA Application - Airplane flying in an oscillatory way (in 2D)

    • 39. MEGA Application - Airplane's velocity and acceleration in 2D

    • 40. SIM: MEGA Application - Sin trajectory simulation

    • 41. MEGA Application - Airplane doing circles in 2D - Cartesian & Polar coordinates

    • 42. MEGA Application - Airplane doing circles in 2D - Velocity & Acceleration

    • 43. SIM: MEGA Application - Circle simulation

    • 44. MEGA Application - Airplane flying in a spiral in 3D

    • 45. SIM: MEGA Application - 3D trajectories - simulation 1

    • 46. SIM: MEGA Application - 3D trajectories - simulation 2

    • 47. SIM: MEGA Application - 3D trajectories - simulation 3

    • 48. SIM: MEGA Application - 3D trajectories - simulation 4

    • 49. SIM: MEGA Application - 3D trajectories - simulation 5

    • 50. MEGA Application - 2 joint robot - Angular position, velocity, and acceleration

    • 51. MEGA Application - 2 joint robot - 2 joints rotating simultaneously

    • 52. MEGA Application - 2 joint robot - assigning multiple reference frames

    • 53. MEGA Application - 2 joint robot - describing a point in two different frames

    • 54. MEGA Application - 2 joint robot - deriving a 2D rotational matrix

    • 55. MEGA Application - 2 joint robot - describing rotating and translating joints

    • 56. MEGA Application - 2 joint robot - joints rotating at different frequencies

    • 57. SIM: MEGA Application - 2 joint robot - simulation 1

    • 58. SIM: MEGA Application - 2 joint robot - simulation 2

    • 59. 3D Rotational matrix - how to derive it 1

    • 60. 3D Rotational matrix - how to derive it 2

    • 61. 3D Rotational matrix - how to derive it 3

    • 62. Implicit functions - what are they and how to graph them

    • 63. Implicit function derivatives - how to take them

    • 64. Expanding function dimensions 1

    • 65. Expanding function dimensions 2

    • 66. Machine Learning example - how to apply multidimensionality

    • 67. Partial derivatives - intro 1

    • 68. Partial derivatives - intro 2

    • 69. Partial derivatives - intro 3

    • 70. Higher dimensional partial derivatives & its graph

    • 71. Airplane example - Chain rule in parametric equations - partial derivatives 1

    • 72. Airplane example - Chain rule in parametric equations - partial derivatives 2

    • 73. Multilevel partial derivatives - how to take them

    • 74. Gradient - what is it and how to find it

    • 75. Taylor Series - what is it and how to formulate it 1

    • 76. Taylor Series - what is it and how to formulate it 2

    • 77. Linearization and Quadratic Approximation - what is it and how to do it

    • 78. Multidimensional linearization - practical exercise

    • 79. Multidimensional quadratic approximation - Hessian Matrix

    • 80. Representing a system mathematically, in vector-matrix form, and block diagrams

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.





About This Class

Dear Students,

Welcome to the course! I am very happy to transfer my knowledge to you. This is Part 1 of the course (out of 3 parts + EXTRA).

WHY should you take this course? Fair question!

In Science & Engineering, literally EVERYTHING is based on Calculus. From Mechanical & Aerospace to Electrical & Computer to ARTIFICIAL INTELLIGENCE & MACHINE LEARNING and many more.

If you REALLY understand Calculus and you are trained to APPLY it to REAL LIFE problems, learning and understanding more advanced material will be much EASIER. Your life will be much EASIER!

In my course, I WILL DELIVER just that. I WILL make you understand Calculus INTUITIVELY & in terms of APPLICATION. Just give it a shot!

These are the topics that the course covers:

  1. Vectors

  2. Transformations

  3. Parametric Equations

  4. Multivariable Calculus

I wish you good luck in learning!


Meet Your Teacher

Teacher Profile Image

Mark Misin

Aerospace & Robotics Engineer


The Mission: to elevate humanity's knowledge, skills and love for science & engineering

I think that online education is the future because of one single fact - it is easily scalable. One course of a single great teacher can reach millions of people and potentially transform their lives. If education is more scalable, it will be more affordable. More affordable and accessible education will give more people an opportunity to stay out of poverty and create a great life for themselves.

I am here to contribute to this movement.

See full profile

Class Ratings

Expectations Met?
  • Exceeded!
  • Yes
  • Somewhat
  • Not really
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Your creative journey starts here.

  • Unlimited access to every class
  • Supportive online creative community
  • Learn offline with Skillshare’s app

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.



1. Promo Video: Welcome to the applied calculus course. My name is Mark, and I want to help you master calculus. After this course, you will walk away with strong intuition and understanding of calculus. And you will be trained to apply it in real life to the level not seen in other courses. You're going to learn about vectors, parametric equations, partial derivatives, and linearization. And in addition to that, I'm going to create this very important bridge between theory and real-world applications. I will teach you how you can mathematically describe airplane trajectories in 23 dimensions and the motion of a two joint robot. In addition, I have created all kinds of simulations in Python to backup my explanations. They will truly give you an amazing visual added value. No other course in calculus does that. This is really powerful stuff. My promise to you is this. If you give me a chance to teach Calculus, I will make it second nature to you. It will be a great investment. Take a look at some of my free videos. And if you like what you see enrolling in the course, and let's get started. And looking forward to seeing you there. 2. Vectors intro - 2D: Welcome back. Today we're gonna start learning about vectors and the first thing that I want to do. I want to explain to you the difference between scale, er's and vectors. So what is the difference between scales and vectors? Well, look, you have some quantities in the world that you can measure for which you only need one number line. For example, let's take mass, right? That's just thick mass. So in order to describe mass, you only need one number life. So we measured in kilograms, for example. And then we have zero kilograms. We can have five, 10 and etcetera kilograms. Right or another thing would be, for example, money. We could have dollars or euros or pounds, and then again we could have Ah, let's say, minus 200 miners, 100 zero, 100 200. So here here you would have something. I profit. And here you would have something like los or how much money you have and your debt. Whatever your context is, I'm another scaler. Quantity would be distance right, because what is distance? Distance is land covered, so we we can measures in meters and what it really is. It's how much land have you covered? Okay, so that's this distance. It doesn't matter where you are. Where you're going is just how much land you have physically covered and you might have covered zero meters. You might have covered five meters, 10 meters. Also, you could have speed and you can measure speed in meters per second our kilometers per hours. It's up to you, and speed is how fast you cover the land. So if you're addressed that zero meters per second, you can cover the land at 10 kilometers per 2nd 20 kilometers per second. All right, it's up to you now. All those quantities we were able to measure them using only ah, one dimensional number. Line right. It's just one dimension. If you look at it, it's just one line. You don't need any more dimensions. However, we also have quantities for which we need to use more than one number line to describe it. And in order to do that, we need tools to capture all the information that happens on one line and on a number on another number line. For example, let's consider this two D plane and on this two d plane. We measure position. We measure position off this human here. And also we have this little model airplane, and we don't know the position of the human P one, the airplane, P two. Now notice that this is not a function here. I A function is a mathematical relationship between two variables. However, here we just measure position off objects. So this is the real world. You have a house you have. Ah, you have someone here. You have a model airplane, and we just use our were using a rectangular grid system to to measure the position off objects. All right, so this is not a function here. So in order to measure, let's say the position of this guy here or girl, we would say something like this P one. Okay, we know that, uh, this person is 10 meters and we measured in meters. We know that it's 10 meters in x direction. That's one number line. However, it's a two d plane. So how do you know where exactly that person is? That person live here or here or here underground? You don't know. So you also have to specify, and the second I mentioned And for that we use vectors. The mathematicians have invented vectors and vectors, air tools that enable us to capture information that require more than one number line. Right, So we have more than one number line and we use vectors to capture information. So the way we would describe this position here, Position one, we denote vectors with this upper small arrow on top off the letter. And then we say that, OK, p one is ex and why? So the X dimension goes first, and then why that mention comes later and then we just say 10 and zero meters. And now we have fully described the position of the person and the same thing with the airplane can just say be too x. Why? And it would be minus 20 and 15 minus 20 in the X dimension and 15 in the why did I mention meters? So this is called a two dimensional vector. So these quantities here, right for which you only need one number line, you call them scaler. And here this is a vector. And essentially, if you think about it, then scaler is just a one dimensional vector. And of course you'll Suni. In real life, you also need to measure the position in three dimensions. So again, this is not a function. Here is just you're using a cubic grid system. You see, there's a little cube here, so you have divided your world into little cubes, and now you're measuring the position using the cubic great system. So let's say that there's something here, right? Maybe another airplane, for example. In this position, and as you can see, you need three number lines to determine the position. Listen, let's call it P three to determine the position. Three. You need an X number line. You need why number line and you need a Z number line. So for the exit would be 20 meters for the white would be 30 meters. And for the easy, it would be 40 meters and the way you would write it, you would ride it very simply, P three arrow X y Z, and it would be then 2030 and 40 right, 20 30 and 40. So this is a three dimensional vector that represents the position, often object in a three dimensional space. But we also have situations for which you need a lot more number lines, not only three number lines. You can have vectors that have, ah, lot more dimensions than three dimensions. And of course, you can't really and represented graphically, especially if you tried to represent them geometrically. However, you can have, ah, quantity fish, for which you have many number lines. And in principle, you can have as many dimensions as you want or need up until infinity. So that's really there really depends on your context, and I'm gonna give you an example of that. 3. Vectors intro - Multiple D: So you. Here you can see a small water storage building. And inside this building you have five tanks and you can also see some pipes here through which water can flow in and flow out. And here you can see how much ruling of water you have in each tank. So in the first, thank you. Five cubic meters in a second tank of three cubic meters in 38 cubic meters, etcetera. Okay, if your objective is to know the total volume of water in the entire building, then of course, you only need a one dimensional vector or a scaler. So what you would do you would simply add them up, add them up right for you, total. And then you would just add them all up. Ah, five plus three plus eight plus four and plus seven would give you 27 cubic meters. And for that you only need a one number line. Right? You put it. Put it in here I am cute volume total. And then you have zero here. And then let's say you have 27 cubic meters here. However, what if your objective is to know how much volume of water you have per tank. Now for that you need five number lines, right? You need one too. Three, four and five. So you have tank one tang to tank three, Tank four and tank five. And in order to represent the volume of water per tank again, you would use a vector for that. So you would write something like this. The total volume of water would be okay. You want me to be three b four, b five and you represent them like this. Five, three, eight for and seven. And now you have a five dimensional vector that stores the information about the volume of water per tank. So you see, you can have as many dimensions as your context demands from you. And you can do that with vectors because vectors were invented exactly for that To store information off quantities that require more than one number line, you can also graph vectors up until three dimensions. So have taken the two situations from the previous media, where we measure the position in a two dimensional plane and in a three dimensional space. So we had a person here and a model airplane. The way you graph vectors. Simply take the two number lines that describe someone's position and you put them perpendicular to each other like we have done here. Now I want to specify that this is not the same like this. This is the real world, and we have chopped the real world into small little squares. So we're using this square great in order to specify the the exact position off objects in this world. But this is the real world. You have people here airplanes, houses, cars, whatever. Here, you don't have those things. This is not the world here. You simply take the two number lines. In this case, we have number, line acts and number line. Why no humans? No, no airplanes. You simply take those two number lines and you put them perpendicular to each other. And then you can grab vectors on this X Y plane. But this X Y plane, it's not the world. It's not like this. It's just two number lines that have numbers on it. They're placed perpendicular to each other, and the way you grab vectors is very simple. You simply look at the co ordinates off position one, for example, and then you graph it like this. So the beginning of the arrow which is here, that's the beginning of the vector and the end of the vector. The tip of the arrow, this deep end of the victor. All right, So the way you think about is that Okay, I go from 00 to X equals 10 and why equals zero and for the position to I go from 00 to X equals minus 20. And why it was 15. And then I graph it like this. And in the end, I had this arrow that points you in a direction. You can think of it like that. Victors are also sod off, as as something that describe the direction off. Ah, physical quantity. Now, in three dimensions, it's just same. You have three number lines, and then you put you put them perpendicular to each other. And again, this is not the same like this. This is the real world. Here you have a house. But this here you just have three perpendicular number lines to each other. They don't represent the world. They just they're just three number lines put perpendicular to each other. So that you could somehow graph vector geometrically and again. The position three had 2030 and 40 in the x Y and Z direction. So you go x 20. Why 30 and then you go up by 40. So you are here your position threes here. And then you start from 00 and you go toe position three and you start from 00 And then in the end you have this arrow Position three. Now you can also project victors. What does it mean when I say I'm gonna project a vector on an X Y plane? It means projecting a vector onto something means losing a dimension. So if I project this vector here on an X Y plane, then what I will have I will have this vector here. So you see. So I start from here. I have information about three dimensions. I have X and then I have why and then I have ze. So I have information in three dimensions. Projecting a vector means that I lose information about one dimension. And I only see this Ah, vector in two dimensions. So, for example, let's say that I take this Ah, this coordinate system and I rotated in such a way in such a way that I don't see the Z axis, right? So I just rotated. And by the way, there's a convention that Ah, because our papers are sheets of paper are two dimensional, but something who want to draw three dimensional pictures. So there is a convention that Okay, if I have this kind of sign, then that means that the axis is pointing out of the paper like this out of the paper. And if I have something like this than the exit is pointing into the paper right into the plane and you can think of it as an arrow. So let's see if I have some kind of arrow here, right? And then I have the tip. And then here in the end, I have these, uh, little wings to increase the stability of an hour that if this Arab points up like this, like out of the plane, then you would see you would just see a circle and then a small dot inside the circle, which would be the tip. But if the arrow points down, it points into the plane than you would see the the wings here, you would see like a cross. Right? So this would be, like positive Z direction. And then this would be and negative z direction. So that would be the convention. And let's say that we're gonna graph with same the same system, the same court and system like this. So we have Z here and then we have ah x here. And then we have Why here now, if I do that and I don't see the Z axis, then I don't see I don't have the information about the height off this director, right? The only thing that I'm I'm going to see is is this victim right? It's projected onto X y plane. And then, of course, if I take this line here that goes like dish, it's perpendicular. Did this, Victor? But you can imagine it right if you turn this system like this so that you don't see the easy access, then what you will have You will have something like this. So you have projected the X y Z vector onto X y plane. And then once you have projected the the vector onto X y plane, then you know that, OK, ex Waas 20. And then why was 30 right and then z you don't know anymore because you have lost the information about it. And then you can also project the vector, for instance onto why access, right? And again, if you do that, then this would be perpendicular to this line here and again. Think of it like you rotate this two dimensional plane Now in such a way that the X will point out of the plane. And of course, if you do that, you might think that. Okay, then the Z axis will appear, but we assume that it doesn't appear We have lost information about Z and that's permanent . And now we're gonna rotate these axes again. And we have something like this that we have. This is the X axis pointing up and then you have why axis here and then you have 30 And there you go. You have a vector that that is Ah, Why 30? So you see, First of all, you have a three dimensional information and this is perpendicular to this. So this hear what I'm drawing for The Z axis is the same like like this for the X y axis, right? It's perpendicular. So first of all, I had information in three D. Then I lost that information. I had something like this, right? It's like projected onto X y plane. And then I also decided to projected, and two Why line? So what I did, I rotated The X is again. So now I don't see the x axis and I only see the y access. So I only have information in one dimension now. And that's what projecting vectors is. It's like losing information about some kind of dimension. In fact, the same logic applies in functions. For example, if you have some kind of function, let's say you have Z here and then you have X here, right? And then you have some kind of parabola. However, what if I create one more dimension and well, you can think of it as Ah, ok, then this line, this line or this curve will become into a surface, right? So you would have some kind of surface and then you would have the y axis here and then if I were to project this surface onto ze explain, then I would look at why, like this I would have. Why? And then I would have here Z and then I would have here X. I wouldn't see the parable A in three dimensions. I would see it Onley in two dimensions, and I would only see a curve two dimensional curve. By the way, I really want to emphasize that vectors are not functions because functions they represent some kind off relationship. So in this case, Z is a parabola because of X. So X is an independent variable, right? You have an input X, then you have some kind of function, and then you get Z. So function is a mathematical relationship vectors. Well, there just facts, for example, the position to that mold. Uh, the position off model airplane. Right. The X is minus 20 and wise 15 so this is a very important distinction. 4. Vector terminology & disclaimers: welcome back. So I would like to talk a little bit more about how to grab vectors. And I have put this previous example about the water storage building. And then you remember we have Ah, we had five tanks and then we ended up with a five dimensional vector. Now, how would you graph of five dimensional vector? Well, let's say that if you only have three tanks, then you could do it. Because then you could do something like this. You could, uh let's say you could have one axis here, another axis here and then another access here. And then you could have the one which is Tank one, which is cubic meters, we to and then V three. And then V one was three. Be too was five and and then the three Waas eight, right? And then you would graph it like this, just like in the previous example with the three dimensional position with space with a three dimensional space where you determine the position three. And then you would Justin graphic like this, so you would have a point here, and then you could just graph it. Here you have a narrow and then you would grab it so it would first go three units here than five units here and then a units up and then from the region. You can grasp the vector, okay, but that's as far as you can go off course. You can't graph a five dimensional vector because at least geometrically, you can find other out of the box solutions. However geometrically, since you met in geometry will only have three dimensions. You cannot go further than three dimensions, so it's better to leave it in the mathematical form and work with that and no need to graph it a little bit of more terminology. First of all, when I take my number lines and then I make a victor out of them, then the process is called Victor Rising. So I have victory ized these number lines, and then I get a vector in Ah, I can choose to victory rise into two vectors. I can either have a column vector or I can have a row vector. So depending on my situation in my world, off science or engineering, then based inconvenience, I will either victory rise them into a column vector or into a row vector. And then, if I want to go from Cohen vector toe a row vector or from a row vector toe column vector, Then I take a transpose. If I take a transpose off a column vector, I will get the row vector and vice versa. So taking entrance poses another operation and what it does well, if you have a column vector what it does that if you have a column vector, then it will make this column into a row. So you see 5384753847 and vice versa. Fivethirtyeight for seven. If I take a transpose of it, I will get 53847 So Rose become columns and columns become rose. I want to have a small disclaimer here, so sometimes people put different nature vectors into one vector. But that can be confusing. I mean, you can do that, but you have to be careful. For example, sometimes people right, the position vector, right, and then here they will also right the let's say, the volume off the tank vector, the total volume of the tank, and then you would have a vector, which would be 30 40 and 50. That's the position part, and then you would have 538 four and seven. So that could be confusing because you have two different types of vectors in tow inside one big vector. So if you do that, at least I would recommend you to have ah, horizontal line here just to just differentiate between them. And then I would really advise you not to try to graph vectors that that have different that have elements that are from different nature. For example, if I have a vector like if I have some kind of vector that describes, let's say the the volume of the tank and then also some kind of position in one dimensions right then if I tried to graph it, then I could have something like this so I could have here the one which would be measured in cubic meters and I could have position that would be measured in meters. And then, if you try to graph it, then it just doesn't make sense. Like on one axis, you have cube meters on the other axis you have. You have the length so it doesn't make sense. It's very confusing, so I advise you not to do it. It just doesn't make sense 5. Vector magnitude meaning: welcome back. So let's no cover something called Victor Magnitude. So let's say that you have an airplane and the velocity off the airplane and remember the speed and lost their different speed is how fast you cover the land. And you only need one number line for that. So only one number line for speed. However, velocity means something else. So speed is just like you go along, some kind off, Let's say some kind off road, right, and you cover some kind of land. And how fast do you covered this land? What velocity means? How fast do you go in X direction, hopefuls, Do you go in? Why direction? How fast Do go in the direction so an airplane can fly inside the three dimensional space. And then you could think like, OK, this line if I have some kind off if I have some kind of three dimensional space here. All right, so this is X. This is why and then this is E. And then the airplane is just flying around this through three dimensions space. So speed would just be how fast does the airplane draw this line In a three dimensional space? However, the velocity is different. It's how fast do you go in the X direction? How fast do you go in the Z direction and how fast do you go in the wind direction? So that's the difference. If you want to describe and airplanes we lost the in three them in three dimensional space Then, uh, you need three number lines you need you need X. Why and z So you need three number lines And then, of course, in order to graft this vector in three dimensions, you can you can just say that. Okay, you can just put all those number lines perpendicular to each other and say that this is X meters per second. Why meters per second and Z meters for second or you can do it in an easier way. And you can just used the mathematical vector notation like, for example, like this the airplanes velocity equals to five and three meters per second. Okay, so that means that the airplane flies two meters per second in the X direction five meters per second in the wind direction and three meters per second in the Z direction. Now the magnitude off the vector in fact is a function. It's a function off the vector elements. So the magnitude of the function that we do not like this is a function off victor, Element one victor element to and Victor Element three and the formula to calculate the the magnitude of the vector is like in two dimensions that this Acura and serum. So here, in two dimensions, if you have a and B and you want to find see, then what do you do? Will you just say that C squared equals a squared plus B squared. So if you want to get C and you just square, root them all and you have see all right and then you find in the two dimensions you find them active defector the same way. However, in three or 45 dimensions, you just extend this concept. So in this case, the magnitude of the velocity vector would be square root. Two squared, plus five squared, plus three squared equals square root off four plus 25 plus nine, and that would give you square root of 38 meters per second. Now what does it mean? What does demand to tell me? Well, you see the magnet ID. You have to be careful with this magnitude because sometimes a vector magnitude can tell you something useful and sometimes it can be quite meaningless. For example, in this case, it's very useful because if you graph the magnitude you have, why direction Here you have X direction here. Then you have Z direction here. So if you have in the X direction to than in the Y direction you have five and in the Z direction you have three. So if you graph it all, so you have ex components, Why component and Z component And if you graph it so it would be something like this and guess so If you graph it from the Origen, you will get to this point, right? In other words, you move two in the direction of x five in the direction of why and three in direction of Z and then where all those lines cross. Then you will have a vector here, three dimensional vector. Now, in this case, what it means. It shows you the rial velocity which is square root of 38 meters per second, and it shows the real direction off the airplane so the airplane really flies in this direction. So it really is useful. So on a two dimensional plane, if I have, if I have ah x here and why here and let's say the airplane fly six meters per second, the X direction and two meters per second in the Y direction, then the magnitude would be this. So the airplane would really fly in this direction, right? And then the magnet ID off the vector or the rial with the loss it do the the real velocity of the airplane in this direction would be square with the 40 meters per second. So in this case, manager is very important. However, what about the other case where we had this water tank? You had a water tank and then you had the five five tanks and in each thank you had some kind off volume inside the tank. I don't remember the numbers, but let's just say that there too. Three to 15 right now if you take if you take the magnitude of this vector that he doesn't really tell you anything because what does it tell you? It doesn't tell you? The total volume inside the building the total volume of water. In order to find the tool volume of water inside the building, you just have to You just have to add up all those elements. But if you take the magnitude, then it doesn't really tell you anything. So the magnitude is more like measure over Victor's strength. What do I mean by that? So if I have three vectors, I have one vector which which has two components two and two. Then I have another vector whose components are square root off to and squared off six. And then I have another vector whose components you are square root of sex and square root of two. So which which vector would be stronger? We should have vector would be more powerful. So if you look at the graph, then okay, here you would. Both of those components would be to So the magnitude will be this. In this case, you would have a short X component and long why components. So this would be squared off to and this would be squared off six. So the magnitude would be this right? And then here you would have a long X axis square root of six and the short Why access square root of two, and then this would be demanded. So which one is stronger? Well, if you calculate the magnitude for the first case, it would be two squared plus two squared, which would be four plus four is eight. In the second case, it would be square root of two squared under the square root plus square root of eight square it of six squared so you would have square root two plus six, which is square root of eight. And in the third case it would be the same. But in reverse were it bless square of two squared and you would have squared of eight. So the magnitude gives the same number, and it just tells you it's the magnet. If here has the same length that here and it has the same length here as well, and therefore you could say that the factors all those three victors have the same power there. Their strength is the same, but again, it really depends on the contact. Sometimes it's a meaningful number. Sometimes it's not 6. Vector components - exercise: welcome back. So I have this. Ah, weird. Coordinate Access X and why? And hear their degrees between them or 45 degrees and here, 135 degrees. No, I've read Drone this thing here and well, the question is, could you intuitively build up this vector from its X and Y components? So, as an example, I have also drawn affect er in the normal coordinate system where you have the 90 degrees between X and y, and you see that this is the real vector, right? And the components of the vector. Well, the logic is that you have to be able to build up the vector using its components, and you have to be able to build up this vector by being able to put one vector along one dimension. And then you take the other vector in the other dimension, and you put it here on top of the first vector. So this is the vector in the X direction, the X component, then you also have a vector in the Y component. So you can you have to be able to take that Why component vector and put it in just shifted here on top of the X component vector. And then if you it's like vector addition and then if you just from the Origen. If you're able to draw your real vector, then you have drawn your ex component and why component. So this would be your X component, and this would be your white component, your white component that you can shift and just throw it here. It's the same thing. And like we talked about, there is a unit vector, which equals one in the X direction I cap and then also Jake cap in the Y direction. And let's say that the X here is an abstract number and B Y is an abstract. Why component? So you could rewrite the vector like this. V equals e x icapp and V y times J cap So v x in the X direction and you wind the wind direction. So just positive video and try to do the same thing for this situation. So what you need to get you need to get V equals something I cap plus something times J cap . So what would you put here and then also graph it on the graph all right. See you soon. Okay. The best way to think of it is in terms of grid. So I have also drawn a grid here. Great for the why and ex components. So in order to find the answer here, just follow the grid. So if you follow the greed, then you can go wrong. So I need to get to this point. Right? So would I have to do well if I start from the X direction, then I need to go in this direction up until here. And then if I want to go, If I want to reach this point, then I have to go along the y axis. So I have to go here. You see now if I go along the X axis, the X axis positive in this way. But I go in the other direction. So it has to be minus V X. And then if I go along the y axis, then I go like this. So it will be positive. Because why I sponsored if in this direction. And there you go, that would be the answer. And that would be the component. And don't forget, you can also just take this component, and then you can just shifted here. And then you have one component here, so you can forget about this one, and then you will have one component in the in the minus X direction and another component in the wind direction. And these would be in this coordinate system in this weird corden system. The components of this vector would be this and this because you can take this victor and put it here. And it's also one way to do vector addition. And then the vector sum would then be this is one vector plus another vector. And then from the Origen, you draw the some. Which is this which is the blue line. So you see, you don't you don't always need to have this the standard coordinate system, even though you will always or almost always use because easier. But you can also do it like this. All right, Thank you for tending this huge lecture on vectors. And, uh, in the in the next lecture, we're going to continue with vectors and we're gonna We're gonna see some vector operations . All right, See you soon. 7. Vector operations: Welcome back here. We're gonna take a look at the vector operations. We're gonna take a look at addition, subtraction the dark product and then later on, we're also gonna cover the cross product, which is a different kind of product. You can have two products with vectors. You can divide the vectors, but you can divide Ah, vector elements by scale. Er's so I'll show it to you What I mean by that. So for now, we're just gonna focus on three operations, condition, subtraction and the dot product. So let's see what we will get. First of all, vectors when you put them in the parenthesis and then you have a scaler number in front of them. They have a distributive property, so we can think of it like this that can let's just take this part. And you can write it like this, too. 12 plus two times 34 which would equal two times one and then two times two. You would have ah, two and four because you multiply this by two. And also this the scaler by the y component. So two and four plus the same thing here two times +36 and two times four is eight. And now you add vectors simply by adding their components. So two plus six is eight and four plus eight is 12. So this entire that this entire thing, he's eight and 12. Now, here we take here the scale er's 1/3 and then we have six and nine. Now, remember when I said that you can divide vector elements by a scaler? Well, here this is like dividing six by three, which is the same thing, but, like multiplying six by 1/3. So So you would have six divided by three and nine, divided by three. So you would have to here and you would have three here. Okay, so this part is two and three. And now you take the dot product off both vectors, which is eight and 12. This one you dot it with two and three and the dark product is Remember, first, that you multiply the two the first elements eight times to plus 12 times three, 12 times three and that would be okay. This would be 16 and this would be 36 36 46 52 should be 52 and here. I didn't realize that I'm gonna get a scaler by the end of the day. And you can't just subtract scaler minus vector. So I'm just gonna add another dot product here, which is one and two. And then I dotted with two and four. So one and two not to and four. And that would be one times two plus two times four is two plus eight, two plus eight would be 10 and then so this would be 10. So in the end, you will end up with 52 minus 10 which is a scaler quantity, which is 40 to. So you see, because of the dot product, you managed to go from vectors to a scaler quantity. 8. Forces on a box - dot product: Welcome back in this lecture, I would like to show you one of the ways where the dark product is applied. So I'm just gonna use an example from physics. So let's say that you have some kind of box, right? Some kind of box on the ground, and this is the ground here. And then what you're doing, you are applying some kind of force onto this box in this direction and as a result, off this force and we're gonna call it the Apply Force F A. And of course, this books also has ah, for severity. Now, as a result, this box will move here. So in physics, there's a concept called work and work is a scaler quantity, and it equals the force vector dotted with the change of position Vector, Delta P. And remember, when you dot to products, then you're gonna get a scape. You're gonna get a scaler quantity. All right, so the box has moved from here, and this is the center point here. So the box has moved here up until here. So what would be your your change of position? And remember, this is a two D plane right now. so the change of position would be built. A p. It's a vector and you would have some kind of change of position here. Delta P X in the X direction. However, in the Y direction there would be no change of position. Right. And that's because even though you apply the force both ah, in X and y direction, you would also have a component in the X direction. That's what causes the box to move and then you will also has a You would also have a component in the Y direction. However, this component in the wind direction is smaller than the force of gravity and therefore it will be unable to lift the box up. So because of this force, the box will only move here from from this position to this position. And we're gonna assume that this book is on a very slippery surface. So there is no friction force going in in the backward direction. Normally, there would be a friction force going in the negative X direction, but we're gonna assume that there is no force there and then you're forced. Victor, of course, would be the force Victor applied, and so it's also a vector. And then you would have an X component, FAA, X and F A. Why so work? Essentially, what is working? Physics Work is its like its energy. It has the units of energy, says Jules, right. It's jewels. So it means that okay, if I move because of some kind of force, I move this books to hear because of this force. So when I don't those two factors, then I'm gonna get a quantity in jewels. In other words, it will tell me how much energy I have spent to move this box here to here. Okay, So So you would calculate the work in the following way. Work equals f a X f a. Why you dotted with Delta P. X and zero. And now you would have f a X multiply built a p x plus f a y multiplied by zero and notice . This will be zero, and your work will be on Lee. Notice what you're doing here. You you're taking two vectors and you're simply multiplying their respective components. And so in this case it would be FAA, x times, delta, P X, and that will be in jewels and that will be You can think of it that Okay, this is the energy spent that that I needed to spend in order to move this box from here to here because because I applied this force. So that's one of the areas where you would use the dot product in real life. And, of course, from the dot product, you can very easily see that when you have a force in one direction and then the change position is in another direction. Like in this case we had, uh, well, we we had a force. Why in this direction and then delta P waas Ah, that the P X was in this direction. So you can see that a force that is perpendicular to this change of position vector that they do not influence each other. Those two vectors do not influence each other, and therefore therefore, if you multiply and the y component of the applying force and then there were component of the change of position Victor, which is zero, then it would be zero and no energy spent. So this force, since it's not causing this vector, this force does not contribute to the energy spent to move this box from here till here. All right, Thank you for attending this lecture. And in the next lecture, we're gonna look at the cross product. 9. Cross product - intuition: So the first thing that I want to make sure that you understand about the cross product when you when you compare it to the dark product is that the DOT product gives you a scaler , so you will get a scaler quantity. When you have a dot product, when you have a cross product, you don't get a scaler, you get another vector, so it's a different kind of operation. Both of them are called products, but they're two different kinds of products. With vectors, you can have two kinds of products. We have looked at the dot product and you get a scaler out of it. But then, if you take a cross product, then the result will be another vector and surprise surprise that other vector will be perpendicular to the to your first and second vector. So what do I mean by that? I mean this. If I have one vector in the X direction, I'm gonna call it the X. And then I have another victor in the Y Direction V. Y. Right. And if I write something like this, the X cross, the why than the result will be something in the Z direction so there will be something in the Z direction. It will be both perpendicular to thanks. And why No To know whether whether you're gonna go inside the paper or out of the paper, there's something cold. A right hand rule. So the way I would apply it. Okay, let me just rewrite it like let me just turn this entire thing by 90 degrees. That's easier for me. If I turned this entire access 90 degrees then I will have the X here and V. Why here, Right had just turned nine degrees for myself. And now if I If I cross v x with the why then you can look at it like this. So my hand goes in terms of Vieques and then I cross it with V. Why? And my thumb goes up. That means that that ah, I will have some kind of number here. And the direction will be up or positive. K. All right, now here the direction matters the order off multiplication. Because now if I take me Y first and then I cross it with the ex, then my right hand rule I take my right hand. So I first take V y and then I turn it till Vieques. And look, my son goes inside the plane so insight into the paper. So therefore, when I have this kind of order, then I will have some kind of number. And then I will have Ah, the vector. My vector pointing into the plane or negative. Okay, so if we just draw it again over here, you have X. Well, this is why and this is X and then you have Z, then, Uh, yeah, if you if you first. If you first. If you cross X with why, right then I take my hands X and then I turn it toe. Why? And then my my thumb goes up. So therefore, I will have some kind of vector that is perpendicular to both X. So it will be perpendicular to both X, and it will be perpendicular two. Why now? In order to find, uh, like the number into this thing because the right hand rule it works for, let's say, for three dimensional cases, but you can't do it in higher dimensions. But normally in many situations, three dimensions is enough. But But of course, there is a mathematical formula to compute this number. And if you follow that formula precisely then it will give you the precise vector with their components. So, for example, it doesn't let's say it's not perpendicular, right? It's not perfect. Let's say that I have Ah, let's say that I have the X here and then I have another factor, like a for examples. This is Victor A. Now it has both components. It has an X component, right? It has an X component and it hasn't. It has a white component. No, still A and V X, they former plane. They're both on this piece of paper, their own. They're both on the sheet of paper, right? So if I look, if I think of my paper as some kind off plane than both of those vectors are on this paper plane so still, if I take my cross product first v X and then a I will have thumb pointing up. So therefore the X cross a. It will be some kind of number and pointing up. However, this number will be different because the vector is different. And also even if you even if you have two vectors there prophetic literature you can have different magnet is so so. It all depends in that as well. So this is an intuitive way to determine the direction off their result. So if you cross two vectors, then you can use the right hand rule to understand the direction off the off the vector that you get out of it. However, now I'm gonna show you what the what the real formula is to calculate the the exact result when you take when you cross to Victor's. 10. Cross product - calculation: so say that I have ah two vectors I have vector. Hey, there has the components off a one a due and a three. And then I have another vector which is B and it has components B one, B two and B three and I want to know the vector. See, which is the result off Victor A crossed with vector B and the way you the way you approach it is like this You first will take the a vector. Well, first of all, you take Ah, the unit vectors, which are I, J and K, and you put them as a row victor. Then you do the same saying with with a a one a two a three row vector and then b one b two and B three rove it. Now if you put those row vectors together and you group them together like this like I j okay. And then a one a to and a three. And also B one, B two and B three. If you group them all together by that three by three, then this is called three by three matrix. So vectors grouped together are called matrices. So if I group those three row vectors together. Then I will get a matrix. And you can also do the same thing if you group column vectors together. So, of course here, what you did first. You transposed, right? You're transposed the cone vectors. And then you got the row vectors. So this would be this. And then this would be this. And then you probably also transposed i, j and K. We transposed it and you got this. Okay, but you can also group them together like this, like I j okay, a one a two a three b one b two b three. And that would also be a matrix and different kind of matrix, but still a matrix. However it doesn't. Ah, as far as ah, the cross product product is concerned. We don't care about this matrix. So we we we created the rope vectors and we group them together like this. And now we're going to use this formula to calculate. See, we're going to calculate something called a determinant of this matrix. Now what is it? Determinant of a matrix. The way I think about it. To me, it's like the magnitude of affect, er so the magnitude of a vector gave you some kind off scaler number and showed you how strong the vector is and you can think off. Ah, determine it's the same way. Or at least I think of it like that that the determinant of a matrix tells you something about the strength of the Matrix. So it would be something like this, but calculated for the Matrix. And it would be difficult to visualize that. However, if we if, in the process of calculating the determinant, we stop half way, then we will get the cross product. So what do I mean by that? The determinant is calculated like this. All right, J and K. And then you have a one A to a three and b you want be to and b three? No, the way it's calculated is like it's first of all, you take this. I did this first row and first column. Hi. Right. And then you calculate the determinant off this off this smaller sub matrix. So that would be. And the way you calculate the determined off a two by two matrix is like this a two times be three minus a three times be too. So you get like this a two times B three miners. A three by my was a three times B two. Then what you do next? You forget about this. And you you take the other one j So you take plus J And now you Only now you only consider Let's say when you took I then you could cancel out this and this right? And you were left on Lee with this. Now, if you take J living, just write it again. J k a. One a two a three b one b two b three. Now if you choose Che, if you just j then you can cancel out this and this so you will be left with with these two things with just do sub vectors that you can form a sub matrix And okay, I made a mistake here. In fact, it's minus here. That's the That's the rule. When you take the J, then it's minus j. OK, it's minus j. And then you can quit. The determinant of the sub matrix off a one b one a three and B three and the terminate off the sub matrix would be a one times B three minus a three times be one. And, uh then you put this here a one times B three miners a three times BU one. And then you do the same thing for the K. So again, I have this three by three matrix I j k. And then I have a one a two, a three and then b one B two b three And now I take a and they cancel. Ah, this column in this row and I will be left with a one a two b one b two. So the terminate off a one a to B one B two would be a one times B two minus a to be one. Okay. And now since it chose que you take plus k and then you put this here So a one b two minus a two b one. And so the only exception that you have to remember Is that okay when you have I Then it's the determinate times Positive. I buzzed of unit vector in the X direction. When you choose K, it's also the determinant times positive k. But when you choose J, it's the determinant off these two elements in these two arms that are left times negative J So that's the formula and is derived from linear algebra. So remember when I said like Okay, if you stop halfway there, then you will get the sea, which would be your cross product. Of course, if you don't stop halfway and you continue your calculations, which means that you say that I and J and K what are they there? One Right, they're all one. So if you just say that, Okay, Eyes one and Jay's one in Cayes one. If you If you assume that, then of course you will add up this and this and this and you will In the end, you will get a scaler. Okay, you will get us Keylor. But we're going to stop halfway there and we're just going to say that, OK, we're just going to calculate this and there were going to calculate this and then I'm gonna calculate this, and then I will have my why J and K or X Y and Z component for my see vector, for my result. Okay, So again, in order to cross in order to have see which is a cross be what you do. You You make the row vectors off i, j and K than a one a two, a three and B one Between p three, you form a matrix and then you start calculating the determinant of the matrix. But just top half way there. So you first. It will do this operation where you cancel out these this calm and this row first common first role and you will take the determined of the sub off the subject by two matrix and that the terminal will give you the magnitude in the my direction. You do the same thing for the J. But remember, in the Jade's exception, you have the minus here. But then still, it would be the determinate off off this matrix status that comes from here and here. So you get this matrix here, calculate the determinant If it and you do the same thing with cake now, still plus K, and then if you calculate the determinant off this sub matrix here, then that will give you the mind to indicate direction and then instead off instead of just saying that. Okay, let's calculate further by thinking that I and J and K are ones. Instead of that, I'm just gonna say that. Okay, I'm just gonna take this number and I'm gonna put it here. Then I'm gonna take this number and minus, and I'm gonna put it here. So remember, now not only this number goes for the second element off the sea, but also the negative value will go here. And then you will have this number times minus one and then in the J direction. Or you can think of it that okay, this number in the negative j direction. So if J is if this is ex and why, then this number, let's assume that this positive, then it would go in the negative y direction. And then again, K and then the K this number, this magnitude will go in the third element off the sea vector. Okay? And now I'm gonna show you a real life example with cross products 11. Electron + Magnetic Field example: All right. So in my example, I have a small electron. An electron is ah, One small part, often entire atom. So atoms have many electrons and electrons. You are have negative charge. So there the building blocks off atoms and they they're charged with a negative church, and the units of charge is cool. Um, from physics. It's cool. Um and, uh so I can just write it down Here column and from physics there is a law that says that if a charged particle travels with some kind of velocity through a magnetic field now these crosses here, their magnetic fields and they're denoted with B. So the reason why you have crosses here is to remember this notation that this comes out of the plane and this goes into the plane. So a magnetic field is a vector. And in this example, the vector goes right inside into the plane into my sheet of paper, so into it to into the paper, so negative z axis. So here we define Z to be positive. So out of the paper like this and the magnetic field is in the opposite direction, it goes into the plane. So in the negative K direction and the velocity travels in the positive X direction. OK, the velocity travels in the positive X direction and the magnetic field goes into the plane . And then, as the you can see from this formula that that there will be a force applied to that electron if it has some kind of velocity and if it travels through a magnetic field so both of them need to exist, a magnetic field needs to exist in order for the force to be something else but zero and also the particle. The Electra needs to travel at some kind of velocity in order to have in order to have ah force. So if the particle is at rest in the magnetic field, then there is no force. But now we assumed that it has a velocity, so it travels. So this is and this is defined V crust be now what would be the direction of the force just by thinking about the right hand rule? Well, so if my Elektrim moves through the magnetic field in this way, so this is the velocity, and then if the magnetic field, if it's vector points down, then my thumb goes up. So I should have a force in this way. Right? So the particle should go in this direction at some kind of velocity, and then the magnetic field would point down, and then the force goes here, so the four should be in this direction, right? However, don't forget that the the Elektrim has a negative charge. So charges a scaler quantity. So even though the velocity is like this and the cross product says that okay, if I just cross it with a magnetic field, then the force points that way. And that would be true for for a protein that has a positive charge. But since the electron has the negative charge that it will reverse, it will, it will reverse the whole thing. So the cross product gives me this direction. But since I have a negative scaler, then the force will be in the opposite direction. The force will be in the opposite direction. So the force indeed will not be up. It will be down because even though the cross product tells me that I should go that way. But since I have a negative charge, I will go that way. I will go down. So what will happen then? So my electron goes through the magnetic field and instead off for having a force up. Because of the negative charge, we have a force down. So let's say that well, in fact, from the moment it enters the magnetic field right from the moment it's here, forget about this one. From the moment it's here, it will have. Ah, it will have some kind of force, right? It will have some kind of force there. Now the particle still has a velocity into the X direction. So it will. It will continue moving forward. But then there's also this force pulling it down so it will move something like this. And then it will still continue. Go there. But then But then what will happen with with the force? Because remember, it will go there. But now it has also gone in this direction. Right? So now you not only you have the the X component, you also have the negative the y component because the force has ah and this the force vector. The force has pulled the the electron down, so it still goes forward. But it has also moved down. So So now the velocity vector, the magnitude off those two components will give you a vector in this direction. So now you have the new velocity in this direction. But the magnetic field is still down. So the cross product, I would give you this direction. But since you have a negative charge, then your force, in fact will be perpendicular two velocity and the magnetic field, and it will be in this direction. And then that will cause I'm just gonna draw it here again and that force. So the velocity now is here. That force will cause the particle to to go in this way right in this direction. So at some point, the velocities in in in this direction and the magnetic field is down and the force will be in this direction. That would be the force vector and then etcetera, etcetera. So what will happen? Well, the election forest, long as it remains in the magnetic field, it will go in circle. All right, well, just go in circle. And that's how scientists That's how they control those small particles that I have charged . They control them with magnetic feels they give them some kind of velocity. They Then they establish some kind of magnetic field, and, uh, that will cause the electrons to move in circles and then by varying the magnetic field and the velocity, you can vary the force. And if you for vary the force, then you can control how those particles move. Okay, so this is a real life application. How you can, where you can apply the cross product. And of course, once you know the real values the rial charge the rial velocity, the rial magnetic field at any instance of time. Because this is a time equals zero. This is this is that time equals well, it would be 0.0 something. So once you have those values, then for each time you can just use the formula that I gave you in the previous video to calculate the rial force. And then from that you can also know the trajectory. The scientists can know how Ah, the electrons will move. Okay. And that concludes the part on vector operations. Now you know how to add vectors. Have to subtract them. You know what the dot product is? How to apply it. You know what a cross product is and had to apply it. And then in the next lecture, you will see how old the functions that we have covered so far can be applied to control the levels off water in the tanks and how you can manipulate the levels of water in the tanks by manipulating the functions. So you will see the use of what we have learned so far, and it will be very interesting. Essentially, you can use math to simulate a real life system. When your computer, when you, for example, write a program for your controller that controls in this example the levels of water in the water story building, it's gonna be very useful and interesting. So see you then. 12. MEGA Application - Water tank example 1: Welcome back in this lecture, you will see how all the functions that we have covered so far can be applied to control the levels off water in the tanks and how you can manipulate the levels of water in the tanks by manipulating the functions. So you will see the use of what we have learned so far, and it will be very interesting. Essentially, you can use math to simulate a real life system. When your computer, when you, for example, write a program for your controller that controls in this example the levels of water in the water story building. So let's get started. So I have this water storage building, and now I have three tanks and I wanna control the volume off water in each tank as a function of time. So I want to give computer time, and then the computer will controlled the levels of water in each tank as the time goes on . And how would I denoted mathematically? Well, I would denote it as a vector so I could write something like this volume Total Arrow. This is a victor, and in fact I would say that it's a function of time. And then I would have the first element tank one as a function of time tank to as a function of time and tank three as a function of time. Now, remember what we said earlier, that the vectors themselves are not functions. However, each vector element is a function of time. And therefore, if each vector element depends on time, then the entire vector depends in time makes sense, right? If you can control each vector element as a function of time, if you can control the bowling of water in each tank and each vector element is a function of time, which means that the time is the input and each factor element is the output, then the entire vector is also as a function of time. So I'm gonna draw a little schematic here. So here you can see how you can control each vector element and therefore the entire vector . So you have this independent variable here, right? This input Time T. And then you take this tea and you put it in the first function here and you get the first vector element or the volume of water in the first tank and then the same t goes into the function to and then you you have the volume of water in the second tank, the two and the same thing. The tea goes into function three, The time goes into function three and then you get V three so you can control each vector element as a function of time. And then what you do you wrecked, arise them and backed arising means that you just take thes outputs, right? V one V two and V three are the outputs and you structure them as a vector like this. We want me to envy three. So you vector rise them and you get the total William off water as a vector for each tank. So you will have different functions here so you can control each volume in the tank differently as you please, as you as you want to control them in. And essentially they will be the instructions for the computer to to, let's say, give orders to the pump or to the pumps that would control the level of water inside the tanks. Now, this is a visual way to represent your system just to have a visual understanding off your system a mathematical way two represented would be like this the vector off the total volume of water. So it would be the vector as a function of time would be if one t f to t and F three t or you can also write it like this is gonna write it here if won t you and infect her. I bless F to T unit Vector J Plus F three T unit Vector K, and this is also called in Calico's. It's also called Parametric Equations. So let's see how we can control the voice of water in the tanks. Or, in other words, how we can control these vector elements is a function of time Those victor owns, they depend on the variable time, how we can control them. And we're gonna assume that the pumps that we have here that control the water that that ah , make the water flow in and that suck the water out of the pumps. We assumed that those pumps can cope with whatever orders we give them. So even if we put some kind of bizarre function here that then we assumed that the pumps can cope with that even though in real life of course, you have to take into account that. Okay, What I want to happen, can the pumps really do it? But here, we're gonna assume that they can do whatever we tell them to do. 13. MEGA Application - Water tank example 2: All right, let's define our initial conditions. So the initial volumes of water inside the tanks are written here. So V one I, I stands for initial. So V one eyes 50 kilometers. So at the beginning, when time equals zero when time equals zero seconds. Then in the first thing you have 50 kilometers of water. In the second tank, you have 40 kilometers of water and then the third thing 30 kilometers of water. Now task one. Task one is program the controller toe. Order the pumps to increase the water levels in each tank by two kilometers a second. So even though we have different levels of water in each tank at time equals zero seconds, we want to order the pumps to add every second, two kilometers of water into each tank. All right, And the two of William off each tank is 100 kilometers. So I want my program to stop when the volume reaches 95% off the tank. So you start adding the water and it when it reaches 95% of the off the tank. Then I wanted to stop, so obviously, since you can already think about it, that if I had to commuters of water per second to each tank, then let's say that the change off William in each tank will be the same. And since ah, this one has more water inside at the beginning, the first thing it will reach 95% off its volume first, and then the second tank will reach it. Then the third tank will reach it. So the first time needs to stop first. Then the second tank needs to stop and then the third thank needs to stop. So how would we control it with functions? Well, we have something called peace fives, defined functions that we had covered earlier. So let's see. So our limit is so our maximum volume that we can have would be would be 100 times 0.95 would be 95 que meters, so we cannot have mawr water than that inside each tank. So let's just start with the first tank. So the first time view one as a function of time equals well, first of all, our initial condition is 50 plus, and, uh, the rate of change will be two kilometers per second. So it's too. Times t right. So every second to que meters of water will will be added to the tank. No. In order to know went to stop the pumps. We have to know at what time it will reach 95 kilometers. So what we can do? We can simply calculate the time we can say that 50 plus two t equals 95. So it will be to t equals 95 minus 50. And of course, to find the time we have two divided by two. So that would be 45 divided by two. So the time in this case would be 22.5 seconds. So I can very simply right that. Okay, Controller, follow these instructions followed. This instruction followed this function from time equals zero is your included time and up until 22.5 seconds. And then time after 22.5 seconds. Your water volume should be 95 cubic meters. So it's a piece wise defined function here, you see? So first of all, you increase up until 22.5 seconds. The computer increases it. The program increases it. So this will give you volume kilometers So it's cube meters per second times time, which is seconds. So cubic meters per second, which is to times time, which will give you seconds. Then you cancel them out and you will get volume here. Plus this will you here and then it t equals 22.5 seconds. You will get 95. And after that, the program shuts down. All right. And you can in the program. You can write it with an if statement. Okay, If it's time is last in 22.5, then use dysfunction if it's bigger than use dysfunction. Okay, let's take this second tank now. So in the second tank, our equation would be 40 plus to A t and again 95. So, in order to find time when we have to shut down the second tank in order to find that we need to just cackle the time which is 95 minus 40 you would divided by two said time equals 35 delighted by two and 35 divided by to okay, not 35 but but 55 divided by two 55 divided by two. And that would be 27.5 seconds. Okay, so our second piece finds equation for the second volume would be for the second tank would be 40 plus to t when zero IHS less than to and t is less than 27 points. Five seconds. So this is seconds and this is William here. And then after that, you will have 95 cubic meters after tea is greater than 27 0.5 seconds. So let me also squeeze the third tank onto this page. So the equation for the third time could be 30 plus two. T equals 95. So 30 we were initially have 30 kilometers of water. Then we start adding two kilometers before a second. And we have to find the time, which would be two t equals 95 miners 30 divided by two that we cancel it out here and we will get 65 they wanted by two, which is 32.5 seconds, 32.5 seconds. And now we're gonna just write it down like this. Tank three as a function of time. And by the way, the tank to was also the function of time equals 30 plus to t when the time is when the time goes from zero up until 32 0.5 seconds and then stop or have 95 cubic meters of four in the third tank when the time is after 32 point five seconds. And again it's a piece. Fires defined function. So you see Now we're taking all the separate functions that we have been learning so far, and we're combining them to describe the rial system. Okay, see you in the next video to solve the task to the second task. See you soon. 14. MEGA Application - Water tank example 3: Welcome back. Let's start with our task to now at time equals 30 2.5 seconds. We have all our tanks that contain 95 cubic meters of water, Right? The tasks do says right after time equals 32.5 seconds. Right after that time, suck the water out of the tanks at the rate off to t cute meters per second until all tanks are 50% full. In other words, this is your initial condition here. Old tanks contained 95 kilometers of water and you want to suck the water out of each tank and it will happen at an equal rate which is not constant anymore. Notice now, the rate itself will change. It will increase. So as the time goes into the future, the pumps suck water out of the tanks faster and faster. And the program needs to stop the bumps when the volume in each tang is 50 cubic meters. So when you reach from when you go from 95 to 50 then you stop. Okay, so how would we approach that? Well, first of all, let's look at the rate And since the rate is the same for each tank. We can just say that, OK, and which would be the index for? For the volume for each tank, We can just say that's one and two and three. So it will be applied to ALS tanks. So in other words, if I say the end the night, I mean if you want me to envy three b one B two and the three OK, but now let's take a look at this rate Straight is here is very important. So what does the rate mean? Well, it means a derivative, right? So you can think of it like this. You have some kind off function that the the end as a function off time. Right now, if you apply the operator d the t to e n, then you will have d the end over de t. And so we can write it down like this D v and D T. And by the way, in engineering, they also use a variable dot This dot means that some kind of variable is differentiated with respect to time. So you have simply taking the derivative with respect to time and you put the dot there. It was just a faster way to write this. But the rate of change off war inside the tanks is to t. Which means that the in this case, water getting out of the tanks increases the rate of it increases. So essentially, what we have to do we have to get from this from the time derivative off the William off water. We have to get to the original for right. And now where they know how to go from the original form to the time derivative, that means that we take the derivative with respect of time. No, the other direction is called anti derivative or it's also called Indefinite. Integral is, and we're gonna cover that soon. But for now, we're just gonna assume that. Okay, If we have some kind of function, why equals X squared? Plus some kind of constant. So if we take the derivative off, why, with respect to X, then we're gonna have t X and see you will be zero. Right? So see you will be zero. Because the directive for Constant is zero. It means that if I take the anti derivative Rovian, which is to t if I take the anti derivative of it. I will get the end as a function of time equals now the constant here, the constant here would be 95 right? That's our initial condition. So our initial volume inside the inside the tanks and now the volume off water inside the tanks will decrease. So we have from 95 which is our initial condition. We have to subtract t squared and if you take the derivative of it, then this becomes zero and you will have well minus two t. So, essentially, when they say that, suck the water out of the tanks at the rate of two t, then the rate is minus two t because your volume of water, the inside the tanks, decreases. So it's negative. The rate off changes negative. And so if you take the anti derivative of it, you will have this equation. So again, this is your rate of change, which should be negative because the amount of water inside thanks decreases. And then you take the anti derivative that we're gonna cover later and you're gonna get a function something like this with a constant. And in this context, the constant would be 95 which is your initial condition and then you subtract t squared from that constant. So essentially what you will get, you will get an upside down parable. Right? So you will have some kind of parabola. So you will have 95 here and then the requirement was that Stop when you're volume is 50 cubic meters, which means that if this is 50 here, then you will stop here. So you are really just considering this part of the parable. So from 95 up until here and now what you need to find you need to find the time when that happens. When that problem reaches 50 kilometers, you need to find the time and we will denoted with TF, okay. And the way we're gonna find that TF it's very simple. We're just gonna take this equation and we're gonna equated with 50 50 cubic meters and we're gonna say that OK, then this time will be t f and you will find it like this using pure algebra so you will have d squared equals 95 minus 50 equals 45. And that means that your time your end time, your final time will be square root off 45 seconds, which approximately is 6.71 seconds approximately. But I don't want to lose the precision, so I'm gonna keep it in this for now. This is only four for this task right now. We also had the previous task, which was 32.5 seconds. So in total are TF will be in total. It will be 32.5 plus square root off 45 seconds. So in this one, this one, this number comes from from the first task. Right? So I should specify that this is TF to just for the task to. And this one was for the task one. And now this is tasked to. So the total time from the beginning off the task one is 32.5 plus squared off 45 seconds. So, in other words, we can write our equation. Are peace fives Defiant equation like that V one equals V to equals the three. So allow the tanks. The volumes for all the tanks equals 95 minus t squared. And now the time would go from 32 0.5. Right? That's the end of the first task That's when all the tanks finally reached 95% off the volume off each tank. Then, in the first task very to print, fire was included. So now it's excluded. So just t is bigger than 32.5 and smaller and equal to then 32.5 plus square root of 45 seconds. Okay. And the volume for all the tanks or for each tank will be 50 kilometers when time is bigger than 32.5 plus square of 45 seconds. And that would be your task to So again you can write in your program that okay, when the time goes from 32.5 seconds still 32.5 plus square root of 45 seconds. Remember this approximately six points 71 seconds, then control the pumps using this rule, this law and after time equals 32.5 plus square root of 45 seconds. After this time, stop the pumps and then the volume off water in each tank will be 50 cubic meters. So that was tasked to. And now let's go to task three 15. CORRECTION: MEGA Application - Water tank example 3: here, I would like to discuss about an issue that I had missed before. So when we talk about merging, do tasks right, because before we treated two tasks separately and when we treated two tasks separately, then we assumed that the time would start counting at the beginning off the task. So in other words, when we started with Task one, we assume that at the beginning off task one time equals zero. And then we started counting, right? And then at the beginning, off task two. We also assumed that the time was zero seconds at the beginning of task to and then we started counting. So this equation here it's for the task to right. So the water level at the beginning was 95 cubic meters and then it started going down para biblically. All right, now it's important toe Note that when we did task to, then we assume that at the beginning, time was zero seconds and then it was square root, 45 seconds at the end. Off task to However, now that we want to merge these two tasks task one and task to then we need toe shift this function because if before you look at this function, this is from task to before we start that. Okay, so at the beginning, off time equals zero seconds. We have 95 cubic meters off water in our tank and then it goes down up until 50 cubic meters. Parabolic lee. Right? So that was what we assumed before. But now when we merge those things together, when we merge both of the tasks together, then what really happens is that task one Goche from zero seconds to 32.5 seconds and only then task two kicks in and the level off water starts falling down from here till here, up until 50 cubic meters. Right? So, in other words, past two does not start at t equals zero seconds. And so if you think about it, then you need tohave. 95 cubic meters at time equals 32.5 seconds. Right? So if you just have this kind off equation and then if you put here 32.5, then you would have 95 minus 32.5 squared. Right? There's do 0.5 and squared. And that does not equal 95. Hugh meters. But you, when you merge those two tasks, then you need to have 95 kilometers at 32.5 seconds. So therefore, what you have to do, you have to shift the function and in order to shave the function is just like we did before T minus 32 point five squared. All right, So the conclusion here is that when you merge those tasks, then your task to goes from 32.5 seconds to 32.5 plus square with 45 seconds. And it is extremely important that you don't forget this. You need toe shifted like this. T minus 32.5. And this entire thing you square it. And that was when I missed previously when I merged Task one and task to. And when I wrote that piece flies defined equation, I didn't shift the function. So there was my mistake and in task three, I will also have this kind of mistake. And in the end of task tree, I will also make this correction. All right, So see you in task. Three 16. MEGA Application - Water tank example 4: so welcome back. And now let's do task three in task three, you have to vary the volume in tank One in such a way that it also lets so at the beginning . Your volume in the tank after the task after the second task was 50 kilometers and then you have to vary it plus minus one cubic meter every second. So here's a small graph. So this is the one, the volume off the water inside the first tank and then this is one second Here you see, you have 50 and then you in one second you have to increase the volume or four order by one cubic meter and also decrease. But one cubic meter, so 0.5 seconds, you increase it and then you reach the original level and then you're decreases and reached the original level. You have to do this oscillation for 10 seconds now for tank to what you have to do, you have to do the same oscillation. But the amplitude is higher. So in one second you have to increase the William by three cubed meters and then go back and decrease did volume by three kilometers. So you go from 52 53 and then you go to 47 and then you go back to 50 and all that has to happen in one second. So and that needs to happen for five seconds. And then during the other five seconds, you have to changed program for for the second tank and you have to make it so that it would have the oscillation amplitude off one cubic meter. So now you go from 50 to 51 then 49. But now you have to change the frequency. You have to increase the frequency twice. In other words, in one second you have to go from 50 to 51 to 49 to 51 2 49 and back to 50 and you have to do all that in one second. So you see, you have two cycles here. One cycle is your open five seconds and another cycle in the open five seconds. And you have to do that consolation for the second thing for five seconds as well. And then the third tank here, it would be like the first thank you oscillated between 51 49. However, in the third tank. It's gonna be upside down. You first decrease the water and then you increase it. So in the first, thank you went from 50 to 51 and then 49 then 50. Now you're gonna go from 50 to 49 and then to 51 2 50 and this isolation has to take place for 10 seconds. Okay, so how would we approach this problem? Let's start with Tank One. So we're gonna denoted with V one equals and, uh, well, first of all, if you remember the trigger, no metric function. The sine function, right. She had the ratings here, and then the sine function vary between one and minus one. So that was the property of the sine function. It's varied between one and minds one. And then we also had one video about the wave example where we decided to model where we decided to model in the wave and we modeled it like this Two pi times f times t. So what do these components mean will to pile? It was just a circle right. One rotation around the circle, so just rotates around the circle One time and we said that it was one radiance per cycle and here the cycle was one rotation around the circle and the frequency was how many cycles you have in one second, right? And then the time is how much time you're considering which had the units of seconds, and then you could cancel out seconds and cycles. In the end, you would get radiance however you would. In the end, you would have. Okay, if you if you just omit the time, then you will have how many radiance you will go through in one second and then you would multiply the time. So how? Maney radiance in one second how Maney, Let's say how many rotations in one second. So in this case, for example, you would have two rotations in one second, so two cycles in one second and then you will multiplied by the amount off seconds. Now let's try to Mali. Then let's start with the first tank and remember, your initial condition was 50 kilometers, right? So if your initial condition is 50 kilometers, then you will have a constant off 50 kilometers, and then you will simply write 50 plus sign to apply which is radiance per cycle times the frequency which is cycles per second. In the first tank you had one cycle per second. So you will put one and times t right. And we said that it has to happen for 10 seconds, which means that your time from the task to which was 32 plus square root of 45 seconds would go from that. But that was excluded because it was included in task to and now the time would go to for 10 seconds. So it will be 42 plus square root off 45 seconds. Right. And then after 10 seconds when t is bigger, then 42 plus square root of 45 seconds, you will again have 50 cubic meters off water inside your tank. And again it will be a piece Wise function. How about the second tank? Will the second tank Well, billing this so first of all, your initial condition is 50 plus the first week for five seconds, we wanted to Arsal eight the volume not plus miners one kilometers, but plus and minus three cubed meters. So how do we manipulate the sine function? Well, we're just gonna increase the amplitude, right? So it will be three 50 plus three sign two pi times, one times t No, The time for that scenario will go from 32 plus square root of 45. That's time goes from this till now for five seconds. Remember, This one was for five seconds and that would mean that 37 plus square root off 45. And then everything changed and the amplitude decreased to Teoh. One kilometer upend one down. So from 50 to 51 and then 49. But the frequency increased. So in one second you have to do to cycles, so you would have 50 plus. Now it's one just like here. One sign, two pi radiance per one cycle times to cycles for one second and times t. Okay, so now you see that the frequency has increased twice and that will happen from 37 plus square root of 45. And the time goes from 37 plus squared 45. And now it's excluded because here it was included. Now it's excluded, and then it goes to 42.45 42 plus 40 five seconds and then After that, it will stop and you will have 50 kilometers when time is bigger than 42 plus square root of 45 seconds. And again, a piece wise defined function. And finally, you're gonna have a few three, which is the volume of water inside tank three. Now it would be almost like the 1st 1 However, remember, it was the it was upside down. When the volume goes up in the first tank, it has to go down in the third tank. So instead of one what you would write it like that plus But then you're magnitude now becomes negative. So it's miners one and of course, minus and plus will give you a minus and then you will have again sign to pie. You don't change the frequency. You don't change the amount of cycles per second. So it's gonna be one times t and that will happen between 32 plus square. The 45 seconds up until 42 plus square root off 40 five seconds. And after that again, the program will stop the pumps and you will have 50 cubic meters when the time is bigger than 42 to us squared 45 seconds. I just don't want to lose the precision. That's why I keep the square root here. I can always put it inside the calculator and know the real number. And by the way, when you program in your computer and it's always better to insert numbers like this in order not to lose precision because the computer can make those calculations very easily again. It's a piece wise defined function. And that's how it would look like that was Tasked. Three. So in the next video, we're going to generalize all those tasks and we're gonna victor rise are vector that represents the volume of water for each tank inside the building. 17. CORRECTION: MEGA Application - Water tank example 4: this part of the video is again to correct my mistake where I didn't shift the functions off Task three when I merged them. And when I wrote down the peace finds defined equations. So that's how task three really looks like when you merge that task three with task one and task to and you assume that time does not start at zero seconds. But you assume that the time starts at 32.5 plus square with 45 seconds and ends at 42.5 plus square root 45 seconds. So the difference that you see from the previous part of the same video of this video is that now I just shift the functions. So that's what you should do. You should shift the function by this amount 32.5 plus quarters, 45 seconds because you start and this time and therefore here, when you don't have just time, you have time miners and then this number. So you shift this sign of soil function to the right by this amount every 2.5 plus squirrel , 45 seconds. And so you can think of it as a vector now. So the first vector element is for the first tank. Second Victor Element is for the second tank, and the third victor element is for the third tank. So please don't forget it. Please remember it. It's very important you have to. When you merge these tasks, you have to shift the functions unless they are the first task there. The first task than in the first task. You don't need to shift anything because you start from time because zero seconds, but in task do. And in task three and four and five and six. And Sarah, when you don't start a time because you're seconds, you have to shift the function and you do it like this. All right, see in the next video. 18. MEGA Application - Water tank example 5: All right, Welcome back. So this is the combined solution off the entire mega application. So what you're seeing here is a vector with three vector elements. So this piece flies. Defined equation is for tank one. This one is for tank too. And this one is for tank three. And so if you combine all these equations together, then that's how they will look like. And again, it's very important to note that unless you're in task one, then you have to shift the functions. So here I have shifted the function by 32.5 seconds and here by 32.5 plus scored with 45 seconds and the same thing here in tank to and the same thing here in tank three. So that's the important part. And here you can see the volumes off the inside the tanks graphically. So tank one tank to and Tank three notice the lines here are parallel. That's because in the task one, they they're increase waas. The rate of change was the same for we won we to envy three. So we want reached here and then waited for V to be tourist here waiting for V three when we three reached 95 cubic meters off its volume. Then all of them at the same non concentrate decreased volume inside their tanks. Then there they reach 50 cubic meters. Now here they start oscillating for 10 seconds. I'm gonna zoom it in and I'm gonna give you another graft for that. And then there you go. They stayed at 50 kilometers and this is the zoomed part. Then this is task three, right? This is Tasked three the oscillation task where you have tank one and you have tank to which is blue. And then you have tank three, which is green. I'm just gonna write down. This is tank too. And then you can see the tank one also lates at one at frequency one hertz or one cycle per second. So you see these air seconds here. So it's one second. Two seconds. Three seconds. Four seconds and five seconds. And then 6789 10. So the the red one are Soleil. It's like this now the green one all oscillates like there, like the red one, which is tank three, but in the opposite direction. So first down and then up between 49 51 and again you can see that. Okay, this is 1st 2nd this is the 2nd 2nd three, four and five, six, seven, eight, nine and 10. So it also lights like that in the opposite direction Stank three, the green one. And then the blue one is the tank to during the 1st 5 seconds. It Ossa Leight's with the amplitude that is three times greater than, uh than the tank one and three. So you see the same frequency that the tank one and three. But the amplitude is greater. You see, It has a greater amplitude. The volume. Also, it's more in one second the greater amplitude. But during the time, from five till 10 the amplitude is the same, but the frequency the frequencies twice as much. So it also lets two times faster, then tank one and three. You see, so to do one cycle it takes tank one and three one second, but full for the second tank. It takes only the European five seconds and then another 0.5 seconds. So that's how you can control the volumes of water using mathematical functions. And in fact, you can use these functions in many different systems later on. We're also gonna I'm gonna show you how you can use the same functions to control the motion. Often object in a two and three d space, and we're we can you use it to create spirals and increasing decreasing spirals. And essentially, you can then simulate how an object, maybe like an airplane, flies in space using mathematical functions. It's gonna be and vectors is gonna be very interesting. So thank you for attending this lecture. I'm gonna have a small exercise for you and now and see you next time. 19. SIM: MEGA Application - Water