Difference between revisions of "Scilab/C4/Linear-equations-Iterative-Methods/Gujarati"
From Script | Spoken-Tutorial
Jyotisolanki (Talk | contribs) |
Jyotisolanki (Talk | contribs) |
||
| Line 81: | Line 81: | ||
| 01:39 | | 01:39 | ||
| − | | | + | | હવે '''Jacobi Method''' (જ્કોબી મેથડ) નો ઉપયોગ કરીને ઉદાહરણને હલ કરીએ. |
|- | |- | ||
| 01:44 | | 01:44 | ||
| − | || | + | || '''Jacobi Method.''' માટે કોડ જોઈએ. |
|- | |- | ||
| 01:48 | | 01:48 | ||
| − | || | + | || સાઈલેબ કંસોલ પર પ્રદશિત ઉત્તરના ફોર્મ્નેતને સ્પષ્ટ કરવા માટે આપણે ફોરમેટ મેથડનો ઉપયોગ કરીએ છીએ. |
|- | |- | ||
| Line 97: | Line 97: | ||
|01:56 | |01:56 | ||
| − | || | + | || '''e''' બતાડે છે કે ઉત્તર '''scientific notation.''' માં હોવો જોઈએ. |
|- | |- | ||
| Line 103: | Line 103: | ||
|02:01 | |02:01 | ||
| − | | | + | | અને '''twenty''' પ્રદશિત થવા વાડી ડીજીટસને સ્પષ્ટ કરે છે. |
|- | |- | ||
|02:06 | |02:06 | ||
| − | | | + | |પછી આપણે આપેલ મેટ્રાઈસીસ ની વેલ્યુઓ પ્રાપ્ત કરવા માટે ઈનપુટ ફંક્શન નો ઉપયોગ કરીએ છીએ. |
| − | + | ||
|- | |- | ||
| Line 127: | Line 127: | ||
|- | |- | ||
| 02:17 | | 02:17 | ||
| − | |'''maximum number of iteration | + | |'''maximum number of iteration ''' અને |
|- | |- | ||
| Line 138: | Line 138: | ||
|02:22 | |02:22 | ||
| − | || | + | || પછી આપણે '''size''' ફંક્શન ઉપયોગ કરીએ છીએ એ તપાસવા માટે કે '''A matrix''' એ '''square matrix.''' છે કે નહિ. |
|- | |- | ||
| Line 144: | Line 144: | ||
|02:29 | |02:29 | ||
| − | | | + | | જો નથી તો આપણે એરર દેખાડવા માટે એરર ફંક્શન ઉપયોગ કરીએ છીએ. |
|- | |- | ||
| Line 150: | Line 150: | ||
|02:34 | |02:34 | ||
| − | | | + | | પછી આપણે તપાસીએ છીએ કે'''matrix A''' એ '''diagonally dominant.''' છે કે નહી. |
|- | |- | ||
| Line 156: | Line 156: | ||
| 02:40 | | 02:40 | ||
| − | || | + | || પ્રથમ અડધો ભાગ '''matrix.''' ની પ્રત્યેક રો ના સરવાળાની ગણતરી કરે છે. |
|- | |- | ||
| 02:45 | | 02:45 | ||
| − | | | + | | પછી આ તપાસે છે કે '''diagonal element''' ના ગુણન નું બમણું તે રો ને એલિમેન્ટસ ના સરવાળાથી મોટું છે કે નહી. |
|- | |- | ||
|02:54 | |02:54 | ||
| − | | | + | | જો નથી તો '''error''' ફંક્શન નો ઉપયોગ કરીને એરર પ્રદશિત થાય છે. |
|- | |- | ||
Revision as of 11:35, 18 December 2015
| Time | Narration |
| 00:01 | નમસ્તે મિત્રો, |
| 00:02 | Iterative Methods મેથડ નો ઉપયોગ કરીને લીનીયર ઇક્વેશન હલ કરવા પરના સ્પોકન ટ્યુટોરિયલમાં તમારું સ્વાગત છે. |
| 00:10 | આ ટ્યુટોરીયલ ના અંતે તમે શીખશો કેવી રીતે: |
| 00:14 | iterative methods વાપરીને લીનીયર ઇક્વેશનના સીસ્ટમને કેવી રીતે હલ કરવું. |
| 00:18 | linear equations. લીનીયર ઇક્વેશન ને હલ કરવા માટે સાઈલેબ કોડ બનાવવો. |
| 00:22 | આ ટ્યુટોરિયલ રિકોર્ડ કરવા માટે હું ઉપયોગ કરી રહી છું, |
| 00:25 | Scilab 5.3.3 વર્જન સાથે .
|
| 00:28 | Ubuntu 12.04 ઓપરેટીંગ સીસ્ટમ . |
| 00:33 | આ ટ્યુટોરિયલ ના અભ્યાસ માટે તમને Scilab નું સમાન્ય જ્ઞાન હોવું જોઈએ. |
| 00:39 | અને Linear Equations ને કેવી રીતે હલ કરાય તેની જાન હોવી જોઈએ. |
| 00:42 | સાઈલેબ ને શીખવા માટે સ્પોકન ટ્યુટોરિયલ વેબ સાઈટ પર સાઈલેબ પર ઉપલબ્ધ સંબંધિત ટ્યુટોરિયલ જુઓ. |
| 00:50 | પ્રથમ iterative method જે આપણે શીખીશું તે Jacobi method. (જ્કોબી મેથડ) છે. |
| 00:56 | આપણને n equations અને n unknowns , ના સાથે લીનીયર ઇક્વેશન આપેલ છે. |
| 01:02 | આપણે ઇક્વેશન ને ફરી લખીએ છીએ જેમકે x of i k plus one is equal to b i minus summation of a i j x j k from j equal to one to n divided by a i i જ્યાં i one થી n સુધી છે. |
| 01:24 | આપણે પ્રત્યેક x of i ના માટે વેલ્યુ ધારીએ છીએ. |
| 01:27 | પછી આપણે પાછલી સ્ટેપમાં મેળવેલ ઇક્વેશન માં વેલ્યુને રાખીએ છીએ. |
| 01:34 | આપણે ઈટરેશન ને ત્યાર સુધી જારી રાખીશું કે જ્યાં શુધી સોલ્યુશન સમાઇ ન જાય. |
| 01:39 | હવે Jacobi Method (જ્કોબી મેથડ) નો ઉપયોગ કરીને ઉદાહરણને હલ કરીએ. |
| 01:44 | Jacobi Method. માટે કોડ જોઈએ. |
| 01:48 | સાઈલેબ કંસોલ પર પ્રદશિત ઉત્તરના ફોર્મ્નેતને સ્પષ્ટ કરવા માટે આપણે ફોરમેટ મેથડનો ઉપયોગ કરીએ છીએ. |
| 01:56 | e બતાડે છે કે ઉત્તર scientific notation. માં હોવો જોઈએ. |
| 02:01 | અને twenty પ્રદશિત થવા વાડી ડીજીટસને સ્પષ્ટ કરે છે. |
| 02:06 | પછી આપણે આપેલ મેટ્રાઈસીસ ની વેલ્યુઓ પ્રાપ્ત કરવા માટે ઈનપુટ ફંક્શન નો ઉપયોગ કરીએ છીએ. |
| 02:10 | the matrices coefficient matrix, |
| 02:12 | right hand side matrix, |
| 02:14 | initial values matrix, |
| 02:17 | maximum number of iteration અને |
| 02:19 | convergence tolerance. |
| 02:22 | પછી આપણે size ફંક્શન ઉપયોગ કરીએ છીએ એ તપાસવા માટે કે A matrix એ square matrix. છે કે નહિ. |
| 02:29 | જો નથી તો આપણે એરર દેખાડવા માટે એરર ફંક્શન ઉપયોગ કરીએ છીએ. |
| 02:34 | પછી આપણે તપાસીએ છીએ કેmatrix A એ diagonally dominant. છે કે નહી. |
| 02:40 | પ્રથમ અડધો ભાગ matrix. ની પ્રત્યેક રો ના સરવાળાની ગણતરી કરે છે. |
| 02:45 | પછી આ તપાસે છે કે diagonal element ના ગુણન નું બમણું તે રો ને એલિમેન્ટસ ના સરવાળાથી મોટું છે કે નહી. |
| 02:54 | જો નથી તો error ફંક્શન નો ઉપયોગ કરીને એરર પ્રદશિત થાય છે. |
| 03:01 | Then we define the function Jacobi Iteration with input arguments |
| 03:07 | A, b , x zero, |
| 03:09 | maximum iteration and tolerance level. |
| 03:14 | Here x zero is the initial values matrix. |
| 03:19 | We check if the size of A matrix and initial values matrix are compatible with each other. |
| 03:28 | We calculate the value for x k p one and then check if the relative error is lesser than tolerance level. |
| 03:38 | If it is lesser than tolerance level, we break the iteration and the solution is returned. |
| 03:45 | Finally we end the function. |
| 03:48 | Let us save and execute the function. |
| 03:51 | Switch to Scilab console. |
| 03:54 | Let us enter the values at each prompt. |
| 03:57 | The coefficient matrix A is open square bracket two space one semi colon five space seven close square bracket |
| 04:08 | Press Enter. |
| 04:10 | Then we type open square bracket eleven semicolon thirteen close square bracket |
| 04:17 | Press Enter. |
| 04:20 | The initial values matrix is open square bracket one semi colon one close square bracket |
| 04:28 | Press Enter. |
| 04:30 | The maximum number of iterations is twenty five. |
| 04:34 | Press Enter. |
| 04:36 | Let the convergence tolerance level be zero point zero zero zero zero one |
| 04:44 | Press Enter. |
| 04:46 | We call the function by typing |
| 04:48 | Jacobi Iteration open parenthesis A comma b comma x zero comma M a x I t e r comma t o l close parenthesis |
| 05:04 | Press Enter. |
| 05:06 | The values for x one and x two are shown on the console. |
| 05:11 | The number of iterations are also shown. |
| 05:14 | Let us now study Gauss Seidel method. |
| 05:19 | 'Given a system of linear equations with n equations and n unknowns |
| 05:26 | we rewrite the equations for each unknown |
| 05:29 | by subtracting the other variables and their coefficients from the corresponding right hand side element. |
| 05:37 | Then we divide this by the coefficient a i i of the unknown variable' for that variable. |
| 05:45 | This is done for every given equation. |
| 05:49 | In Jacobi method, for the computation of x of i k plus one, every element of x of i k is used except x of i k plus one . |
| 06:03 | In Gauss Seidel method, we over write the value of x of i k with x of i k plus one. |
| 06:12 | Let us solve this example using Gauss Seidel Method. |
| 06:17 | Let us look at the code for Gauss Seidel Method. |
| 06:21 | The first line specifies the format of the displayed answer on the console using format function. |
| 06:29 | Then we use input function to get the values of |
| 06:32 | coefficient matrix, |
| 06:34 | right hand side matrix, |
| 06:36 | initial values of the variables matrix, |
| 06:38 | maximum number of iterations and |
| 06:40 | tolerance level. |
| 06:43 | Then we define the function Gauss Seidel with input arguments A comma b comma x zero comma max iterations and tolerance level and output argument solution. |
| 06:58 | We check if matrix A is square and the sizes of initial vector and matrix A are compatible using size and length function. |
| 07:10 | Then we start the iterations. |
| 07:13 | We equate the initial values vector x zero to x k. |
| 07:19 | We create a matrix of zeros with the same size of x k and call it x k p one. |
| 07:28 | We solve for each equation to get the value of the unknown variable for that equation using x k p one. |
| 07:38 | At each iteration, the value of x k p one gets updated. |
| 07:44 | Also, we check if relative error is lesser than specified tolerance level. |
| 07:50 | If it is, we break the iteration. |
| 07:54 | Then equate x k p one to the variable solution. |
| 07:59 | Finally, we end the function. |
| 08:02 | Let us save and execute the function. |
| 08:06 | Switch to Scilab console. |
| 08:09 | For the first prompt, we type matrix A. |
| 08:12 | Type open square bracket two space one semi colon five space seven close square bracket |
| 08:21 | Press Enter. |
| 08:22 | For the next prompt, |
| 08:24 | type open square bracket eleven semi colon thirteen close square bracket |
| 08:31 | Press Enter. |
| 08:33 | We provide the values of initial value vector by typing |
| 08:38 | open square bracket one semicolon one close square bracket . |
| 08:43 | Press Enter. |
| 08:45 | Then we specify the maximum number of iterations to be twenty five. |
| 08:50 | Press Enter. |
| 08:52 | Let us define 'tolerance level to be zero point zero zero zero zero one. |
| 08:58 | Press Enter. |
| 09:01 | Finally we call the function by typing |
| 09:04 | G a u s s S e i d e l open parenthesis A comma b comma x zero comma M a x I t e r comma t o l close parenthesis |
| 09:24 | Press Enter. |
| 09:26 | The values of x one and x two are displayed. |
| 09:30 | The number of iterations to solve the same problem are lesser than Jacobi method. |
| 09:37 | Solve this problem on your own using Jacobi and Gauss Seidel methods. |
| 09:43 | In this tutorial, we have learnt to: |
| 09:47 | Develop Scilab code for solving system of linear equations. |
| 09:52 | Find the value of the unknown variables of a system of linear equations. |
| 09:58 | Watch the video available at the following link. |
| 10:01 | It summarizes the Spoken Tutorial project. |
| 10:04 | If you do not have good bandwidth, you can download and watch it. |
| 10:09 | The spoken tutorial project Team |
| 10:11 | conducts workshops using spoken tutorials, |
| 10:15 | gives certificates to those who pass an online test. |
| 10:18 | For more details, please write to contact@spoken-tutorial.org . |
| 10:25 | Spoken Tutorial Project is a part of the Talk to a Teacher project. |
| 10:30 | It is supported by the National Mission on Eduction through ICT, MHRD, Government of India. |
| 10:37 | More information on this mission is available at http://spoken-tutorial.org/NMEICT-Intro. |
| 10:49 | This is Ashwini Patil. signing off. |
| 10:51 | Thank you for joining. |