1 00:00:00,060 --> 00:00:08,070 This example is referring to the curve fitting problem, so we do have a set of points on a plane and, 2 00:00:08,070 --> 00:00:14,910 um, we want to find out, uh, second degree, uh, expression that. 3 00:00:16,330 --> 00:00:20,330 And approximates the behavior of these points in the best way. 4 00:00:20,710 --> 00:00:28,510 So it means that that line should be somehow representing these points. 5 00:00:29,230 --> 00:00:38,030 OK, so the input parameters are the locations of these points, let's call them and X and Y. 6 00:00:38,500 --> 00:00:46,390 And the question is, what are the coefficients of this expression, A, B, C, or the, um, decision 7 00:00:46,420 --> 00:00:47,150 variables? 8 00:00:47,170 --> 00:00:50,980 OK, so let's have a look at the. 9 00:00:52,490 --> 00:00:53,750 And Python code. 10 00:00:53,870 --> 00:00:55,640 OK, so this example. 11 00:00:56,730 --> 00:01:01,570 OK, so, uh, first of all, I import all the required packages. 12 00:01:02,130 --> 00:01:09,540 This is an abstract model, so and, uh, can be a number of, um, solutions. 13 00:01:10,060 --> 00:01:15,440 That's, um, the number of, uh, points that I want to draw a line between them. 14 00:01:16,530 --> 00:01:24,450 I is the sets that represent each node and also, um, A, B, C are the variables. 15 00:01:25,940 --> 00:01:32,690 And we have a model and that or F, which is going to be representing the objective function, which 16 00:01:32,690 --> 00:01:34,190 is the error of estimation. 17 00:01:34,220 --> 00:01:42,980 OK, so first of all, I, um, create some random points on the plane and then, uh, write down the 18 00:01:43,130 --> 00:01:49,820 objective function, which is model A, uh, multiplied by X, location A squared plus. 19 00:01:50,960 --> 00:01:57,220 Um, B dot model X location plus, C minus Y location. 20 00:01:57,430 --> 00:02:06,880 OK, a. it means that I'm trying to find A, B, C in a way that the difference between the line and 21 00:02:06,880 --> 00:02:09,940 those points are minimal. 22 00:02:11,350 --> 00:02:19,210 They square of that is minimal, and since it's a linear programming, I have to use IP iPod and then, 23 00:02:19,210 --> 00:02:23,250 um, I'm using the. 24 00:02:25,920 --> 00:02:26,520 Model that. 25 00:02:27,630 --> 00:02:28,020 Yeah. 26 00:02:28,960 --> 00:02:32,260 For this purpose and run it. 27 00:02:36,190 --> 00:02:43,540 OK, and the points are here and the line is, uh, true, all of them. 28 00:02:43,750 --> 00:02:44,220 OK. 29 00:02:45,210 --> 00:02:46,140 And that's it. 30 00:02:46,170 --> 00:02:46,680 Thank you.