1 00:00:04,720 --> 00:00:10,520 So the question is, what are the Pomo elements and what exactly Pyomo is doing for us? 2 00:00:11,170 --> 00:00:18,790 So to answer this question, you should know that it's you who writes down the problem description. 3 00:00:19,270 --> 00:00:23,560 So you have to mathematically model your problem. 4 00:00:24,370 --> 00:00:33,430 Suppose you to solve the problem and you want to have some specific amount of proteins, carbohydrates 5 00:00:33,760 --> 00:00:36,250 and also, for example, fats in your diet. 6 00:00:36,280 --> 00:00:41,890 OK, and you need to be able to choose how much, for example, rice I should take. 7 00:00:41,890 --> 00:00:46,660 I should how much meat I should say, how much bread I should eat every day. 8 00:00:46,690 --> 00:00:54,460 OK, so this is the typical diet optimization problem in a way that not only I'm paying and the minimum 9 00:00:54,460 --> 00:01:02,290 amount of money, but also I supply them the required amount of vitamins, proteins and different things 10 00:01:02,290 --> 00:01:02,890 to my body. 11 00:01:03,800 --> 00:01:12,980 And so you have to somehow mathematically formulate your problem so Palomo doesn't understand the physical 12 00:01:12,980 --> 00:01:14,330 nature of that problem. 13 00:01:14,360 --> 00:01:20,740 You know, it doesn't really understand what is the physics or what is the diet or what is whatever. 14 00:01:20,930 --> 00:01:22,960 So it only understands the mathematics. 15 00:01:23,180 --> 00:01:30,410 So you have to mathematically formulate your problem and then and pass it to the solver. 16 00:01:30,440 --> 00:01:33,710 So I should say that Pyomo does not solve your problem. 17 00:01:33,740 --> 00:01:37,960 These are the solvers who solve your problem. 18 00:01:39,270 --> 00:01:50,580 This means that Pyomo is only acting as a translator, so it will translate your problems for the developed 19 00:01:50,580 --> 00:01:52,780 solver, which is at the back of the problem. 20 00:01:53,190 --> 00:02:00,100 So and for for this reason, we have to know what are the components of each promo code. 21 00:02:00,300 --> 00:02:04,990 So first of all, the model, the model is the most important things in the home. 22 00:02:05,130 --> 00:02:06,690 You have to create your model. 23 00:02:06,700 --> 00:02:12,300 You have to build your model based on the actual problem you are trying to solve. 24 00:02:12,330 --> 00:02:19,380 OK, so the models can I can take different forms, abstract form, concrete form and abstract form 25 00:02:19,380 --> 00:02:22,760 is a more general way of representing the problem. 26 00:02:22,770 --> 00:02:29,790 So it means that four and a set of variables or a set of elements, these are the relation that should 27 00:02:29,790 --> 00:02:30,540 be valid. 28 00:02:30,660 --> 00:02:35,700 But concrete ones are numerical values inside the constraint. 29 00:02:35,700 --> 00:02:45,780 So every promo code can be can have different elements, for example, the sets and variable parameters 30 00:02:45,780 --> 00:02:48,120 and constraints and objective. 31 00:02:48,570 --> 00:02:56,990 So the set can take different values, for example, and also solving that and visualizing that. 32 00:02:57,000 --> 00:03:04,750 OK, and this part that I have a specified constructor, Palomo elements, OK, and then we can visualize 33 00:03:04,750 --> 00:03:04,860 that. 34 00:03:05,110 --> 00:03:08,520 So let me give you some examples regarding the sets. 35 00:03:08,700 --> 00:03:15,870 For example, the sets can be defined as the range that is starting from one to model that NP, or it 36 00:03:15,870 --> 00:03:18,660 can be defined as an empty set like this. 37 00:03:18,810 --> 00:03:29,430 And then using some data file, you can fit the required data into the set or the next one is the variables. 38 00:03:29,430 --> 00:03:35,190 For example, the way you define your variables is this and some variables are defined over the sets. 39 00:03:35,190 --> 00:03:36,150 Some of them are not. 40 00:03:36,150 --> 00:03:38,610 The final word says they might have some bounce. 41 00:03:38,700 --> 00:03:44,030 It means that the variable is changing between these two limits, the minimum value and maximum value. 42 00:03:44,030 --> 00:03:47,610 You can initialize them and they have some domain. 43 00:03:48,000 --> 00:03:51,120 It means that what is the type of the variable you are dealing with? 44 00:03:51,240 --> 00:03:54,800 It can be real, it can be binary or it's real. 45 00:03:54,810 --> 00:03:55,710 It can be positive. 46 00:03:55,710 --> 00:03:58,290 Real person fractioned. 47 00:03:58,290 --> 00:04:05,490 It can be something real between zero and one negative real need intervale the same as zero to one or 48 00:04:05,550 --> 00:04:06,780 non-negative real's. 49 00:04:07,230 --> 00:04:15,000 Or it can be binary boolean and positive integer non positive integer and negative integer and no negative 50 00:04:15,000 --> 00:04:15,420 integer. 51 00:04:15,450 --> 00:04:23,240 OK, these are the different types of the variables that you can have in a promo code or the parameter. 52 00:04:23,430 --> 00:04:28,110 These are the constant numbers that are before solving the problem. 53 00:04:28,110 --> 00:04:29,850 We know their values, OK? 54 00:04:31,000 --> 00:04:36,970 Um, or the constraint, the concerns are very important, these are the equations describing the relation 55 00:04:36,970 --> 00:04:40,100 between the variables set and also the parameters. 56 00:04:40,120 --> 00:04:45,720 For example, you have to define, um, you need to choose a name for each constraint. 57 00:04:45,730 --> 00:04:52,090 So model that zero is equal to constraint, that constraint that a specific one is defined over a model, 58 00:04:52,090 --> 00:04:54,950 ie, which is a set and a rule. 59 00:04:55,480 --> 00:04:57,610 So you have to separately define the rule. 60 00:04:57,610 --> 00:05:01,570 That's a specific rule is named, uh, zero rule. 61 00:05:01,730 --> 00:05:05,240 So that's zero rule is defined override the same as here. 62 00:05:05,260 --> 00:05:13,690 So if you have I have to have I here and returns the summation of the model that you ija for J in model 63 00:05:13,690 --> 00:05:16,110 J is less than equal to one. 64 00:05:16,120 --> 00:05:21,530 So that does the summation of a J and the remaining set is I which is here. 65 00:05:21,610 --> 00:05:28,810 OK, and finally the objective function, the objective function has the same kind of role as the constraint. 66 00:05:28,810 --> 00:05:34,690 But and in this way we want to optimize it in two senses. 67 00:05:34,990 --> 00:05:36,070 It can be minimized. 68 00:05:36,070 --> 00:05:37,270 It can be maximized. 69 00:05:37,300 --> 00:05:37,660 OK. 70 00:05:39,120 --> 00:05:49,170 And so for the soul of a statement, and this is very important, as I already explained, and the soul 71 00:05:49,170 --> 00:05:53,860 of the statement is asking Pomo to solve the model. 72 00:05:53,880 --> 00:06:00,140 So if it's a concrete model, you have to choose a solver and ask them to solve the model. 73 00:06:00,660 --> 00:06:02,580 But it's an abstract model. 74 00:06:03,060 --> 00:06:07,800 After choosing the right, um, solver, you have to create an instance. 75 00:06:07,800 --> 00:06:15,210 It means that that is snapshot of the model, the model with that given and the input data so you can 76 00:06:15,600 --> 00:06:25,020 define that file and put those input value, input, input parameters inside that file and then ask 77 00:06:25,020 --> 00:06:30,450 the PYOMO to solve it for you using the chosen solver. 78 00:06:30,720 --> 00:06:35,790 OK, and here you know that. 79 00:06:35,790 --> 00:06:38,460 And after that, it's the final version. 80 00:06:38,520 --> 00:06:40,590 The final step is the visualization. 81 00:06:40,620 --> 00:06:49,080 OK, it's very important to somehow communicate the results of your decision making process for the 82 00:06:49,080 --> 00:06:49,630 audience. 83 00:06:49,800 --> 00:06:50,670 Thank you very much.