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…') |
PoojaMoolya (Talk | contribs) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{| Border=1 | {| Border=1 | ||
− | | | + | |'''Time''' |
− | | | + | |'''Narration''' |
|- | |- | ||
− | | 00 | + | | 00:01 |
− | |Dear Friends, | + | |Dear Friends, 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 |
|- | |- | ||
− | |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 | + | |The typical examples 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 | + | |To practice this tutorial, a learner should have basic knowledge of '''Scilab''' |
− | + | ||
|- | |- | ||
− | + | |00:45 | |
− | |00 | + | |
− | + | ||
|and should know how to solve '''ODEs.''' | |and should know how to solve '''ODEs.''' | ||
|- | |- | ||
− | + | |00:48 | |
− | |00 | + | |
|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:56 | |
− | | 00 | + | |The '''ode''' function is an '''ordinary differential equation solver'''. |
− | + | ||
− | |The '''ode | + | |
− | + | ||
|- | |- | ||
− | + | | 01:01 | |
− | | 01 | + | ||The syntax is '''y equal to ode''' within parenthesis '''y zero, t zero, t''' and '''f'''. |
− | ||The syntax is '''y equal to ode within | + | |
− | + | ||
− | + | ||
|- | |- | ||
− | + | |01:10 | |
− | |01 | + | || Here '''y zero''' is the initial condition of the '''ODEs''', |
− | + | ||
− | || Here '''y zero''' is the initial | + | |
− | + | ||
− | + | ||
|- | |- | ||
− | + | |01:15 | |
− | |01 | + | | '''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''', |
− | + | ||
|- | |- | ||
− | + | |01:19 | |
− | |01 | + | |and '''f''' is the '''function'''. |
− | + | ||
− | |and '''f''' is the '''function''' | + | |
|- | |- | ||
− | + | |01:22 | |
− | |01 | + | |
− | + | ||
||Consider the motion of '''simple pendulum.''' | ||Consider the motion of '''simple pendulum.''' | ||
− | |||
|- | |- | ||
− | |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.''' | ||
− | |||
|- | |- | ||
− | + | | 01:33 | |
− | | 01 | + | |We are given the initial conditions- |
− | |We are given the initial conditions | + | |
|- | |- | ||
− | + | |01:36 | |
− | |01 | + | |'''theta of zero''' is equal to '''pi by four''' and |
− | + | ||
− | |'''theta zero''' is equal to '''pi by four''' and | + | |
|- | |- | ||
− | + | |01:39 | |
− | |01 | + | |
− | + | ||
| '''theta dash of zero''' is equal to '''zero.''' | | '''theta dash of zero''' is equal to '''zero.''' | ||
|- | |- | ||
+ | |01:44 | ||
+ | | Then the position of the '''pendulum''' is given by: | ||
− | |||
− | |||
− | |||
|- | |- | ||
− | + | | 01:47 | |
− | | 01 | + | |
− | + | ||
|| '''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.''' | ||
− | |||
|- | |- | ||
− | | 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 | + | |''' 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. | ||
− | |||
− | |||
|- | |- | ||
− | | 02 | + | | 02:29 |
− | |Open ''' | + | |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.''' | ||
− | |||
|- | |- | ||
− | + | | 02:52 | |
− | | 02 | + | |
− | + | ||
|We substitute the values of '''g''' and '''l''' . | |We substitute the values of '''g''' and '''l''' . | ||
− | |||
|- | |- | ||
− | + | | 02:56 | |
− | | 02 | + | |
||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.''' | ||
− | |||
− | |||
|- | |- | ||
− | + | |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 | + | |
− | + | ||
|- | |- | ||
− | + | | 03:12 | |
− | | 03 | + | | The solution to the equation will be a '''matrix''' with two '''rows.''' |
− | | The solution to the | + | |
|- | |- | ||
− | + | | 03:17 | |
− | | 03 | + | |
− | + | ||
| 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.''' | ||
− | |||
|- | |- | ||
− | + | | 03:21 | |
− | | 03 | + | |
− | + | ||
| 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. ''' | ||
|- | |- | ||
− | + | |03:27 | |
− | |03 | + | |
− | + | ||
|Hence we plot both the '''rows''' with respect to '''time. ''' | |Hence we plot both the '''rows''' with respect to '''time. ''' | ||
− | |||
|- | |- | ||
− | + | |03:31 | |
− | |03 | + | |Save and execute the file '''Pendulum dot sci'''. |
− | + | ||
− | |Save and execute the file '''Pendulum dot sci''' | + | |
− | + | ||
|- | |- | ||
− | + | | 03:37 | |
− | | 03 | + | |
− | + | ||
|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. ''' | ||
− | |||
− | |||
− | |||
|- | |- | ||
− | + | | 03:44 | |
− | | 03 | + | |Switch to '''Scilab console'''. |
− | + | ||
− | |Switch to '''Scilab console''' | + | |
− | + | ||
|- | |- | ||
− | + | | 03:47 | |
− | | 03 | + | |
− | + | ||
| 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.''' | ||
|- | |- | ||
− | + | | 03:54 | |
− | | 03 | + | |
− | + | ||
|The values of '''y''' and '''y dash''' are displayed. | |The values of '''y''' and '''y dash''' are displayed. | ||
|- | |- | ||
− | + | | 03:58 | |
− | | 03 | + | |Let us solve '''Van der Pol equation''' using the '''ode''' function. |
− | + | ||
− | |Let us solve '''Van der Pol equation''' using the '''ode | + | |
− | + | ||
|- | |- | ||
− | + | | 04:03 | |
− | | 04 | + | |We are given the '''equation '''- |
− | + | ||
− | |We are given the '''equation ''' | + | |
|- | |- | ||
− | + | | 04:06 | |
− | | 04 | + | |
− | + | ||
|'''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.''' | ||
|- | |- | ||
− | + | | 04:20 | |
− | | 04 | + | |The initial conditions are '''v of two equal to one''' and '''v dash of two equal to zero. ''' |
− | + | ||
− | |The initial | + | |
− | + | ||
|- | |- | ||
− | + | | 04:28 | |
− | | 04 | + | |
− | + | ||
|Assume '''epsilon is equal to zero point eight nine seven. ''' | |Assume '''epsilon is equal to zero point eight nine seven. ''' | ||
− | |||
|- | |- | ||
− | + | |04:32 | |
− | |04 | + | |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. | + | |
− | + | ||
− | + | ||
|- | |- | ||
− | + | | 04:42 | |
− | | 04 | + | |
− | + | ||
|Let us look at the code for '''Van der Pol equation. ''' | |Let us look at the code for '''Van der Pol equation. ''' | ||
− | |||
− | |||
− | |||
|- | |- | ||
− | + | | 04:47 | |
− | | 04 | + | | Switch to '''Scilab editor''' and open '''Vander pol dot sci.''' |
− | + | ||
− | | Switch to '''Scilab editor''' and open ''' | + | |
|- | |- | ||
− | + | | 04:53 | |
− | | 04 | + | |
− | + | ||
| 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. ''' | ||
|- | |- | ||
− | + | | 05:01 | |
− | | 05 | + | |
− | + | ||
|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. | ||
− | |||
|- | |- | ||
− | | 05 | + | | 05:07 |
− | | Then we define the '''function | + | | 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:21 | |
− | | 05 | + | |
− | + | ||
|Here '''y''' refers to the '''voltage v.''' | |Here '''y''' refers to the '''voltage v.''' | ||
− | |||
|- | |- | ||
− | + | | 05:25 | |
− | | 05 | + | | Then we call '''ode''' function and solve the system of '''equations.''' |
− | + | ||
− | | Then we call '''ode | + | |
|- | |- | ||
− | + | | 05:30 | |
− | | 05 | + | |
− | + | ||
| Finally we plot '''y''' and '''y dash versus t.''' | | Finally we plot '''y''' and '''y dash versus t.''' | ||
|- | |- | ||
− | + | | 05:35 | |
− | | 05 | + | | Save and execute the file '''Vander pol dot sci.''' |
− | + | ||
− | | Save and execute the file ''' | + | |
− | + | ||
− | + | ||
|- | |- | ||
− | + | | 05:41 | |
− | | 05 | + | |
− | + | ||
|The '''plot''' showing '''voltage versus time''' is shown. | |The '''plot''' showing '''voltage versus time''' is shown. | ||
|- | |- | ||
− | + | | 05:45 | |
− | | 05 | + | |
− | + | ||
|Let's move onto '''Lorenz system of equations.''' | |Let's move onto '''Lorenz system of equations.''' | ||
|- | |- | ||
− | + | | 05:50 | |
− | | 05 | + | |The '''Lorenz system of equations''' is given by: |
− | + | ||
− | |The '''Lorenz system of equations''' is given by | + | |
|- | |- | ||
− | + | | 05:53 | |
− | | 05 | + | |'''x one dash equal to sigma into x two minus x one''', |
− | + | ||
− | |'''x one dash equal to sigma into x two minus x one | + | |
− | + | ||
|- | |- | ||
− | + | | 06:00 | |
− | | 06 | + | |'''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 | + | |
|- | |- | ||
− | + | | 06:08 | |
− | | 06 | + | |
− | + | ||
|'''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.''' | ||
− | |||
|- | |- | ||
− | + | | 06:16 | |
− | | 06 | + | |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 | + | |
|- | |- | ||
− | + | | 06:29 | |
− | | 06 | + | |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.''' | + | |
|- | |- | ||
− | + | | 06:37 | |
− | | 06 | + | |Switch to '''Scilab editor''' and open '''Lorenz dot sci'''. |
− | + | ||
− | |Switch to '''Scilab editor''' and open '''Lorenz dot sci''' | + | |
− | + | ||
|- | |- | ||
− | + | | 06:44 | |
− | | 06 | + | |
|We start by defining the initial conditions of the '''ODEs.''' | |We start by defining the initial conditions of the '''ODEs.''' | ||
|- | |- | ||
− | + | | 06:48 | |
− | | 06 | + | |
− | + | ||
|Since there are three different '''ODEs,''' there are three initial conditions. | |Since there are three different '''ODEs,''' there are three initial conditions. | ||
− | |||
|- | |- | ||
− | + | | 06:54 | |
− | | 06 | + | |
− | + | ||
|Then we define the '''inital time''' condition and next the '''time range.''' | |Then we define the '''inital time''' condition and next the '''time range.''' | ||
− | |||
|- | |- | ||
− | + | | 07:00 | |
− | | 07 | + | |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.''' | + | |
− | + | ||
|- | |- | ||
− | + | | 07:08 | |
− | | 07 | + | |Then we define the '''first order ODEs.''' |
− | + | ||
− | |Then we define the '''first order ODEs. ''' | + | |
|- | |- | ||
− | + | | 07:12 | |
− | | 07 | + | |Then we call the '''ode''' function to solve the '''Lorenz system of equations.''' |
− | + | ||
− | |Then we call the '''ode | + | |
|- | |- | ||
− | + | | 07:18 | |
− | | 07 | + | |
− | + | ||
|We equate the solution to '''x.''' | |We equate the solution to '''x.''' | ||
|- | |- | ||
− | + | | 07:21 | |
− | | 07 | + | |Then we '''plot x one, x two''' and '''x three versus time.''' |
− | + | ||
− | |Then we '''plot x one, x two''' and '''x three versus time. ''' | + | |
|- | |- | ||
− | + | | 07:28 | |
− | | 07 | + | |
− | + | ||
|Save and execute the file '''Lorenz dot sci.''' | |Save and execute the file '''Lorenz dot sci.''' | ||
|- | |- | ||
− | + | | 07:33 | |
− | | 07 | + | |
− | + | ||
|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. | ||
− | |||
|- | |- | ||
− | + | | 07:39 | |
− | | 07 | + | |
− | + | ||
|Let us summarize this tutorial. | |Let us summarize this tutorial. | ||
− | |||
|- | |- | ||
− | + | | 07:41 | |
− | | 07 | + | |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 | + | |
|- | |- | ||
− | + | | 07:50 | |
− | | 07 | + | |
− | + | ||
|Then we have learnt to '''plot''' the solution. | |Then we have learnt to '''plot''' the solution. | ||
− | |||
− | |||
|- | |- | ||
− | |07 | + | |07:53 |
− | | Watch the video available at the link shown below | + | | Watch the video available at the link shown below. |
|- | |- | ||
− | + | | 07:56 | |
− | | 07 | + | | It summarizes the Spoken Tutorial project. |
− | + | ||
− | | It | + | |
− | + | ||
− | + | ||
|- | |- | ||
− | + | |07:59 | |
− | |07 | + | ||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 | + | |
|- | |- | ||
− | + | |08:04 | |
− | |08 | + | ||The spoken tutorial project Team: |
− | + | ||
− | ||The spoken tutorial project Team | + | |
|- | |- | ||
− | + | |08:06 | |
− | |08 | + | ||Conducts workshops using spoken tutorials. |
− | + | ||
− | ||Conducts workshops using spoken tutorials | + | |
− | + | ||
|- | |- | ||
− | + | |08:09 | |
− | |08 | + | ||Gives certificates to those who pass an online test. |
− | + | ||
− | ||Gives certificates to those who pass an online test | + | |
− | + | ||
|- | |- | ||
− | + | |08:13 | |
− | |08 | + | ||For more details, please write to contact@spoken-tutorial.org. |
− | + | ||
− | ||For more details, please write to contact@spoken-tutorial.org | + | |
− | + | ||
|- | |- | ||
− | + | |08:20 | |
− | |08 | + | |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 | + | |
− | + | ||
− | + | ||
|- | |- | ||
− | + | | 08:23 | |
− | | 08 | + | |
− | + | ||
| 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:31 | |
− | | 08 | + | |More information on this mission is available at the link shown below. |
− | + | ||
− | |More information on this mission is available at the link shown below | + | |
|- | |- | ||
− | + | | 08:36 | |
− | | 08 | + | |This is Ashwini Patil, signing off. |
− | + | ||
− | |This is Ashwini Patil signing off. | + | |
|- | |- | ||
− | + | |08:38 | |
− | |08 | + | |
− | + | ||
| Thank you for joining. | | Thank you for joining. |
Latest revision as of 11:11, 10 March 2017
Time | Narration |
00:01 | Dear Friends, 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 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 practice 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 parenthesis y zero, t zero, t and f. |
01:10 | Here y zero is the initial condition 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 of 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 summarizes 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. |