 Good morning everyone, ok. How many of you have used Sylab? Has anyone used Sylab? Anyone used MATLAB? Ok, some of you have used MATLAB, ok. So, Sylab is an alternative to MATLAB, so I am going to tell you some of the good things about it and I am going to explain to you why you should use it, why it will be useful in this course and also in other courses and possibly in the future as well. Some of you may want to take it up as your career, it will become clear as we go along. So, this is a possible outline for this. I said possible because we are going to do some calculations and depending on the interest you show, we will do lots of things and then we may cover all of this or only some of it, but we will certainly do the things that you want to. We will start with a brief history of Sylab. It was started by Professor Cliff Boller who was a computer science professor in New Mexico State University. He was in robust algorithms project that means how to compute Eigen values, how to solve linear systems accurately without any mistake, even for large scale systems it should compute correctly and in time. So, he got funding from the government, US government to develop MATLAB. What is this MATLAB? By the way MATLAB in Fortran that is the original MATLAB this we are talking about in the early 80s or late 70s. From 75 onwards you can say 75 to 80 was the time frame. He released this MATLAB in the early 80s as open source. This is written in Fortran that was one of the conditions for funding that whatever is created should be released as open source, but some people got the idea that they can actually commercialize this. So, they started with this open source thing and started their own companies. There were two products Matrix X and Control C that came out of this MATLAB. They added some user interface, added documentation, added some extra features they started selling it and it became very successful. Matrix X, Control C and then after seeing this Professor Mohler realized that he made a mistake in releasing it as open source. He also quit his university position. He started his own company called Mathworks and he wrote the entire MATLAB in C because it became commercial. Of course now it has grown very big. They have about 2000 staff members working for Mathworks. This is the story of early history. Out of this came SyLAB also. Some French people said that they would also go commercial. They started with the open source MATLAB and then they wrote, they called it BLAISC or something like that, but they found that they were not selling any copies. Maybe they were selling something like one copy a month. So, they figured that it was not at all economically viable to sustain that operation and so they said they would become open source. So, they released it as open source. So, I would say probably from late 90s SyLAB is available as a open source software. It is equivalent of MATLAB. You see that all of them have come from the original MATLAB. So, they are all MATLAB compatible. SyLAB will be about 95 percent compatible. And these packages are used extensively for linear algebra, simulation, solving that is solving differential equations, signal processing, control system design, identification. You name it, it is any one of these is used. Matrix X and control C, we do not hear much about that about them. So, we have mainly only these two MATLAB, which is the commercial thing and SyLAB is just the opposite. It is completely open source. And SyLAB is created for mathematicians. So, whatever I am saying now is applicable to all of these packages, but my focus is going to be on SyLAB because I am going to also emphasize why SyLAB is important to you, why we should adopt SyLAB, why we should use SyLAB in our calculations. As I told you, Clem Euler when he was teaching mathematics in the class numerical analysis multiplying matrix by vector and so on, he saw a disconnect between the way he was teaching in the class and the way it was coded. Because when you write, when you want to tell your class, I want to multiply matrix A with vector X, you just type A into X. Whereas when you go to implement that, you have to type it, you have to allocate the storage, you have to do a for loop, you have to compute, you have to do lots of these things. He said why should computation be more difficult? Why cannot the computer do understand what the mathematician wants to do and implement it? So, he came up with this environment. So, I have simultaneously opened SyLAB environment. So, if I, for example, supposing I say A equals 1, 2, 3, 4, 5, 6, 7, 8, 0, I have got this matrix A and then suppose I have the vector X. So, I have got this vector X. Suppose I want to multiply these two, I just have to type A times X. So, this environment was created for mathematicians. Like the way they would do mathematics in the class. If you want to multiply a matrix and a scalar, you would just type, for example, 2 into A, it will do that. So, he said why cannot it do that? So, for example, 2 times A, it will just do that. It will multiply, it knows that it is doing a vector scalar arithmetic or matrix scalar arithmetic, it should do that. And notice that I did not type it, I did not allocate storage, I did not do any of that and it does that automatically. So, as a result, this SyLAB is created for mathematicians and it enhances the productivity of the programmer. You can just come to the calculation directly. This is what I said just now and belongs to the MATLAB family, originally created by Professor Clay Muller. It can call programs written in FORTRAN and C. It has a good graphics capability. It has a very large installed base and it also has an underlying language, interpreted language. For example, it has if then else loop, for loop, while loop, case statement. It is possible to define a function. So, it has an underlying language. So, using that you can actually define your own algorithms and above all it is free. That is actually extremely important. I am going to talk about that soon why it is important. I want to spend some time on why we should actually go for open source software. It is extremely important. Commercial software is expensive and possibly for students it may be cheap. How many of you have installed MATLAB? How many of you bought? Unfortunately, actually the company does not mind even if you use illegal copies. It does not mind, but the issue is something else. Students use commercial software in colleges. Unfortunately, it is not available at small and medium companies. The reason is the cost. So, use of unauthorized software by commercial establishments result in disasters. Companies may even have to close down, have to bear jail sentences, etc. And as a result, most of the SMEs in India do not use any software. Especially this is especially true for high tech software where the cost differential is enormous. If you take something like Microsoft Office, there may not be too much difference between academic price and commercial price. But some other high tech software packages may be available may be available only at very high prices. May be 100 times, sometimes even 1000 times because you may even get a free copy in academia. So, if you multiply it is going to be 1000 times, 10,000 times. So, it will not be. So, I would even say that. So, as a result this puts companies at a great disadvantage because we do not use commercial software because these after all software packages are written to improve your productivity. To predict things, to solve your problem, to solve a model, so on and so forth. And so, I argue here that there is no alternative to open source software and commercial software that is 1000 times more expensive for industry is like a book that you cannot use outside the classroom. And it has. So, actually it creates a lot of possibilities. For the potential entrepreneurs that it is possible for you to offer consulting services using something like SILAP or something along those lines that you can actually you are because the platform is free free of cost. And the final delivered product also will run on in the company without any further additional investment. So, as a result it gives lot of exciting opportunities. We have a long way to go in this country. We have to solve many problems. Our industry has to solve challenging problems especially if they want to compete with other people, other companies, other companies from other countries. So, this will using reliable software, open source software has a great potential and we desperately need this. Now, I will start with the usage of SILAP. I will give some outline, some of the features. It is not possible to cover all of it. I want to give you a flavor of SILAP in the rest of the stock. The way I have arranged this slide is my commands are given in black. And the resulting answer is in blue. And in the second line can somebody tell me why B is not displayed? There is a semicolon. So, SILAP says that any time you put semicolon the result will not be a code. A plus B plus C it will say 22. In the first one I just computed it puts the result in ANS short form for answer which is the default variable. Otherwise I can assign them to variables and I do the computation. The computational result also goes to some default thing called ANS. Before I proceed there is one thing that I want to tell you. So, before I get started there is another brief. This is also extremely important for you. There will be some people who will come and say this is open source software may not be that good. Don't use it, our product is lot better, no bugs and so on. So, I have gone to the website of first SILAP user conference and this was held on 1st July 2009. If you look at the program, the program as well as presentations used in that conference are there. If you look at the keynote address I gave this talk National Mission on Education through ICT open source software. And of course, if you go to the presentations here the talk material is here. I wanted to tell you refer to not to this talk, but to the talk given subsequently in the afternoon on this talk at 330 use of SILAP for space mission analysis theory Martin CNES. CNES is equivalent of their ISRO. Through Arian they have launched several of our satellites. In the early part of our ISRO's history they used to launch our satellites. So, I after the I was chairing that session I asked Dr. Martin the senior manager in CNES I asked him after his talk was over. His talk is here by the way you can go through the presentation. So, he went on explaining how they use SILAP in their space mission. So, I asked him finally is there any application for which you don't use SILAP that was my question. He said no they use SILAP for everything. So, if somebody say SILAP doesn't work don't believe them don't believe them. So, that is an important thing I wanted to tell you in case there are some myths. One of the things that you should do when you use SILAP is to open a file open using a command called diary. So, that whatever you do from that time onwards will go to that file and then you can save that file go and delete unnecessary things and then you have the working version. So, let me just check. So, this is my ok. So, let me say diary test dot alright. So, from now on whatever I do will go into this file called test dot se which is in this directory which I got using the pwd command ok. We saw all of this anytime you have a semicolon result is not a code otherwise it is a code by the way I will put this pdf file also ok. SILAP has variables predefined variables reserved variables for example pi you have to put a percent sign in front. This is different from MATLAB in MATLAB you will just type pi otherwise you will say percent pi. So, you can do things like this. So, if you want to create a vector you can say x equals 1 through 5 you will just say 1 through 5. You can do things like x y equals 1 in increments of. So, let me just do this 0 in increments of 0.2 all the way up to 1 ok. So, I will just create it and then I can say something like let me see. I can also say x z equals lint space of 0 to 1 and 6 points right there are 6 points here that will also be you can use the lint space you can do you can of course enumerate the whole thing. So, there are many ways to create vectors and so after defining this you can calculate sign of this ok y equals sign of z. So, it has created now what I could do is I can say y equals 0 to 0.2. So, let me not just do go up to 1, but go up to 3 multiply the whole thing by percent pi right. I am creating a vector 0 to 3 in increments of 0.2 multiply the whole thing by pi and I put a semicolon ok. How many numbers what is the length of y? What is the length of y? 16. Length of y is 16 because you have an extra end point you have to add that 15 plus 1, 16 right. So, I can say z equals sign of y and then I can say things like plot 2 d of y comma z. If I have more points you will get a smooth point smooth curve. So, you can do all this calculations. This is very interesting. So, let me do the following a equals 1 through 5 b by the way Sylab is case sensitive small a is different from capital A just like in c, but between c and Sylab there is a difference the indexing is from 1 in Sylab whereas, in c you will start with 0 ok. So, b equals 1 through 2 to 1 in increments of 2 all the way up to 9 ok. Now, what will this give? b of 1 is to 2 is to 5 b of 1 is to 2 is to 5 what will be the answer? b is here what will be b of 1 is to 2 is to 5 any case ok. First evaluate 1 is to 2 is to 5 what will that give? 1 is to 2 is to 5 what will it give? 1, 3, 5 right starting from 1 increments of 2 all the way up to 5. So, you will get 1, 3, 5. So, b of 1, 3, 5. So, b of 1, 3, 5 will be 1, 5 ok. So, this has that is the reason why I say that it is a high productivity tool right. If you have to you know if you compare assembly and c when you go from assembly to c you can say that 10 lines can be coded in one line. Similarly, when you go from c to Sylab you can say 10 lines of c will get coded into one line of Sylab that is the increase improvement in productivity that is the reason why people use these packages for simulations. It also has lots of very useful libraries. For example, I defined a matrix called A right. If I want to say determinant I want to find the Eigen values from spectrum calculates. If I want to do singular value decomposition you have that so on and so forth. These are all built in and these packages are state of art ok. So, CNES uses this package to launch its rockets. So, you can do things like I of course said b of 1 is to 2 is to 5. I can also do things like d equals b of 1 to 5 followed by 1, 0. So, you can do things like so it becomes 1 to 5 is 159 and then to that you append 1, 0, 1. So, lot of these calculations can be done very easily. What will happen if you do 1 is to 2 is to 8? Let us try that. So, this is our b, b of 1 is to 2 is to 8. What do you think will happen? Nothing is defined beyond that either it could complain or it could give its interpretation of what the answer should be. So, let us see what Sylab does. It says error, but some other implementations could go up to 1, 5, 9 and stop there. So, you want to. So, what is d? Some other variable let us do this. It may not even accept it. Are you saying that something like this b of 1 is to 2 is to 8? No, that we can do. So, if you just say 1 is to 2 is to 8. So, ideally it would have gone till 9, but because 8 is there it will stop at 7, it will stop at 7. And then of course, as I mentioned this is I am subtracting a scalar from a vector. I am multiplying times a minus b you can do all of this. That is not a problem. It has a command called dot. For example, a is there it is a vector. What do you mean by square? There is no meaning square of a matrix, but here I am using a dot raise to up arrow is raise to the power, but dot raise to means you raise each element by that. So, it will be 2 to the power 2, 3 to the power 2 and so on. Here I raised a dot raise to the power a itself. Then it takes appropriate value. For example, here it is 5 to the power 5. You can of course, do a dot divided by b and then in fact, I would want you to try out some of these things. All these calculations I would want you to try later and see if you can answer say see if you can explain some answers. Some of the answers are quite interesting. Some of them have deep meaning. We do not have time to discuss, but if any of you would try and then ask me, I will be glad to answer them. It has logical operators. Obviously, you need all this if you want to construct a language. We will come to that before that I will do some examples here. You can compare you know things like this. Let me just do this. Do the following. Before I proceed, let me just close the diary so that I do not forget at the end. I have closed the diary. We created the thing in test dot a c e. So, I have if I am not mistaken e max here. So, what I will do is just hold on a second. Hopefully, I can make this bigger, the largest size I have. I hope you can see some of it if not all. You can see that whatever we did, for example, the first line here says error invalid index. You may recall this. So, you can go to this at the end of the session delete all unnecessary commands or all the commands that did not work. Then you have a set of commands that work. I would want all of you to practice this, to use this. Start using silo open a diary file. Then you do not have to remember anything that you did. There is a slave, the diary that is going to remember all this for you. Now, so let me say gpa. Let us go to our calculation. gpa equals 7.8, 8.3, 6.2, 5.8, 9.1, 7.2, 6.8. So, these are the numbers I gave last time. Then I say let me say m equals mean of gpa. We will find the mean and then s equals standard deviation of gpa. So, it has calculated. Then I say find gpa greater or equal to m and gpa less than m plus s. So, this is the number of the two. So, from mean equal to or greater than mean up to one standard deviation. Let me find all of those. So, what do you think it will give? So, it is going to give from 7.3 all the way up to 8.4 for 2 or something like that. It will tell you only those locations and that corresponds to look at this. Only these two numbers come under that. So, it helps you in a vector do a search and locate those positions where some condition is satisfied and it is a vector. You can do it for a whole matrix. Then you can also ask things like you can recall the previous commands by using up arrow. So, what I do is let me close it here and I say gpa of that, gpa corresponding to that index. So, then I can also say something like grades, grades. Now I am creating a new variable called grades. So, suppose I want to give AB to this. So, I have to say it is a character, it is a string. Actually, I had defined this already. So, let me clear grades. It will say grades undefined variable. Now it says AB. So, I can also say something like if it is greater than or greater than or equal to m plus s. So, suppose I give a a to this. So, it has given a a and in between it is undefined. So, this search, locate and so on are extremely useful. So, here for example, I have two variables a and b. I am comparing a and b. So, it gives all of them to be false. A and b are nowhere equal. And what will happen if I say t f equals a greater than b? What will be t f? a greater than b, it will be false, false, false, false from here onwards it is true. So, I would want you to try this. I will just refer you to one file and then I will post this file also in the website. Then you would need that. So, this file I will be conducted a workshop jointly on July 6. In fact, this ministry funding was used for this purpose. It gives examples of for loop. It gives a for loop example while expression and then loop breaks k statement and then function. And then there are also online functions how to define them. And it is possible to save the functions into a file and call from there. Examples are given. So, it is not possible to cover all of it in this class. All examples are here. We will post lot of these. If you have difficulty, you can ask me. So, I want to thank you.