Difference between revisions of "Scilab/C4/ODE-Applications/English-timed"
From Script | Spoken-Tutorial
PoojaMoolya (Talk | contribs) (Created page with '{| Border=1 || Time || Narration |- | 00.01 |Dear Friends, |- | 00.02 | Welcome to the Spoken Tutorial on '''“Solving ODEs using Scilab ode Function”''' |- | 00.09 | A…') |
|||
Line 1: | Line 1: | ||
{| Border=1 | {| Border=1 | ||
− | | | + | |'''Time''' |
− | | | + | |'''Narration''' |
|- | |- | ||
− | | 00 | + | | 00:01 |
|Dear Friends, | |Dear Friends, | ||
|- | |- | ||
− | | 00 | + | | 00:02 |
| Welcome to the Spoken Tutorial on '''“Solving ODEs using Scilab ode Function”''' | | Welcome to the Spoken Tutorial on '''“Solving ODEs using Scilab ode Function”''' | ||
|- | |- | ||
− | | 00 | + | | 00:09 |
| At the end of this tutorial, you will learn how to: | | At the end of this tutorial, you will learn how to: | ||
|- | |- | ||
− | |00 | + | |00:12 |
|'''Use Scilab ode function''' | |'''Use Scilab ode function''' | ||
|- | |- | ||
− | |00 | + | |00:15 |
|Solve typical examples of '''ODEs''' and | |Solve typical examples of '''ODEs''' and | ||
|- | |- | ||
− | | 00 | + | | 00:18 |
|Plot the solution | |Plot the solution | ||
|- | |- | ||
− | |00 | + | |00:21 |
|The typical examples we will be | |The typical examples we will be | ||
|- | |- | ||
− | | 00 | + | | 00:24 |
|Motion of '''simple pendulum''' | |Motion of '''simple pendulum''' | ||
|- | |- | ||
− | | 00 | + | | 00:26 |
|'''Van der Pol equation''' | |'''Van der Pol equation''' | ||
|- | |- | ||
− | |00 | + | |00:28 |
|and ''' Lorenz system''' | |and ''' Lorenz system''' | ||
|- | |- | ||
− | |00 | + | |00:30 |
|To record this tutorial, I am using | |To record this tutorial, I am using | ||
|- | |- | ||
− | | 00 | + | | 00:33 |
| '''Ubuntu 12.04''' as the operating system | | '''Ubuntu 12.04''' as the operating system | ||
|- | |- | ||
− | | 00 | + | | 00:36 |
|and '''Scilab 5.3.3''' version | |and '''Scilab 5.3.3''' version | ||
|- | |- | ||
− | |00 | + | |00:40 |
|To practise this tutorial, a learner should have basic knowledge of '''Scilab''' | |To practise this tutorial, a learner should have basic knowledge of '''Scilab''' | ||
Line 65: | Line 65: | ||
|- | |- | ||
− | |00 | + | |00:45 |
|and should know how to solve '''ODEs.''' | |and should know how to solve '''ODEs.''' | ||
Line 71: | Line 71: | ||
|- | |- | ||
− | |00 | + | |00:48 |
|To learn '''Scilab,''' please refer to the relevant tutorials available on the '''Spoken Tutorial''' website. | |To learn '''Scilab,''' please refer to the relevant tutorials available on the '''Spoken Tutorial''' website. | ||
|- | |- | ||
− | | 00 | + | | 00:56 |
|The '''ode function''' is an '''ordinary differential equation solver.''' | |The '''ode function''' is an '''ordinary differential equation solver.''' | ||
Line 83: | Line 83: | ||
|- | |- | ||
− | | 01 | + | | 01:01 |
||The syntax is '''y equal to ode within paranthesis y zero, t zero, t and f''' | ||The syntax is '''y equal to ode within paranthesis y zero, t zero, t and f''' | ||
Line 90: | Line 90: | ||
|- | |- | ||
− | |01 | + | |01:10 |
|| Here '''y zero''' is the initial conditon of the '''ODEs''' | || Here '''y zero''' is the initial conditon of the '''ODEs''' | ||
Line 98: | Line 98: | ||
|- | |- | ||
− | |01 | + | |01:15 |
| '''t zero''' is the '''initial time''' | | '''t zero''' is the '''initial time''' | ||
|- | |- | ||
− | |01 | + | |01:17 |
|'''t''' is the '''time range''' | |'''t''' is the '''time range''' | ||
Line 109: | Line 109: | ||
|- | |- | ||
− | |01 | + | |01:19 |
|and '''f''' is the '''function''' | |and '''f''' is the '''function''' | ||
Line 115: | Line 115: | ||
|- | |- | ||
− | |01 | + | |01:22 |
||Consider the motion of '''simple pendulum.''' | ||Consider the motion of '''simple pendulum.''' | ||
Line 121: | Line 121: | ||
|- | |- | ||
− | |01 | + | |01:25 |
|Let '''theta t''' be the angle made by the '''pendulum''' with the '''vertical''' at time '''t.''' | |Let '''theta t''' be the angle made by the '''pendulum''' with the '''vertical''' at time '''t.''' | ||
Line 127: | Line 127: | ||
|- | |- | ||
− | | 01 | + | | 01:33 |
|We are given the initial conditions | |We are given the initial conditions | ||
|- | |- | ||
− | |01 | + | |01:36 |
|'''theta zero''' is equal to '''pi by four''' and | |'''theta zero''' is equal to '''pi by four''' and | ||
Line 138: | Line 138: | ||
|- | |- | ||
− | |01 | + | |01:39 |
| '''theta dash of zero''' is equal to '''zero.''' | | '''theta dash of zero''' is equal to '''zero.''' | ||
Line 144: | Line 144: | ||
|- | |- | ||
− | |01 | + | |01:44 |
| Then the position of the '''pendulum''' is given by | | Then the position of the '''pendulum''' is given by | ||
|- | |- | ||
− | | 01 | + | | 01:47 |
|| '''theta double dash t minus g by l into sin of theta t equal to zero.''' | || '''theta double dash t minus g by l into sin of theta t equal to zero.''' | ||
Line 155: | Line 155: | ||
|- | |- | ||
− | | 01 | + | | 01:56 |
| Here '''g equal to 9.8 m per second square''' is the '''acceleration due to gravity''' and | | Here '''g equal to 9.8 m per second square''' is the '''acceleration due to gravity''' and | ||
|- | |- | ||
− | |02 | + | |02:03 |
|''' l equal to zero point five meter''' is the '''length''' of the '''pendulum.''' | |''' l equal to zero point five meter''' is the '''length''' of the '''pendulum.''' | ||
|- | |- | ||
− | |02 | + | |02:11 |
| For the given initial conditions, we have to solve the '''ODE''' within the '''time range zero less than equal to t less than equal to five.''' | | For the given initial conditions, we have to solve the '''ODE''' within the '''time range zero less than equal to t less than equal to five.''' | ||
|- | |- | ||
− | | 02 | + | | 02:22 |
|We also have to '''plot''' the solution. | |We also have to '''plot''' the solution. | ||
|- | |- | ||
− | | 02 | + | | 02:25 |
|Let us look at the code for solving this problem. | |Let us look at the code for solving this problem. | ||
Line 179: | Line 179: | ||
|- | |- | ||
− | | 02 | + | | 02:29 |
|Open '''pendulum dot sci''' on '''Scilab editor.''' | |Open '''pendulum dot sci''' on '''Scilab editor.''' | ||
|- | |- | ||
− | | 02 | + | | 02:34 |
|The first line of the code defines the initial conditions of the '''ODE.''' | |The first line of the code defines the initial conditions of the '''ODE.''' | ||
|- | |- | ||
− | |02 | + | |02:40 |
|Then we define the intial time value. And we provide the '''time range.''' | |Then we define the intial time value. And we provide the '''time range.''' | ||
|- | |- | ||
− | |02 | + | |02:46 |
| Next, we convert the given equation to a system of '''first order ODEs.''' | | Next, we convert the given equation to a system of '''first order ODEs.''' | ||
Line 198: | Line 198: | ||
|- | |- | ||
− | | 02 | + | | 02:52 |
|We substitute the values of '''g''' and '''l''' . | |We substitute the values of '''g''' and '''l''' . | ||
Line 205: | Line 205: | ||
|- | |- | ||
− | | 02 | + | | 02:56 |
||Here we take '''y''' to be the given '''variable theta''' and '''y dash''' to be '''theta dash.''' | ||Here we take '''y''' to be the given '''variable theta''' and '''y dash''' to be '''theta dash.''' | ||
' | ' | ||
Line 212: | Line 212: | ||
|- | |- | ||
− | |03 | + | |03:03 |
|Then we call the '''ode function''' with '''arguments y zero, t zero, t''' and the '''function Pendulum.''' | |Then we call the '''ode function''' with '''arguments y zero, t zero, t''' and the '''function Pendulum.''' | ||
Line 219: | Line 219: | ||
|- | |- | ||
− | | 03 | + | | 03:12 |
| The solution to the '''equation''' will be a '''matrix''' with two '''rows.''' | | The solution to the '''equation''' will be a '''matrix''' with two '''rows.''' | ||
|- | |- | ||
− | | 03 | + | | 03:17 |
| The first '''row''' will contain the values of '''y''' in the given '''time range.''' | | The first '''row''' will contain the values of '''y''' in the given '''time range.''' | ||
Line 231: | Line 231: | ||
|- | |- | ||
− | | 03 | + | | 03:21 |
| The second '''row''' will contain the values of '''y dash ''' within the '''time range. ''' | | The second '''row''' will contain the values of '''y dash ''' within the '''time range. ''' | ||
Line 237: | Line 237: | ||
|- | |- | ||
− | |03 | + | |03:27 |
|Hence we plot both the '''rows''' with respect to '''time. ''' | |Hence we plot both the '''rows''' with respect to '''time. ''' | ||
Line 244: | Line 244: | ||
|- | |- | ||
− | |03 | + | |03:31 |
|Save and execute the file '''Pendulum dot sci''' | |Save and execute the file '''Pendulum dot sci''' | ||
Line 251: | Line 251: | ||
|- | |- | ||
− | | 03 | + | | 03:37 |
|The plot shows how the values of '''y''' and '''y dash''' vary with '''time. ''' | |The plot shows how the values of '''y''' and '''y dash''' vary with '''time. ''' | ||
Line 260: | Line 260: | ||
|- | |- | ||
− | | 03 | + | | 03:44 |
|Switch to '''Scilab console''' | |Switch to '''Scilab console''' | ||
Line 267: | Line 267: | ||
|- | |- | ||
− | | 03 | + | | 03:47 |
| If you want to see the values of '''y,''' type '''y''' on the '''console''' and press '''Enter.''' | | If you want to see the values of '''y,''' type '''y''' on the '''console''' and press '''Enter.''' | ||
Line 273: | Line 273: | ||
|- | |- | ||
− | | 03 | + | | 03:54 |
|The values of '''y''' and '''y dash''' are displayed. | |The values of '''y''' and '''y dash''' are displayed. | ||
|- | |- | ||
− | | 03 | + | | 03:58 |
|Let us solve '''Van der Pol equation''' using the '''ode function.''' | |Let us solve '''Van der Pol equation''' using the '''ode function.''' | ||
Line 285: | Line 285: | ||
|- | |- | ||
− | | 04 | + | | 04:03 |
|We are given the '''equation ''' | |We are given the '''equation ''' | ||
Line 291: | Line 291: | ||
|- | |- | ||
− | | 04 | + | | 04:06 |
|'''v double dash of t plus epsilon into v of t square minus one into v dash of t plus v of t equal to zero.''' | |'''v double dash of t plus epsilon into v of t square minus one into v dash of t plus v of t equal to zero.''' | ||
Line 297: | Line 297: | ||
|- | |- | ||
− | | 04 | + | | 04:20 |
|The initial '''conditions''' are '''v of two equal to one''' and '''v dash of two equal to zero. ''' | |The initial '''conditions''' are '''v of two equal to one''' and '''v dash of two equal to zero. ''' | ||
Line 304: | Line 304: | ||
|- | |- | ||
− | | 04 | + | | 04:28 |
|Assume '''epsilon is equal to zero point eight nine seven. ''' | |Assume '''epsilon is equal to zero point eight nine seven. ''' | ||
Line 311: | Line 311: | ||
|- | |- | ||
− | |04 | + | |04:32 |
|We have to find the solution within the '''time range two less than t less than ten and then plot''' the solution. | |We have to find the solution within the '''time range two less than t less than ten and then plot''' the solution. | ||
Line 319: | Line 319: | ||
|- | |- | ||
− | | 04 | + | | 04:42 |
|Let us look at the code for '''Van der Pol equation. ''' | |Let us look at the code for '''Van der Pol equation. ''' | ||
Line 328: | Line 328: | ||
|- | |- | ||
− | | 04 | + | | 04:47 |
| Switch to '''Scilab editor''' and open '''vander pol dot sci.''' | | Switch to '''Scilab editor''' and open '''vander pol dot sci.''' | ||
Line 334: | Line 334: | ||
|- | |- | ||
− | | 04 | + | | 04:53 |
| We define the initial conditions of the '''ODEs''' and '''time''' and then define the '''time range. ''' | | We define the initial conditions of the '''ODEs''' and '''time''' and then define the '''time range. ''' | ||
Line 340: | Line 340: | ||
|- | |- | ||
− | | 05 | + | | 05:01 |
|Since the '''inital time value''' is given as '''two''', we start the time range at two. | |Since the '''inital time value''' is given as '''two''', we start the time range at two. | ||
Line 346: | Line 346: | ||
|- | |- | ||
− | | 05 | + | | 05:07 |
| Then we define the '''function vander pol''' and construct a system of '''first order ODEs.''' | | Then we define the '''function vander pol''' and construct a system of '''first order ODEs.''' | ||
|- | |- | ||
− | | 05 | + | | 05:15 |
|We substitute the value of '''epsilon''' with '''zero point eight nine seven. ''' | |We substitute the value of '''epsilon''' with '''zero point eight nine seven. ''' | ||
|- | |- | ||
− | | 05 | + | | 05:21 |
|Here '''y''' refers to the '''voltage v.''' | |Here '''y''' refers to the '''voltage v.''' | ||
Line 362: | Line 362: | ||
|- | |- | ||
− | | 05 | + | | 05:25 |
| Then we call '''ode function''' and solve the system of '''equations.''' | | Then we call '''ode function''' and solve the system of '''equations.''' | ||
Line 368: | Line 368: | ||
|- | |- | ||
− | | 05 | + | | 05:30 |
| Finally we plot '''y''' and '''y dash versus t.''' | | Finally we plot '''y''' and '''y dash versus t.''' | ||
Line 374: | Line 374: | ||
|- | |- | ||
− | | 05 | + | | 05:35 |
| Save and execute the file '''vander pol dot sci.''' | | Save and execute the file '''vander pol dot sci.''' | ||
Line 382: | Line 382: | ||
|- | |- | ||
− | | 05 | + | | 05:41 |
|The '''plot''' showing '''voltage versus time''' is shown. | |The '''plot''' showing '''voltage versus time''' is shown. | ||
Line 388: | Line 388: | ||
|- | |- | ||
− | | 05 | + | | 05:45 |
|Let's move onto '''Lorenz system of equations.''' | |Let's move onto '''Lorenz system of equations.''' | ||
Line 394: | Line 394: | ||
|- | |- | ||
− | | 05 | + | | 05:50 |
|The '''Lorenz system of equations''' is given by | |The '''Lorenz system of equations''' is given by | ||
Line 400: | Line 400: | ||
|- | |- | ||
− | | 05 | + | | 05:53 |
|'''x one dash equal to sigma into x two minus x one, ''' | |'''x one dash equal to sigma into x two minus x one, ''' | ||
Line 407: | Line 407: | ||
|- | |- | ||
− | | 06 | + | | 06:00 |
|'''x two dash equal to one plus r minus x three into x one minus x two and ''' | |'''x two dash equal to one plus r minus x three into x one minus x two and ''' | ||
Line 413: | Line 413: | ||
|- | |- | ||
− | | 06 | + | | 06:08 |
|'''x three dash equal to x one into x two minus b into x three.''' | |'''x three dash equal to x one into x two minus b into x three.''' | ||
Line 420: | Line 420: | ||
|- | |- | ||
− | | 06 | + | | 06:16 |
|The initial conditions are '''x one zero''' equal to '''minus ten, x two zero''' equal to '''ten''' and '''x three zero''' equal to '''twenty five.''' | |The initial conditions are '''x one zero''' equal to '''minus ten, x two zero''' equal to '''ten''' and '''x three zero''' equal to '''twenty five.''' | ||
Line 426: | Line 426: | ||
|- | |- | ||
− | | 06 | + | | 06:29 |
|Let '''sigma''' be equal to '''ten, r''' be equal to '''twenty eight and b''' equal to '''eight by three.''' | |Let '''sigma''' be equal to '''ten, r''' be equal to '''twenty eight and b''' equal to '''eight by three.''' | ||
Line 432: | Line 432: | ||
|- | |- | ||
− | | 06 | + | | 06:37 |
|Switch to '''Scilab editor''' and open '''Lorenz dot sci''' | |Switch to '''Scilab editor''' and open '''Lorenz dot sci''' | ||
Line 439: | Line 439: | ||
|- | |- | ||
− | | 06 | + | | 06:44 |
|We start by defining the initial conditions of the '''ODEs.''' | |We start by defining the initial conditions of the '''ODEs.''' | ||
|- | |- | ||
− | | 06 | + | | 06:48 |
|Since there are three different '''ODEs,''' there are three initial conditions. | |Since there are three different '''ODEs,''' there are three initial conditions. | ||
Line 451: | Line 451: | ||
|- | |- | ||
− | | 06 | + | | 06:54 |
|Then we define the '''inital time''' condition and next the '''time range.''' | |Then we define the '''inital time''' condition and next the '''time range.''' | ||
Line 458: | Line 458: | ||
|- | |- | ||
− | | 07 | + | | 07:00 |
|We define the '''function Lorenz''' and then define the given constants '''sigma, r and b.''' | |We define the '''function Lorenz''' and then define the given constants '''sigma, r and b.''' | ||
Line 465: | Line 465: | ||
|- | |- | ||
− | | 07 | + | | 07:08 |
|Then we define the '''first order ODEs. ''' | |Then we define the '''first order ODEs. ''' | ||
Line 471: | Line 471: | ||
|- | |- | ||
− | | 07 | + | | 07:12 |
|Then we call the '''ode function''' to solve the '''Lorenz system of equations.''' | |Then we call the '''ode function''' to solve the '''Lorenz system of equations.''' | ||
Line 477: | Line 477: | ||
|- | |- | ||
− | | 07 | + | | 07:18 |
|We equate the solution to '''x.''' | |We equate the solution to '''x.''' | ||
Line 483: | Line 483: | ||
|- | |- | ||
− | | 07 | + | | 07:21 |
|Then we '''plot x one, x two''' and '''x three versus time. ''' | |Then we '''plot x one, x two''' and '''x three versus time. ''' | ||
Line 489: | Line 489: | ||
|- | |- | ||
− | | 07 | + | | 07:28 |
|Save and execute the file '''Lorenz dot sci.''' | |Save and execute the file '''Lorenz dot sci.''' | ||
Line 495: | Line 495: | ||
|- | |- | ||
− | | 07 | + | | 07:33 |
|The '''plot''' of '''x one, x two''' and '''x three versus time''' is shown. | |The '''plot''' of '''x one, x two''' and '''x three versus time''' is shown. | ||
Line 502: | Line 502: | ||
|- | |- | ||
− | | 07 | + | | 07:39 |
|Let us summarize this tutorial. | |Let us summarize this tutorial. | ||
Line 509: | Line 509: | ||
|- | |- | ||
− | | 07 | + | | 07:41 |
|In this tutorial we have learnt to develop '''Scilab code''' to solve an '''ODE''' using '''Scilab ode function.''' | |In this tutorial we have learnt to develop '''Scilab code''' to solve an '''ODE''' using '''Scilab ode function.''' | ||
Line 515: | Line 515: | ||
|- | |- | ||
− | | 07 | + | | 07:50 |
|Then we have learnt to '''plot''' the solution. | |Then we have learnt to '''plot''' the solution. | ||
Line 522: | Line 522: | ||
|- | |- | ||
− | |07 | + | |07:53 |
| Watch the video available at the link shown below | | Watch the video available at the link shown below | ||
|- | |- | ||
− | | 07 | + | | 07:56 |
| It summarises the Spoken Tutorial project | | It summarises the Spoken Tutorial project | ||
Line 535: | Line 535: | ||
|- | |- | ||
− | |07 | + | |07:59 |
||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 | ||
Line 541: | Line 541: | ||
|- | |- | ||
− | |08 | + | |08:04 |
||The spoken tutorial project Team | ||The spoken tutorial project Team | ||
Line 547: | Line 547: | ||
|- | |- | ||
− | |08 | + | |08:06 |
||Conducts workshops using spoken tutorials | ||Conducts workshops using spoken tutorials | ||
Line 554: | Line 554: | ||
|- | |- | ||
− | |08 | + | |08:09 |
||Gives certificates to those who pass an online test | ||Gives certificates to those who pass an online test | ||
Line 561: | Line 561: | ||
|- | |- | ||
− | |08 | + | |08:13 |
||For more details, please write to contact@spoken-tutorial.org | ||For more details, please write to contact@spoken-tutorial.org | ||
Line 568: | Line 568: | ||
|- | |- | ||
− | |08 | + | |08:20 |
|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 576: | Line 576: | ||
|- | |- | ||
− | | 08 | + | | 08:23 |
| 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. | ||
|- | |- | ||
− | | 08 | + | | 08:31 |
|More information on this mission is available at the link shown below | |More information on this mission is available at the link shown below | ||
Line 587: | Line 587: | ||
|- | |- | ||
− | | 08 | + | | 08:36 |
|This is Ashwini Patil signing off. | |This is Ashwini Patil signing off. | ||
Line 593: | Line 593: | ||
|- | |- | ||
− | |08 | + | |08:38 |
| Thank you for joining. | | Thank you for joining. |
Revision as of 10:39, 11 July 2014
Time | Narration |
00:01 | Dear Friends, |
00:02 | Welcome to the Spoken Tutorial on “Solving ODEs using Scilab ode Function” |
00:09 | At the end of this tutorial, you will learn how to: |
00:12 | Use Scilab ode function |
00:15 | Solve typical examples of ODEs and |
00:18 | Plot the solution |
00:21 | The typical examples we will be
|
00:24 | Motion of simple pendulum |
00:26 | Van der Pol equation |
00:28 | and Lorenz system |
00:30 | To record this tutorial, I am using |
00:33 | Ubuntu 12.04 as the operating system |
00:36 | and Scilab 5.3.3 version |
00:40 | To practise this tutorial, a learner should have basic knowledge of Scilab
|
00:45 | and should know how to solve ODEs. |
00:48 | To learn Scilab, please refer to the relevant tutorials available on the Spoken Tutorial website. |
00:56 | The ode function is an ordinary differential equation solver.
|
01:01 | The syntax is y equal to ode within paranthesis y zero, t zero, t and f
|
01:10 | Here y zero is the initial conditon of the ODEs
|
01:15 | t zero is the initial time |
01:17 | t is the time range
|
01:19 | and f is the function |
01:22 | Consider the motion of simple pendulum.
|
01:25 | Let theta t be the angle made by the pendulum with the vertical at time t.
|
01:33 | We are given the initial conditions |
01:36 | theta zero is equal to pi by four and |
01:39 | theta dash of zero is equal to zero. |
01:44 | Then the position of the pendulum is given by |
01:47 | theta double dash t minus g by l into sin of theta t equal to zero.
|
01:56 | Here g equal to 9.8 m per second square is the acceleration due to gravity and
|
02:03 | l equal to zero point five meter is the length of the pendulum. |
02:11 | For the given initial conditions, we have to solve the ODE within the time range zero less than equal to t less than equal to five. |
02:22 | We also have to plot the solution.
|
02:25 | Let us look at the code for solving this problem.
|
02:29 | Open pendulum dot sci on Scilab editor.
|
02:34 | The first line of the code defines the initial conditions of the ODE. |
02:40 | Then we define the intial time value. And we provide the time range. |
02:46 | Next, we convert the given equation to a system of first order ODEs.
|
02:52 | We substitute the values of g and l .
|
02:56 | Here we take y to be the given variable theta and y dash to be theta dash.
'
|
03:03 | Then we call the ode function with arguments y zero, t zero, t and the function Pendulum.
|
03:12 | The solution to the equation will be a matrix with two rows. |
03:17 | The first row will contain the values of y in the given time range.
|
03:21 | The second row will contain the values of y dash within the time range. |
03:27 | Hence we plot both the rows with respect to time.
|
03:31 | Save and execute the file Pendulum dot sci
|
03:37 | The plot shows how the values of y and y dash vary with time.
|
03:44 | Switch to Scilab console
|
03:47 | If you want to see the values of y, type y on the console and press Enter. |
03:54 | The values of y and y dash are displayed. |
03:58 | Let us solve Van der Pol equation using the ode function.
|
04:03 | We are given the equation |
04:06 | v double dash of t plus epsilon into v of t square minus one into v dash of t plus v of t equal to zero. |
04:20 | The initial conditions are v of two equal to one and v dash of two equal to zero.
|
04:28 | Assume epsilon is equal to zero point eight nine seven.
|
04:32 | We have to find the solution within the time range two less than t less than ten and then plot the solution.
|
04:42 | Let us look at the code for Van der Pol equation.
|
04:47 | Switch to Scilab editor and open vander pol dot sci. |
04:53 | We define the initial conditions of the ODEs and time and then define the time range. |
05:01 | Since the inital time value is given as two, we start the time range at two.
|
05:07 | Then we define the function vander pol and construct a system of first order ODEs. |
05:15 | We substitute the value of epsilon with zero point eight nine seven. |
05:21 | Here y refers to the voltage v.
|
05:25 | Then we call ode function and solve the system of equations. |
05:30 | Finally we plot y and y dash versus t. |
05:35 | Save and execute the file vander pol dot sci.
|
05:41 | The plot showing voltage versus time is shown. |
05:45 | Let's move onto Lorenz system of equations. |
05:50 | The Lorenz system of equations is given by |
05:53 | x one dash equal to sigma into x two minus x one,
|
06:00 | x two dash equal to one plus r minus x three into x one minus x two and |
06:08 | x three dash equal to x one into x two minus b into x three.
|
06:16 | The initial conditions are x one zero equal to minus ten, x two zero equal to ten and x three zero equal to twenty five. |
06:29 | Let sigma be equal to ten, r be equal to twenty eight and b equal to eight by three. |
06:37 | Switch to Scilab editor and open Lorenz dot sci
|
06:44 | We start by defining the initial conditions of the ODEs. |
06:48 | Since there are three different ODEs, there are three initial conditions.
|
06:54 | Then we define the inital time condition and next the time range.
|
07:00 | We define the function Lorenz and then define the given constants sigma, r and b.
|
07:08 | Then we define the first order ODEs. |
07:12 | Then we call the ode function to solve the Lorenz system of equations. |
07:18 | We equate the solution to x. |
07:21 | Then we plot x one, x two and x three versus time. |
07:28 | Save and execute the file Lorenz dot sci. |
07:33 | The plot of x one, x two and x three versus time is shown.
|
07:39 | Let us summarize this tutorial.
|
07:41 | In this tutorial we have learnt to develop Scilab code to solve an ODE using Scilab ode function. |
07:50 | Then we have learnt to plot the solution.
|
07:53 | Watch the video available at the link shown below |
07:56 | It summarises the Spoken Tutorial project
|
07:59 | If you do not have good bandwidth, you can download and watch it |
08:04 | The spoken tutorial project Team |
08:06 | Conducts workshops using spoken tutorials
|
08:09 | Gives certificates to those who pass an online test
|
08:13 | For more details, please write to contact@spoken-tutorial.org
|
08:20 | Spoken Tutorial Project is a part of the Talk to a Teacher project
|
08:23 | It is supported by the National Mission on Eduction through ICT, MHRD, Government of India. |
08:31 | More information on this mission is available at the link shown below |
08:36 | This is Ashwini Patil signing off. |
08:38 | Thank you for joining. |