Difference between revisions of "Scilab/C4/Solving-Non-linear-Equations/English-timed"

From Script | Spoken-Tutorial
Jump to: navigation, search
Line 6: Line 6:
 
|-
 
|-
 
| 00:01
 
| 00:01
|Dear Friends, Welcome to the spoken tutorial on '''Solving Nonlinear Equations using Numerical Methods'''.
+
|Dear Friends,  
  
 
|-
 
|-
| 00:10
+
| 00:02
| At the end of this tutorial, you will learn how to   
+
|Welcome to the spoken tutorial on  ''' “Solving Nonlinear Equations using Numerical Methods” '''
 +
 
 +
 
 +
|-
 +
| 00:10.
 +
| At the end of this tutorial, you will learn how to:  
  
 
|-
 
|-
 
|00:13
 
|00:13
|solve '''nonlinear equations''' using numerical methods.
+
|Solve '''nonlinear equations''' using numerical methods
  
 
|-
 
|-
 
|00:18
 
|00:18
|The methods we will be studying are:
+
|The methods we will be studying are  
 +
 
  
 
|-
 
|-
 
| 00:20
 
| 00:20
|'''Bisection method''' and
+
|'''Bisection method and '''
  
 
|-
 
|-
 
|00:22
 
|00:22
|'''Secant method'''.
+
|'''Secant method'''  
 +
 
  
 
|-
 
|-
Line 42: Line 49:
 
|-
 
|-
 
|00:36
 
|00:36
|'''Scilab 5.3.3''' version.
+
|'''Scilab 5.3.3''' version  
  
 
|-
 
|-
 
|00:40
 
|00:40
| Before practicing this tutorial, a learner should have  
+
| Before practising this tutorial, a learner should have  
  
 
|-
 
|-
Line 54: Line 61:
 
|-
 
|-
 
| 00:46
 
| 00:46
| '''nonlinear equations'''.
+
| '''nonlinear equations'''
  
 
|-
 
|-
Line 66: Line 73:
 
|-
 
|-
 
|01:04
 
|01:04
|This solution '''x''' is called '''root of equation''' or '''zero of function f.'''  
+
|This solution '''x''' is called '''root of equation ''' or ''' zero of function f.'''  
  
 
|-
 
|-
 
|01:11
 
|01:11
| This process is called '''root finding''' or '''zero finding.'''  
+
| This process is called ''' root finding''' or '''zero finding.'''  
 +
 
  
 
|-
 
|-
 
|01:16
 
|01:16
 
|We begin by studying '''Bisection Method. '''
 
|We begin by studying '''Bisection Method. '''
 +
  
 
|-
 
|-
Line 80: Line 89:
 
|01:20
 
|01:20
  
|In '''bisection method''', we calculate the '''initial bracket''' of the '''root.'''  
+
|In '''bisection method''' we calculate the '''initial bracket''' of the '''root.'''  
  
 
|-
 
|-
Line 102: Line 111:
  
 
| 01:41
 
| 01:41
|| Given: '''function f equal to two sin x minus e to the power of x divided by four minus one in the interval minus five and minus three'''
+
|| Given
 +
 
 +
|-
 +
 
 +
|01:42
 +
 
 +
|| '''function f equal to two sin x minus e to the power of x divided by four minus one in the interval minus five and minus three'''
  
 
|-
 
|-
Line 108: Line 123:
 
|01:54
 
|01:54
  
| '''Open Bisection dot sci''' on '''Scilab editor. '''
+
| '''Open Bisection dot sci on Scilab editor. '''
 +
 
  
 
|-
 
|-
 
|02:00
 
|02:00
 
| Let us look at the code for '''Bisection method.'''  
 
| Let us look at the code for '''Bisection method.'''  
 +
 
   
 
   
 
|-
 
|-
Line 118: Line 135:
 
|02:03
 
|02:03
  
|We define the function '''Bisection''' with input arguments '''a b f''' and '''tol.'''  
+
|We define the function '''Bisection''' with input arguments '''a b f''' and '''Tol.'''  
  
 
|-
 
|-
Line 124: Line 141:
 
|02:10
 
|02:10
  
|| Here '''a''' is the lower limit of the '''interval''',
+
|| Here '''a''' is the lower limit of the '''interval'''  
  
 
|-
 
|-
 
|02:14
 
|02:14
|'''b''' is the upper limit of the '''interval''',
+
|'''b''' is the upper limit of the '''interval'''  
 +
 
  
 
|-
 
|-
 
| 02:16
 
| 02:16
||'''f''' is the function to be solved,
+
||'''f''' is the function to be solved  
 +
 
  
 
|-
 
|-
  
 
| 02:19
 
| 02:19
||and '''tol''' is the '''tolerance level'''.
+
||and '''Tol''' is the '''tolerance level'''  
  
 
|-
 
|-
Line 149: Line 168:
 
|02:28
 
|02:28
  
| We find the '''midpoint of the interval''' and iterate till the value calculated is within the specified '''tolerance range.'''  
+
| We find the midpoint of the interval and iterate till the value calculated is within the specified '''tolerance range.'''  
 
   
 
   
 
|-
 
|-
Line 182: Line 201:
 
| 02:54
 
| 02:54
 
|Let '''b''' be equal to minus three.  
 
|Let '''b''' be equal to minus three.  
 +
 +
  
 
|-
 
|-
 
| 02:56
 
| 02:56
 
| Press '''Enter. '''
 
| Press '''Enter. '''
 +
  
 
|-
 
|-
 
| 02:58
 
| 02:58
|Define the function using '''deff''' function.
+
|Define the function using '''deff function.'''  
  
 
|-
 
|-
 
|03:01
 
|03:01
| We type: '''deff open parenthesis open single quote open square bracket y close square bracket equal to f of x close single quote comma open single quote y equal to two asterisk sin of x minus open parenthesis open parenthesis percentage e to the power of x close parenthesis divided by four close parenthesis minus one close single quote close parenthesis'''
+
| We type  
 +
 
 +
|-
 +
| 03:02
 +
| '''deff open paranthesis open single quote open square bracket y close square bracket equal to f of x close single quote comma open single quote y equal to two asterisk sin of x minus open paranthesis open paranthesis percentage e to the power of x close paranthesis divided by four close paranthesis minus one close single quote close paranthesis'''
  
 
|-
 
|-
Line 199: Line 225:
 
| 03:41
 
| 03:41
  
|To know more about '''deff''' function, type '''help deff'''
+
|To know more about '''deff function''' type '''help deff'''
 +
 
 +
 
  
 
|-
 
|-
Line 211: Line 239:
  
 
||Let '''tol''' be equal to 10 to the power of minus five.  
 
||Let '''tol''' be equal to 10 to the power of minus five.  
 +
 +
  
 
|-
 
|-
Line 217: Line 247:
  
 
||Press '''Enter.'''  
 
||Press '''Enter.'''  
 +
  
 
|-
 
|-
Line 223: Line 254:
  
 
| To solve the problem, type  
 
| To solve the problem, type  
 +
  
 
|-
 
|-
Line 228: Line 260:
 
| 03:58
 
| 03:58
  
| '''Bisection open parenthesis a comma b comma f comma tol close parenthesis'''  
+
| '''Bisection open paranthesis a comma b comma f comma tol close paranthesis'''  
 +
 
  
 
|-
 
|-
 
|04:07
 
|04:07
 
| Press '''Enter.'''  
 
| Press '''Enter.'''  
 +
  
 
|-
 
|-
Line 239: Line 273:
  
 
| The root of the function is shown on the console.  
 
| The root of the function is shown on the console.  
 +
 +
  
 
|-
 
|-
Line 245: Line 281:
  
 
||Let us study '''Secant's method.'''  
 
||Let us study '''Secant's method.'''  
 +
  
 
|-
 
|-
Line 250: Line 287:
 
|04:17
 
|04:17
  
| In '''Secant's method,''' the '''derivative''' is approximated by finite difference using two successive iteration values.
+
| In '''Secant's method,''' the derivative is approximated by finite difference using two successive iteration values.
 +
 
  
 
|-
 
|-
Line 256: Line 294:
 
| 04:27
 
| 04:27
  
| Let us solve this example using '''Secant method.'''
+
| Let us solve this example using '''Secant method. '''
 +
 
 +
 
  
 
|-
 
|-
Line 263: Line 303:
  
 
|The function is '''f equal to x square minus six. '''
 
|The function is '''f equal to x square minus six. '''
 +
 +
  
 
|-
 
|-
Line 269: Line 311:
  
 
| The two '''starting guesses''' are , '''p zero''' equal to two and '''p one''' equal to three.  
 
| The two '''starting guesses''' are , '''p zero''' equal to two and '''p one''' equal to three.  
 +
  
 
|-
 
|-
Line 274: Line 317:
 
| 04:44
 
| 04:44
  
| Before we solve the problem, let us look at the code for '''Secant method.'''
+
| Before we solve the problem, let us look at the code for '''Secant method. '''
 +
 
 +
 
  
 
|-
 
|-
Line 281: Line 326:
  
 
||Open '''Secant dot sci''' on '''Scilab editor.'''   
 
||Open '''Secant dot sci''' on '''Scilab editor.'''   
 +
 +
  
 
|-
 
|-
Line 286: Line 333:
 
| 04:54
 
| 04:54
  
||We define the function '''Secant''' with input arguments '''a, b''' and '''f.'''  
+
||We define the function '''secant''' with input arguments '''a, b and f.'''  
  
 
|-
 
|-
Line 292: Line 339:
 
| 05:01
 
| 05:01
  
||'''a''' is first starting guess for the root,
+
||'''a''' is first starting guess for the root  
  
 
|-
 
|-
Line 299: Line 346:
  
 
|'''b''' is the second starting guess and  
 
|'''b''' is the second starting guess and  
 +
  
 
|-
 
|-
Line 305: Line 353:
  
 
|'''f''' is the function to be solved.  
 
|'''f''' is the function to be solved.  
 +
  
 
|-
 
|-
Line 311: Line 360:
  
 
|We find the difference between the value at the current point and the previous point.  
 
|We find the difference between the value at the current point and the previous point.  
 +
 +
  
 
|-
 
|-
Line 317: Line 368:
  
 
| We apply '''Secant's method ''' and find the value of the root.  
 
| We apply '''Secant's method ''' and find the value of the root.  
 +
 +
  
 
|-
 
|-
Line 323: Line 376:
  
 
| Finally we end the function.  
 
| Finally we end the function.  
 +
 +
  
 
|-
 
|-
Line 329: Line 384:
  
 
|| Let me save and execute the code.  
 
|| Let me save and execute the code.  
 +
  
 
|-
 
|-
Line 339: Line 395:
 
| 05:30
 
| 05:30
  
|Type '''clc'''.
+
|Type '''clc. '''
  
 
|-
 
|-
Line 345: Line 401:
 
| 05:32
 
| 05:32
  
| Press '''Enter'''.
+
| Press '''Enter'''
 +
 
 +
 
 +
 
  
 
|-
 
|-
Line 357: Line 416:
 
| 05:38
 
| 05:38
  
| Type  '''a''' equal to 2.
+
| Type  '''a''' equal to 2  
 +
 
  
 
|-
 
|-
Line 364: Line 424:
  
 
| Press '''Enter. '''
 
| Press '''Enter. '''
 +
 +
  
 
|-
 
|-
Line 369: Line 431:
 
| 05:42
 
| 05:42
  
| Then type  '''b''' equal to 3.
+
| Then type  '''b''' equal to 3  
 +
 
 +
 
  
 
|-
 
|-
Line 377: Line 441:
 
|-
 
|-
 
| 05:46
 
| 05:46
|We define the function using '''deff''' function.
+
|We define the function using '''deff function. '''
  
 
|-
 
|-
 +
 
| 05:49
 
| 05:49
| Type '''deff open parenthesis open single quote open square bracket y close square bracket equal to g of x close single quote comma open single quote y equal to open parenthesis x to the power of two close parenthesis minus six close single quote close parenthesis '''
+
 
 +
| Type '''deff open paranthesis open single quote open square bracket y close square bracket equal to g of x close single quote comma open single quote y equal to open paranthesis x to the power of two close paranthesis minus six close single quote close paranthesis '''
 +
 
  
 
|-
 
|-
 +
 
| 06:15
 
| 06:15
| Press '''Enter'''.
+
 
 +
| Press '''Enter'''
  
 
|-
 
|-
 +
 
| 06:18
 
| 06:18
 +
 
| We call the function by typing  
 
| We call the function by typing  
  
 
|-
 
|-
|06:20
+
 
| '''Secant open parenthesis a comma b comma g close parenthesis.'''
+
| 06:20
 +
 
 +
| '''Secant open paranthesis a comma b comma g close paranthesis.'''
  
 
|-
 
|-
 +
 
| 06:27
 
| 06:27
| Press '''Enter'''.
+
 
 +
| Press '''Enter'''
 +
 
  
 
|-
 
|-
 +
 
| 06:30
 
| 06:30
| The value of the root is shown on the '''console'''.
+
 
 +
| The value of the root is shown on the '''console'''
  
 
|-
 
|-
 +
 
| 06:35
 
| 06:35
 +
 
| Let us summarize this tutorial.  
 
| Let us summarize this tutorial.  
  
 
|-
 
|-
 +
 
| 06:38
 
| 06:38
 +
 
| In this tutorial we have learnt to:  
 
| In this tutorial we have learnt to:  
  
 
|-
 
|-
 +
 
| 06:41
 
| 06:41
 +
 
|Develop '''Scilab''' code for different solving methods  
 
|Develop '''Scilab''' code for different solving methods  
  
 
|-
 
|-
 +
 
| 06:45
 
| 06:45
|Find the roots of '''nonlinear equation '''.
+
 
 +
|Find the roots of '''nonlinear equation '''
  
 
|-
 
|-
 +
 
| 06:48
 
| 06:48
 +
 
|Solve this problem on your own using the two methods we learnt today.  
 
|Solve this problem on your own using the two methods we learnt today.  
 +
 +
  
 
|-
 
|-
 
|06:55
 
|06:55
| Watch the video available at the link shown below.
+
 
 +
| Watch the video available at the link shown below  
  
 
|-
 
|-
 +
 
| 06:58
 
| 06:58
| It summarizes the Spoken Tutorial project.
+
 
 +
| It summarises the Spoken Tutorial project  
 +
 
 +
 
  
 
|-
 
|-
 +
 
|07:01
 
|07:01
||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:05
 
|07:05
||The spoken tutorial project Team:
+
 
 +
||The spoken tutorial project Team
  
 
|-
 
|-
 +
 
|07:07
 
|07:07
||Conducts workshops using spoken tutorials.
+
 
 +
||Conducts workshops using spoken tutorials  
 +
 
  
 
|-
 
|-
 +
 
|07:10
 
|07:10
||Gives certificates to those who pass an online test.
+
 
 +
||Gives certificates to those who pass an online test  
 +
 
  
 
|-
 
|-
 +
 
|07:14
 
|07:14
||For more details, please write to conatct@spoken-tutorial.org.
+
 
 +
||For more details, please write to conatct@spoken-tutorial.org  
 +
 
  
 
|-
 
|-
 +
 
|07:21
 
|07:21
|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:24
 
| 07:24
 +
 
| 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:32
 
| 07:32
|More information on this mission is available at  http://spoken-tutorial.org/NMEICT-Intro.
+
 
 +
|More information on this mission is available at  http://spoken-tutorial.org/NMEICT-Intro
  
 
|-
 
|-
 +
 
| 07:39
 
| 07:39
|This is Ashwini Patil, signing off.
+
 
 +
|This is Ashwini Patil signing off.
  
 
|-
 
|-
 +
 
|07:41
 
|07:41
 +
 
| Thank you for joining.
 
| Thank you for joining.

Revision as of 10:00, 26 December 2017

Time Narration
00:01 Dear Friends,
00:02 Welcome to the spoken tutorial on “Solving Nonlinear Equations using Numerical Methods”


00:10. At the end of this tutorial, you will learn how to:
00:13 Solve nonlinear equations using numerical methods
00:18 The methods we will be studying are


00:20 Bisection method and
00:22 Secant method


00:23 We will also develop Scilab code to solve nonlinear equations.
00:30 To record this tutorial, I am using
00:32 Ubuntu 12.04 as the operating system and
00:36 Scilab 5.3.3 version
00:40 Before practising this tutorial, a learner should have
00:43 basic knowledge of Scilab and
00:46 nonlinear equations
00:48 For Scilab, please refer to the Scilab tutorials available on the Spoken Tutorial website.
00:55 For a given function f, we have to find the value of x for which f of x is equal to zero.
01:04 This solution x is called root of equation or zero of function f.
01:11 This process is called root finding or zero finding.


01:16 We begin by studying Bisection Method.


01:20 In bisection method we calculate the initial bracket of the root.
01:25 Then we iterate through the bracket and halve its length.
01:31 We repeat this process until we find the solution of the equation.
01:36 Let us solve this function using Bisection method.
01:41 Given
01:42 function f equal to two sin x minus e to the power of x divided by four minus one in the interval minus five and minus three
01:54 Open Bisection dot sci on Scilab editor.


02:00 Let us look at the code for Bisection method.


02:03 We define the function Bisection with input arguments a b f and Tol.
02:10 Here a is the lower limit of the interval
02:14 b is the upper limit of the interval


02:16 f is the function to be solved


02:19 and Tol is the tolerance level
02:22 We specify the maximum number of iterations to be equal to hundred.
02:28 We find the midpoint of the interval and iterate till the value calculated is within the specified tolerance range.
02:37 Let us solve the problem using this code.
02:40 Save and execute the file.
02:43 Switch to Scilab console
02:47 Let us define the interval.
02:50 Let a be equal to minus five.
02:52 Press Enter.
02:54 Let b be equal to minus three.


02:56 Press Enter.


02:58 Define the function using deff function.
03:01 We type
03:02 deff open paranthesis open single quote open square bracket y close square bracket equal to f of x close single quote comma open single quote y equal to two asterisk sin of x minus open paranthesis open paranthesis percentage e to the power of x close paranthesis divided by four close paranthesis minus one close single quote close paranthesis
03:41 To know more about deff function type help deff


03:46 Press Enter.
03:48 Let tol be equal to 10 to the power of minus five.


03:53 Press Enter.


03:56 To solve the problem, type


03:58 Bisection open paranthesis a comma b comma f comma tol close paranthesis


04:07 Press Enter.


04:09 The root of the function is shown on the console.


04:14 Let us study Secant's method.


04:17 In Secant's method, the derivative is approximated by finite difference using two successive iteration values.


04:27 Let us solve this example using Secant method.


04:30 The function is f equal to x square minus six.


04:36 The two starting guesses are , p zero equal to two and p one equal to three.


04:44 Before we solve the problem, let us look at the code for Secant method.


04:50 Open Secant dot sci on Scilab editor.


04:54 We define the function secant with input arguments a, b and f.
05:01 a is first starting guess for the root
05:04 b is the second starting guess and


05:07 f is the function to be solved.


05:10 We find the difference between the value at the current point and the previous point.


05:15 We apply Secant's method and find the value of the root.


05:21 Finally we end the function.


05:24 Let me save and execute the code.


05:27 Switch to Scilab console.
05:30 Type clc.
05:32 Press Enter



05:34 Let me define the initial guesses for this example.
05:38 Type a equal to 2


05:40 Press Enter.


05:42 Then type b equal to 3


05:44 Press Enter.
05:46 We define the function using deff function.
05:49 Type deff open paranthesis open single quote open square bracket y close square bracket equal to g of x close single quote comma open single quote y equal to open paranthesis x to the power of two close paranthesis minus six close single quote close paranthesis


06:15 Press Enter
06:18 We call the function by typing
06:20 Secant open paranthesis a comma b comma g close paranthesis.
06:27 Press Enter


06:30 The value of the root is shown on the console
06:35 Let us summarize this tutorial.
06:38 In this tutorial we have learnt to:
06:41 Develop Scilab code for different solving methods
06:45 Find the roots of nonlinear equation
06:48 Solve this problem on your own using the two methods we learnt today.


06:55 Watch the video available at the link shown below
06:58 It summarises the Spoken Tutorial project


07:01 If you do not have good bandwidth, you can download and watch it
07:05 The spoken tutorial project Team
07:07 Conducts workshops using spoken tutorials


07:10 Gives certificates to those who pass an online test


07:14 For more details, please write to conatct@spoken-tutorial.org


07:21 Spoken Tutorial Project is a part of the Talk to a Teacher project


07:24 It is supported by the National Mission on Eduction through ICT, MHRD, Government of India.
07:32 More information on this mission is available at http://spoken-tutorial.org/NMEICT-Intro
07:39 This is Ashwini Patil signing off.
07:41 Thank you for joining.

Contributors and Content Editors

PoojaMoolya, Pratik kamble, Sandhya.np14