Difference between revisions of "Scilab/C4/Optimization-Using-Karmarkar-Functions/English-timed"
From Script | Spoken-Tutorial
Sandhya.np14 (Talk | contribs) |
PoojaMoolya (Talk | contribs) |
||
Line 7: | Line 7: | ||
|- | |- | ||
| 00:01 | | 00:01 | ||
− | |Dear Friends, | + | |Dear Friends, Welcome to the spoken tutorial on '''Optimization of Linear Functions with Linear Constraints Using Scilab'''. |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
Line 66: | Line 62: | ||
|- | |- | ||
− | |||
|00:58 | |00:58 | ||
− | |||
|The '''Scilab function karmarkar''' is used for | |The '''Scilab function karmarkar''' is used for | ||
|- | |- | ||
− | |||
|01:01 | |01:01 | ||
|optimizing the linear objective function, | |optimizing the linear objective function, | ||
|- | |- | ||
− | |||
| 01:05 | | 01:05 | ||
− | |||
|subject to linear constraints | |subject to linear constraints | ||
|- | |- | ||
− | |||
| 01:07 | | 01:07 | ||
||on the decision variables. | ||on the decision variables. | ||
|- | |- | ||
− | |||
|01:10 | |01:10 | ||
− | |||
|| We will solve the following example using '''karmarkar''' function: | || We will solve the following example using '''karmarkar''' function: | ||
|- | |- | ||
− | |||
|01:14 | |01:14 | ||
− | |||
| Minimize '''minus three 'x' one minus 'x' two minus three 'x' three''' | | Minimize '''minus three 'x' one minus 'x' two minus three 'x' three''' | ||
Line 104: | Line 90: | ||
|- | |- | ||
− | |||
|01:26 | |01:26 | ||
− | |||
|''' 'x' one plus two 'x' two plus three 'x' three less than or equal to five.''' | |''' 'x' one plus two 'x' two plus three 'x' three less than or equal to five.''' | ||
|- | |- | ||
− | |||
|01:32 | |01:32 | ||
− | |||
||'''two 'x' one plus two 'x' two plus 'x' three less than or equal to six.''' | ||'''two 'x' one plus two 'x' two plus 'x' three less than or equal to six.''' | ||
Line 120: | Line 102: | ||
|- | |- | ||
− | |||
| 01:42 | | 01:42 | ||
|Note that all the functions, objective functions as well as constraints, are linear. | |Note that all the functions, objective functions as well as constraints, are linear. | ||
|- | |- | ||
− | |||
|01:49 | |01:49 | ||
− | |||
||Before we solve the given problem, go to '''scilab console''' and type: | ||Before we solve the given problem, go to '''scilab console''' and type: | ||
|- | |- | ||
− | |||
|01:54 | |01:54 | ||
− | |||
| '''help karmarkar''' | | '''help karmarkar''' | ||
|- | |- | ||
− | |||
|01:57 | |01:57 | ||
− | |||
| and press '''Enter.''' | | and press '''Enter.''' | ||
|- | |- | ||
− | |||
| 01:59 | | 01:59 | ||
− | |||
||You can see the calling sequence of the argument. | ||You can see the calling sequence of the argument. | ||
Line 184: | Line 157: | ||
|- | |- | ||
− | |||
| 02:49 | | 02:49 | ||
− | |||
|This gives the Lagrange multipliers. | |This gives the Lagrange multipliers. | ||
|- | |- | ||
− | |||
| 02:53 | | 02:53 | ||
||Input arguments are ''' 'Aeq' 'beq' 'c' 'x zero' 'rtolf 'gam' 'maxiter' 'outfun' 'A' 'b' 'lb' and 'ub' ''' | ||Input arguments are ''' 'Aeq' 'beq' 'c' 'x zero' 'rtolf 'gam' 'maxiter' 'outfun' 'A' 'b' 'lb' and 'ub' ''' | ||
|- | |- | ||
− | |||
|03:09 | |03:09 | ||
− | |||
|| ''' 'Aeq' ''' : is the Matrix in the linear equality constraints. | || ''' 'Aeq' ''' : is the Matrix in the linear equality constraints. | ||
|- | |- | ||
− | |||
| 03:12 | | 03:12 | ||
| ''' 'beq' ''' :is the right hand side of the linear '''equality''' constraint. | | ''' 'beq' ''' :is the right hand side of the linear '''equality''' constraint. | ||
|- | |- | ||
− | |||
| 03:17 | | 03:17 | ||
− | |||
|''' 'c' ''' : is the '''Linear objective function''' coefficients of ''' 'x'. ''' | |''' 'c' ''' : is the '''Linear objective function''' coefficients of ''' 'x'. ''' | ||
|- | |- | ||
− | |||
| 03:21 | | 03:21 | ||
− | |||
| ''' 'x' zero''' : is the '''Initial guess .''' | | ''' 'x' zero''' : is the '''Initial guess .''' | ||
|- | |- | ||
− | |||
|03:25 | |03:25 | ||
− | |||
||''' rtolf ''': is Relative tolerance on ''' 'f' of 'x' is equals to 'c' transpose multiplied by 'x'. ''' | ||''' rtolf ''': is Relative tolerance on ''' 'f' of 'x' is equals to 'c' transpose multiplied by 'x'. ''' | ||
|- | |- | ||
− | |||
|03:34 | |03:34 | ||
− | |||
|''' 'gam' ''' : is the Scaling factor. | |''' 'gam' ''' : is the Scaling factor. | ||
|- | |- | ||
− | |||
| 03:36 | | 03:36 | ||
− | |||
|''' 'maxiter' ''' : is the ''' maximum''' number of iterations after which the output is returned. | |''' 'maxiter' ''' : is the ''' maximum''' number of iterations after which the output is returned. | ||
|- | |- | ||
− | |||
| 03:43 | | 03:43 | ||
− | |||
|''' 'outfun' ''' : is the additional user-defined output function. | |''' 'outfun' ''' : is the additional user-defined output function. | ||
|- | |- | ||
− | |||
| 03:47 | | 03:47 | ||
− | |||
| ''' 'A' ''': is the Matrix of linear inequality constraints | | ''' 'A' ''': is the Matrix of linear inequality constraints | ||
|- | |- | ||
− | |||
| 03:51 | | 03:51 | ||
− | |||
| ''' 'b' ''': is the right hand side of the linear ''' inequality''' constraints. | | ''' 'b' ''': is the right hand side of the linear ''' inequality''' constraints. | ||
|- | |- | ||
− | |||
| 03:55 | | 03:55 | ||
− | |||
||''' 'lb' ''': is the ''' lowerbound''' of ''' 'x'.''' | ||''' 'lb' ''': is the ''' lowerbound''' of ''' 'x'.''' | ||
|- | |- | ||
− | |||
| 03:58 | | 03:58 | ||
− | |||
||''' 'ub'''' are the '''upper bound''' of ''' 'x'. ''' | ||''' 'ub'''' are the '''upper bound''' of ''' 'x'. ''' | ||
|- | |- | ||
− | |||
| 04:02 | | 04:02 | ||
− | |||
||Now, we can solve the given example in Scilab using '''karmarkar''' function. | ||Now, we can solve the given example in Scilab using '''karmarkar''' function. | ||
|- | |- | ||
− | |||
| 04:07 | | 04:07 | ||
− | |||
|Go to the ''' scilab console''' and type: | |Go to the ''' scilab console''' and type: | ||
|- | |- | ||
− | |||
| 04:11 | | 04:11 | ||
− | |||
|'A' is equals to open square bracket, two <space> one <space> one <semicolon> one <space> two <space> three <semicolon> two <space> two <space> one, close the square bracket | |'A' is equals to open square bracket, two <space> one <space> one <semicolon> one <space> two <space> three <semicolon> two <space> two <space> one, close the square bracket | ||
|- | |- | ||
− | |||
|04:26 | |04:26 | ||
− | |||
|and press Enter. | |and press Enter. | ||
|- | |- | ||
− | |||
| 04:28 | | 04:28 | ||
− | |||
|similarly type: small 'b' equals to open square bracket, two <semicolon> five <semicolon> six, close the square bracket. | |similarly type: small 'b' equals to open square bracket, two <semicolon> five <semicolon> six, close the square bracket. | ||
|- | |- | ||
− | |||
| 04:38 | | 04:38 | ||
− | |||
| and press '''Enter'''. | | and press '''Enter'''. | ||
|- | |- | ||
− | |||
| 04:41 | | 04:41 | ||
− | |||
| Type: 'c' equals to open square bracket, minus three <semicolon> minus one <semicolon> minus three, close the square bracket. | | Type: 'c' equals to open square bracket, minus three <semicolon> minus one <semicolon> minus three, close the square bracket. | ||
|- | |- | ||
− | |||
| 04:53 | | 04:53 | ||
− | |||
|and press ''' Enter'''. | |and press ''' Enter'''. | ||
Line 322: | Line 253: | ||
|- | |- | ||
− | + | |05:07 | |
− | | 05:07 | + | |
− | + | ||
|Now clear the console using '''clc''' command. | |Now clear the console using '''clc''' command. | ||
|- | |- | ||
− | |||
| 05:12 | | 05:12 | ||
− | |||
| Type: '''open square bracket, 'x' opt <comma> 'f' opt <comma> 'exitflag' <comma> iter, close the square bracket equals to karmarkar open parenthesis, open square bracket, close the square bracket <comma> open square bracket, close the square bracket <comma> 'c' <comma> open square bracket, close the square bracket <comma> open square bracket, close the square bracket <comma> open square bracket, close the square bracket <comma> open square bracket, close the square bracket <comma> open square bracket, close the square bracket <comma> capital 'A' <comma> 'small b' <comma> 'lb', close the round bracket.''' | | Type: '''open square bracket, 'x' opt <comma> 'f' opt <comma> 'exitflag' <comma> iter, close the square bracket equals to karmarkar open parenthesis, open square bracket, close the square bracket <comma> open square bracket, close the square bracket <comma> 'c' <comma> open square bracket, close the square bracket <comma> open square bracket, close the square bracket <comma> open square bracket, close the square bracket <comma> open square bracket, close the square bracket <comma> open square bracket, close the square bracket <comma> capital 'A' <comma> 'small b' <comma> 'lb', close the round bracket.''' | ||
|- | |- | ||
− | |||
| 06:09 | | 06:09 | ||
− | |||
| and Press '''Enter'''. | | and Press '''Enter'''. | ||
|- | |- | ||
− | |||
| 06:11 | | 06:11 | ||
− | |||
| Press Enter to continue the display. | | Press Enter to continue the display. | ||
|- | |- | ||
− | |||
| 06:14 | | 06:14 | ||
− | |||
| This will give the output as shown on the screen | | This will give the output as shown on the screen | ||
|- | |- | ||
− | |||
| 06:18 | | 06:18 | ||
− | |||
| where '''xopt''' is the ''' optimum solution''' to the problem, | | where '''xopt''' is the ''' optimum solution''' to the problem, | ||
|- | |- | ||
− | |||
| 06:23 | | 06:23 | ||
− | |||
|'''fopt''' is the value of the objective function, calculated at optimum solution x is equal to '''xopt''' | |'''fopt''' is the value of the objective function, calculated at optimum solution x is equal to '''xopt''' | ||
|- | |- | ||
− | |||
| 06:32 | | 06:32 | ||
− | |||
|and number of iteration required to reach the optimum solution '''xopt''' is '''70'''. | |and number of iteration required to reach the optimum solution '''xopt''' is '''70'''. | ||
|- | |- | ||
− | |||
| 06:39 | | 06:39 | ||
− | |||
|Please note that: it is mandatory to specify the input arguments in the same order | |Please note that: it is mandatory to specify the input arguments in the same order | ||
|- | |- | ||
− | |||
| 06:46 | | 06:46 | ||
− | |||
|in which they have been listed above, while calling the function. | |in which they have been listed above, while calling the function. | ||
|- | |- | ||
− | |||
| 06:51 | | 06:51 | ||
− | |||
|In this tutorial, we learned: | |In this tutorial, we learned: | ||
|- | |- | ||
− | |||
| 06:53 | | 06:53 | ||
− | |||
|What is ''' optimization?''' | |What is ''' optimization?''' | ||
|- | |- | ||
− | |||
| 06:55 | | 06:55 | ||
− | |||
|Use of '''Scilab function karmarkar''' in optimization to solve linear problems. | |Use of '''Scilab function karmarkar''' in optimization to solve linear problems. | ||
|- | |- | ||
− | |||
| 07:01 | | 07:01 | ||
|To contact the scilab team, please write to '''contact@scilab.in''' | |To contact the scilab team, please write to '''contact@scilab.in''' | ||
Line 409: | Line 313: | ||
|- | |- | ||
− | |||
| 07:10 | | 07:10 | ||
− | |||
| It summarizes the Spoken Tutorial project. | | It summarizes the Spoken Tutorial project. | ||
|- | |- | ||
− | |||
|07:14 | |07:14 | ||
− | |||
||If you do not have good bandwidth, you can download and watch it. | ||If you do not have good bandwidth, you can download and watch it. | ||
|- | |- | ||
− | |||
|07:18 | |07:18 | ||
− | |||
||The spoken tutorial project Team: | ||The spoken tutorial project Team: | ||
|- | |- | ||
− | |||
|07:20 | |07:20 | ||
− | |||
||Conducts workshops using spoken tutorials. | ||Conducts workshops using spoken tutorials. | ||
|- | |- | ||
− | |||
|07:23 | |07:23 | ||
− | |||
||Gives certificates to those who pass an online test. | ||Gives certificates to those who pass an online test. | ||
|- | |- | ||
− | |||
|07:27 | |07:27 | ||
− | |||
||For more details, please write to contact@spoken-tutorial.org. | ||For more details, please write to contact@spoken-tutorial.org. | ||
|- | |- | ||
− | |||
|07:34 | |07:34 | ||
− | |||
|Spoken Tutorial Project is a part of the Talk to a Teacher project. | |Spoken Tutorial Project is a part of the Talk to a Teacher project. | ||
|- | |- | ||
− | |||
| 07:37 | | 07:37 | ||
− | |||
| It is supported by the National Mission on Eduction through ICT, MHRD, Government of India. | | It is supported by the National Mission on Eduction through ICT, MHRD, Government of India. | ||
|- | |- | ||
− | |||
| 07:44 | | 07:44 | ||
− | |||
|More information on this mission is available at spoken-tutorial.org/NMEICT-Intro. | |More information on this mission is available at spoken-tutorial.org/NMEICT-Intro. | ||
|- | |- | ||
− | |||
| 07:53 | | 07:53 | ||
− | |||
|This is Anuradha Amrutkar from IIT Bombay, signing off. | |This is Anuradha Amrutkar from IIT Bombay, signing off. | ||
|- | |- | ||
− | |||
|07:57 | |07:57 | ||
− | |||
| Thank you for joining. Good Bye. | | Thank you for joining. Good Bye. |
Latest revision as of 11:07, 10 March 2017
Time | Narration |
00:01 | Dear Friends, Welcome to the spoken tutorial on Optimization of Linear Functions with Linear Constraints Using Scilab. |
00:10 | In this tutorial, We will learn: |
00:12 | what is meant by Optimization? |
00:15 | and how to use Scilab function karmarkar, for optimization. |
00:20 | Optimization means |
00:22 | minimize or maximize a given objective function |
00:26 | which is also called as Cost function sometimes, |
00:30 | by varying the decision variables. |
00:33 | The decision variables are varied subject to the predefined constraints. |
00:38 | These constraints are also in the form of some functions of the variables. |
00:44 | Optimization is extensively used in majority of the engineering as well as non-engineering fields like: |
00:52 | Economics |
00:54 | Control Theory and |
00:56 | Operations & Research. |
00:58 | The Scilab function karmarkar is used for |
01:01 | optimizing the linear objective function, |
01:05 | subject to linear constraints |
01:07 | on the decision variables. |
01:10 | We will solve the following example using karmarkar function: |
01:14 | Minimize minus three 'x' one minus 'x' two minus three 'x' three |
01:19 | for: two 'x' one plus 'x' two plus 'x' three less than or equal to two. |
01:26 | 'x' one plus two 'x' two plus three 'x' three less than or equal to five. |
01:32 | two 'x' one plus two 'x' two plus 'x' three less than or equal to six. |
01:36 | where 'x' one 'x' two 'x' three are all greater than or equal to zero |
01:42 | Note that all the functions, objective functions as well as constraints, are linear. |
01:49 | Before we solve the given problem, go to scilab console and type: |
01:54 | help karmarkar |
01:57 | and press Enter. |
01:59 | You can see the calling sequence of the argument. |
02:03 | The argument explanation, description and some examples in the Help Browser. |
02:12 | Close the Help Browser . |
02:14 | We will summarize the input and output arguments here. |
02:19 | Output arguments are 'x' opt, 'f' opt, exitflag, iter, 'y' opt . |
02:25 | 'x' opt: is the optimum solution . |
02:28 | 'f' opt: is the objective function value at optimum solution |
02:33 | 'exitflag' : is the status of execution, it helps in identifying if the algorithm is converging or not. |
02:41 | 'iter' : is the number of iterations required to reach 'x' opt. |
02:46 | 'y' opt : is the structure containing the dual solution. |
02:49 | This gives the Lagrange multipliers. |
02:53 | Input arguments are 'Aeq' 'beq' 'c' 'x zero' 'rtolf 'gam' 'maxiter' 'outfun' 'A' 'b' 'lb' and 'ub' |
03:09 | 'Aeq' : is the Matrix in the linear equality constraints. |
03:12 | 'beq' :is the right hand side of the linear equality constraint. |
03:17 | 'c' : is the Linear objective function coefficients of 'x'. |
03:21 | 'x' zero : is the Initial guess . |
03:25 | rtolf : is Relative tolerance on 'f' of 'x' is equals to 'c' transpose multiplied by 'x'. |
03:34 | 'gam' : is the Scaling factor. |
03:36 | 'maxiter' : is the maximum number of iterations after which the output is returned. |
03:43 | 'outfun' : is the additional user-defined output function. |
03:47 | 'A' : is the Matrix of linear inequality constraints |
03:51 | 'b' : is the right hand side of the linear inequality constraints. |
03:55 | 'lb' : is the lowerbound of 'x'. |
03:58 | 'ub' are the upper bound of 'x'. |
04:02 | Now, we can solve the given example in Scilab using karmarkar function. |
04:07 | Go to the scilab console and type: |
04:11 | 'A' is equals to open square bracket, two <space> one <space> one <semicolon> one <space> two <space> three <semicolon> two <space> two <space> one, close the square bracket |
04:26 | and press Enter. |
04:28 | similarly type: small 'b' equals to open square bracket, two <semicolon> five <semicolon> six, close the square bracket. |
04:38 | and press Enter. |
04:41 | Type: 'c' equals to open square bracket, minus three <semicolon> minus one <semicolon> minus three, close the square bracket. |
04:53 | and press Enter. |
04:55 | Type: 'lb' equals to open square bracket, zero <semicolon> zero <semicolon> zero, close the square bracket. |
05:05 | and press Enter. |
05:07 | Now clear the console using clc command. |
05:12 | Type: open square bracket, 'x' opt <comma> 'f' opt <comma> 'exitflag' <comma> iter, close the square bracket equals to karmarkar open parenthesis, open square bracket, close the square bracket <comma> open square bracket, close the square bracket <comma> 'c' <comma> open square bracket, close the square bracket <comma> open square bracket, close the square bracket <comma> open square bracket, close the square bracket <comma> open square bracket, close the square bracket <comma> open square bracket, close the square bracket <comma> capital 'A' <comma> 'small b' <comma> 'lb', close the round bracket. |
06:09 | and Press Enter. |
06:11 | Press Enter to continue the display. |
06:14 | This will give the output as shown on the screen |
06:18 | where xopt is the optimum solution to the problem, |
06:23 | fopt is the value of the objective function, calculated at optimum solution x is equal to xopt |
06:32 | and number of iteration required to reach the optimum solution xopt is 70. |
06:39 | Please note that: it is mandatory to specify the input arguments in the same order |
06:46 | in which they have been listed above, while calling the function. |
06:51 | In this tutorial, we learned: |
06:53 | What is optimization? |
06:55 | Use of Scilab function karmarkar in optimization to solve linear problems. |
07:01 | To contact the scilab team, please write to contact@scilab.in |
07:08 | Watch the video available at the following link. |
07:10 | It summarizes the Spoken Tutorial project. |
07:14 | If you do not have good bandwidth, you can download and watch it. |
07:18 | The spoken tutorial project Team: |
07:20 | Conducts workshops using spoken tutorials. |
07:23 | Gives certificates to those who pass an online test. |
07:27 | For more details, please write to contact@spoken-tutorial.org. |
07:34 | Spoken Tutorial Project is a part of the Talk to a Teacher project. |
07:37 | It is supported by the National Mission on Eduction through ICT, MHRD, Government of India. |
07:44 | More information on this mission is available at spoken-tutorial.org/NMEICT-Intro. |
07:53 | This is Anuradha Amrutkar from IIT Bombay, signing off. |
07:57 | Thank you for joining. Good Bye. |