Difference between revisions of "Scilab/C4/Optimization-Using-Karmarkar-Functions/English-timed"

From Script | Spoken-Tutorial
Jump to: navigation, search
Line 12: Line 12:
 
| 00:02
 
| 00:02
 
| Welcome to the spoken tutorial on '''Optimization of Linear Functions with Linear Constraints Using Scilab'''
 
| Welcome to the spoken tutorial on '''Optimization of Linear Functions with Linear Constraints Using Scilab'''
 
  
 
|-
 
|-
Line 20: Line 19:
 
|-
 
|-
 
|00:12
 
|00:12
|What is meant by '''Optimization?'''  
+
|what is meant by '''Optimization?'''  
 
+
  
 
|-
 
|-
 
|00:15
 
|00:15
|And How to use Scilab function karmarkar for optimization.  
+
|and How to use Scilab function '''karmarkar''' for optimization.  
 
+
  
 
|-
 
|-
Line 34: Line 31:
 
|-
 
|-
 
|00:22
 
|00:22
|Minimize or maximize a given '''objective function.'''  
+
|minimize or maximize a given '''objective function'''  
 
+
  
 
|-
 
|-
 
| 00:26
 
| 00:26
|Which is also called as '''Cost function''' sometimes.
+
|which is also called as '''Cost function''' sometimes,
  
 
|-
 
|-
 
| 00:30
 
| 00:30
| By varying the decision variables
+
| by varying the decision variables.
  
 
|-
 
|-
 
|00:33
 
|00:33
|The decision variables are varied subject to the pre-defined constraints.  
+
|The decision variables are varied subject to the predefined constraints.  
  
 
|-
 
|-
Line 55: Line 51:
 
|-
 
|-
 
| 00:44
 
| 00:44
| '''Optimization''' is extensively used in majority of the engineering as well as non-engineering fields like  
+
| '''Optimization''' is extensively used in majority of the engineering as well as non-engineering fields like:
  
 
|-
 
|-
Line 73: Line 69:
 
|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,
 
+
  
 
|-
 
|-
Line 86: Line 81:
  
 
|subject to linear constraints  
 
|subject to linear constraints  
 
  
 
|-
 
|-
  
 
| 01:07
 
| 01:07
||on the decision variables  
+
||on the decision variables.
  
 
|-
 
|-
Line 97: Line 91:
 
|01:10
 
|01:10
  
|| We will solve the following example using ''' karmarkar'''  function:  
+
|| We will solve the following example using '''Karmarkar'''  function:  
 
+
 
+
  
 
|-
 
|-
Line 106: Line 98:
  
 
| 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 117: Line 108:
  
 
|''' '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.'''  
 
  
 
|-
 
|-
Line 124: Line 114:
  
 
||'''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.'''  
 
 
  
 
|-
 
|-
 
|01:36
 
|01:36
 
|where ''' 'x' one 'x' two 'x' three''' are all '''greater than''' or '''equal to zero'''
 
|where ''' 'x' one 'x' two 'x' three''' are all '''greater than''' or '''equal to zero'''
 
  
 
|-
 
|-
  
 
| 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.
  
 
|-
 
|-
Line 141: Line 128:
 
|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:
 
|-
 
|-
  
Line 159: Line 146:
  
 
||You can see the calling sequence of the argument.  
 
||You can see the calling sequence of the argument.  
 
  
 
|-
 
|-
 
| 02:03
 
| 02:03
|The argument explaination, description and some examples in the '''help browser.'''  
+
|The argument explanation, description and some examples in the '''help browser.'''  
 
+
  
 
|-
 
|-
 
|02:12
 
|02:12
| Close the '''help browser '''
+
| Close the '''Help Browser '''.
 
+
  
 
|-
 
|-
 
|02:14
 
|02:14
| We will summarize the input and output arguments here  
+
| We will summarize the input and output arguments here.
  
 
|-
 
|-
 
| 02:19
 
| 02:19
 
|Out put arguments are ''' 'x' opt, 'f' opt, exitflag, iter, 'y' opt '''
 
|Out put arguments are ''' 'x' opt, 'f' opt, exitflag, iter, 'y' opt '''
 
  
 
|-
 
|-
 
| 02:25
 
| 02:25
 
|''' 'x' opt:''' is the optimum solution .  
 
|''' 'x' opt:''' is the optimum solution .  
 
 
  
 
|-
 
|-
 
| 02:28
 
| 02:28
|''''f' opt:'''  is the objective function value at '''optimum solution'''
+
|''' 'f' opt:'''  is the objective function value at '''optimum solution'''
 
+
  
 
|-
 
|-
Line 201: Line 181:
 
|-
 
|-
 
|02:46
 
|02:46
|''' 'y' opt''' : is the structure containing the dual solution  
+
|''' 'y' opt''' : is the structure containing the dual solution.
 
+
  
 
|-
 
|-
Line 209: Line 188:
  
 
|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' '''
'
+
 
+
  
 
|-
 
|-
Line 225: Line 199:
  
 
|| ''' 'Aeq' ''' : is the Matrix in the linear equality constraints.  
 
|| ''' 'Aeq' ''' : is the Matrix in the linear equality constraints.  
 
  
 
|-
 
|-
Line 231: Line 204:
 
| 03:12
 
| 03:12
 
| ''' 'beq' '''  :is the right hand side of the linear '''equality''' constraints.  
 
| ''' 'beq' '''  :is the right hand side of the linear '''equality''' constraints.  
 
 
  
 
|-
 
|-
Line 239: Line 210:
  
 
|''' 'c' ''' : is the '''Linear objective function''' co-efficients of  ''' 'x'. '''
 
|''' 'c' ''' : is the '''Linear objective function''' co-efficients of  ''' 'x'. '''
 
  
 
|-
 
|-
Line 252: Line 222:
  
 
||''' 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'. '''
 
  
 
|-
 
|-
Line 265: Line 234:
  
 
|''' '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.  
 
 
 
  
 
|-
 
|-
Line 274: Line 240:
  
 
|''' 'outfun' ''' : is the additional user-defined output functions .
 
|''' 'outfun' ''' : is the additional user-defined output functions .
 
  
 
|-
 
|-
Line 293: Line 258:
  
 
||''' 'lb' ''': is the ''' lowerbound''' of ''' 'x'.'''
 
||''' 'lb' ''': is the ''' lowerbound''' of ''' 'x'.'''
 
  
 
|-
 
|-
Line 311: Line 275:
 
| 04:07
 
| 04:07
  
|Go to the ''' scilab console and type'''  
+
|Go to the ''' scilab console''' and type:
 
+
 
+
  
 
|-
 
|-
Line 320: Line 282:
  
 
|'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.  
 
  
 
|-
 
|-
Line 326: Line 287:
 
|04:26
 
|04:26
  
|And press Enter  
+
|And press Enter.
 
+
 
+
  
 
|-
 
|-
Line 335: Line 294:
  
 
|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.  
 
  
 
|-
 
|-
Line 341: Line 299:
 
| 04:38
 
| 04:38
  
| And press '''Enter'''
+
| And press '''Enter'''.
  
 
|-
 
|-
Line 353: Line 311:
 
| 04:53
 
| 04:53
  
|And press ''' Enter'''
+
|And press ''' Enter'''.
 
+
  
 
|-
 
|-
Line 362: Line 319:
 
|-
 
|-
 
| 05:05
 
| 05:05
|And press '''Enter'''
+
|And press '''Enter'''.
  
 
|-
 
|-
Line 368: Line 325:
 
| 05:07
 
| 05:07
  
|Now clear the '''Scilab console using  clc command.'''
+
|Now clear the '''Scilab console''' using  '''clc''' command.
 
+
  
 
|-
 
|-
Line 376: Line 332:
  
 
| 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. '''
 
  
 
|-
 
|-
Line 382: Line 337:
 
| 06:09
 
| 06:09
  
| And Press '''enter'''
+
| And Press '''Enter'''.
  
 
|-
 
|-
Line 388: Line 343:
 
| 06:11
 
| 06:11
  
| Press Enter to continue the Display
+
| Press Enter to continue the Display.
 
+
 
+
  
 
|-
 
|-
Line 396: Line 349:
 
| 06:14
 
| 06:14
  
| This will give the output as shown on the screen.
+
| This will give the output as shown on the screen  
  
 
|-
 
|-
Line 402: Line 355:
 
| 06:18
 
| 06:18
  
| Where '''xopt'''  is the ''' optimal solution''' to the problem  
+
| where '''xopt'''  is the ''' optimal solution''' to the problem,
  
 
|-
 
|-
Line 414: Line 367:
 
| 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'''.
  
 
|-
 
|-
Line 420: Line 373:
 
| 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  
  
 
|-
 
|-
Line 426: Line 379:
 
| 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.
  
 
|-
 
|-
Line 432: Line 385:
 
| 06:51
 
| 06:51
  
|In this tutorial, we learned  
+
|In this tutorial, we learned:
  
 
|-
 
|-
Line 444: Line 397:
 
| 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'''
 
+
  
 
|-
 
|-
 
|07:08
 
|07:08
| Watch the video available at the following link
+
| Watch the video available at the following link.
  
 
|-
 
|-
Line 461: Line 412:
 
| 07:10
 
| 07:10
  
| It summarises the Spoken Tutorial project  
+
| It summarises the Spoken Tutorial project.
 
+
 
+
  
 
|-
 
|-
Line 475: Line 424:
 
|07:18
 
|07:18
  
||The spoken tutorial project Team
+
||The spoken tutorial project Team:
  
 
|-
 
|-
Line 482: Line 431:
  
 
||Conducts workshops using spoken tutorials  
 
||Conducts workshops using spoken tutorials  
 
  
 
|-
 
|-
Line 488: Line 436:
 
|07:23
 
|07:23
  
||Gives certificates to those who pass an online test  
+
||Gives certificates to those who pass an online test.
 
+
  
 
|-
 
|-
Line 495: Line 442:
 
|07:27
 
|07:27
  
||For more details, please write to contact@spoken-tutorial.org  
+
||For more details, please write to contact@spoken-tutorial.org.
 
+
  
 
|-
 
|-
Line 502: Line 448:
 
|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.
 
+
 
+
  
 
|-
 
|-
Line 515: Line 459:
 
| 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.
  
 
|-
 
|-
Line 521: Line 465:
 
| 07:53
 
| 07:53
  
|This is Anuradha Amrutkar from IIT Bombay signing off.
+
|This is Anuradha Amrutkar from IIT Bombay, signing off.
  
 
|-
 
|-
Line 527: Line 471:
 
|07:57
 
|07:57
  
| Thank you for joining Good Bye.
+
| Thank you for joining. Good Bye.

Revision as of 15:29, 2 March 2015

Time Narration
00:01 Dear Friends,
00:02 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 Out put 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 constraints.
03:17 'c'  : is the Linear objective function co-efficients 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 functions .
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 bounds of 'x'.
04:02 Now, we can now 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 Scilab 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 optimal 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 summarises 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.

Contributors and Content Editors

Gaurav, PoojaMoolya, Sandhya.np14