Difference between revisions of "OpenModelica/C2/Arrays-in-Modelica/Khasi"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with "Editing OpenModelica/C2/Arrays-in-Modelica/English-timed {| border=1 ||''' Time ''' ||'''Narration''' |- || 00:01 || Ngi pdiang sngewbha sha ka spoken tutorial ha '''Arrays'...")
 
Line 126: Line 126:
 
|-
 
|-
 
|| 04:13
 
|| 04:13
||Open it in '''Text View'''.
+
||Plie i aka ha '''Text View'''.
Plié i aka ha “Text View”.
+
 
|-
 
|-
 
|| 04:16
 
|| 04:16
||This class is similar to the '''functionTester''' class discussed in previous tutorial.
+
||Kane ka class ka iasyriem bad ka '''functionTester''' class kumba lah iakren ha ka jinghikai ba lah dep.
Kane ka class ka iasyriem bad ka “functionTester” class kumba lah iakren ha ka jinghikai ba lah dep.
+
 
|-
 
|-
 
|| 04:24
 
|| 04:24
|| '''z''' is a Real variable.
+
|| '''z'''u dei u Real variable.
“z” u dei u Real variable.
+
 
|-
 
|-
 
|| 04:27
 
|| 04:27
|| '''polynomialEvaluatorUsingVectors''' function is called with an '''input''' argument of '''10''' units.
+
|| '''polynomialEvaluatorUsingVectors'''function la khot bad ka '''input''' argument jong '''10''' units.
“polynomialEvaluatorUsingVectors” function la khot bad ka “input” argument jong “10” units.
+
 
|-
 
|-
 
|| 04:35
 
|| 04:35
|| The value returned by this function is equated to '''z'''.
+
|| Ka value la returned da kane ka function la equated sha u '''z'''.
Ka value la returned da kane ka function la equated sha u “z”.
+
 
|-
 
|-
 
|| 04:40
 
|| 04:40
||Now let me Simulate this class.
+
||Mynta to ngan Simulate kane ka class.
Mynta to ngan Simulate kane ka class.
+
 
|-
 
|-
 
|| 04:43
 
|| 04:43
|| Click on '''Simulate''' button.
+
|| Klik ha '''Simulate''' button.
Klik ha “Simulate” button.
+
 
|-
 
|-
 
|| 04:46
 
|| 04:46
||Close the pop up window.
+
||Khang iaka pop up window.
Khang iaka pop up window.
+
 
|-
 
|-
 
|04:49
 
|04:49
|| Select '''z''' in the '''variables''' browser.
+
|| Jied '''z''' ha ka '''variables''' browser.
Jied “z” ha ka “variables” browser.
+
 
|-
 
|-
 
|| 04:53
 
|| 04:53
||Note that the value of '''z''' is equal to '''f(x)''' at '''x = 10'''.
+
||Kynmaw b aka value jong u '''z''' u equal sha u '''f(x)''' ha '''x = 10'''.
Kynmaw b aka value jong u “z” u equal sha u “f(x)” ha “x=10”.
+
 
|-
 
|-
 
|| 05:00
 
|| 05:00
||This plot is the same as observed in the case of '''polynomialEvaluator''' function.
+
||Kane ka plot ka dei kajuh kumba kumba ngi lah ia khmih ha ka case jong ka '''polynomialEvaluator''' function.
Kane ka plot ka dei kajuh kumba kumba ngi lah ia khmih ha ka case jong ka “polynomialEvaluator” function.
+
 
|-
 
|-
 
|| 05:07
 
|| 05:07
||Now let me de-select '''z''' and delete the result.
+
||Mynta to ngan nym jied '''z''' bad delete i aka result.
Mynta to ngan nym jied “z” bad delete i aka result.
+
 
|-
 
|-
 
|| 05:13
 
|| 05:13

Revision as of 13:54, 5 June 2018

Editing OpenModelica/C2/Arrays-in-Modelica/English-timed

Time Narration
00:01 Ngi pdiang sngewbha sha ka spoken tutorial ha Arrays.
00:05 Ha kane ka jinghikai, ngin ia pule: kumno ban declare array variables, kumno ban shna arrays, kumno ban pyndonkam for bad while loops bad kumno ban pyndonkma OMShell.
00:20 Ban record kane ka jinghikai, nga pyndonkam: OpenModelica 1.9.2
00:26 Phi lah ban pyndonkam kino kino ki operating system harum ban practice kane ka jinghikai.
00:32 Ban sngewthuh bad practice kane ka jinghikai: phi donkam ka jingsngewthuh jong arrays ha kano kano ka program.
00:40 Phi donkam ban tip kumno ban define ka class ha Modelica. Ka jinghikai Prerequisite lah kdew ha ka website jong ngi. Sngewbha sa pule ia ki.
00:50 Vector ka dei ka one dimensional array.
00:53 Ka don kawei ka index.
00:55 Syntax na kabynta ka vector declaration lah pyni harum.
00:50 Ka nuksa ba lah pyni ka declare ia u variable a ha kaba ka size ka dei 2.
01:05 U vector lah banshna da kaba kynthup ia ki elements ha ki curly braces.
01:11 Kane ka nuksa ka define ia u vector parameter a bad 2 bad 3 kum ki elements.
01:19 Ban access ki elements jong u vector, ka long kaba donkam ban sngewthuh indexing.
01:25 Syntax na ka bynta vector indexing kumba lah pyni.
01:29 Vector indexing ka sdang naduh 1 bad Indices ka dei ban dei integers.
01:35 To ngin ia shna ka function ba kyrteng polynomialEvaluatorUsingVectors.
01:41 Kane ka function ka dei ka extension jong polynomialEvaluator function kaba ngi lah ia kren ha ki jinghikai ba hashuwa.
01:49 Ngin ia bujli ki parameters a,b' bad c jong polynomialEvaluator bad u vecotr a.
01:58 Sngwebha download bad kave baroh ka files ba lah ban ioh n aka link Code Files jong ngi.
02:05 Na ka bynta ka jing suk ka jong ngi, polynomialEvaluator function lah ruh ban ioh.
02:12 Mynta to ngin ia phai sha OMEdit ban pyni kane ka function.
02:17 OMEdit ka lah plié mynta ha ka Welcome prespective.
02:21 Nga lah dep plié baroh ki files kiba donkam.
02:25 Kynmaw ba ki classes harum lane ka functions mynta ki lah plié ha ka OMEdit: functionTester, matrixAdder, polynomialEvaluator bad polynomialEvaluatorUsingVectors.
02:42 Mynta, ban view ia ki to ngan clik arsien ha man la ki icon.
02:49 To ngan phai sha ka OMEdit window sha ka liang kadiang n aka bynta ka jing I kaba biang.
02:56 Leit sha polynomialEvaluator tab..
03:00 Plie ia ka ha Text View.
03:03 Na ka bynta ka jingtip ba kham bun ha kane ka function, peit i aka jinghikai kaba lah dep.
03:09 To ngan leit sha polynomialEvaluatorUsingVectors. Plie i aka ha Text View.
03:16 Input bad output variables ki dei ki juh kum ha ka polynomialEvaluator function.
03:23 Parameters a,bbad c jong polynomialEvaluator lad bujli bad ka vector a.
03:32 Size jong kane ka vector ka dei 3.
03:36 Ki elements jong kane ka vector la kynthup ha ki curly braces kumba lah pyni.
03:42 Ki elements lah pyniaphiah da u comma.
03:46 Ha ka assignment statement ka elements jong ka vector a la accessed da kaba pyndonkam ki indices jong ki.
03:54 a[1] u dei u element ba nygkong jong u vectora.
03:59 Kumjuh ruh, element baa r bad element b alai jong ka vector ala accessed ruh kumjuh.
04:08 Now, let me switch to functionTester tab.

Mynta, to ngan phai sha ka “functionTester” tab.

04:13 Plie i aka ha Text View.
04:16 Kane ka class ka iasyriem bad ka functionTester class kumba lah iakren ha ka jinghikai ba lah dep.
04:24 zu dei u Real variable.
04:27 polynomialEvaluatorUsingVectorsfunction la khot bad ka input argument jong 10 units.
04:35 Ka value la returned da kane ka function la equated sha u z.
04:40 Mynta to ngan Simulate kane ka class.
04:43 Klik ha Simulate button.
04:46 Khang iaka pop up window.
04:49 Jied z ha ka variables browser.
04:53 Kynmaw b aka value jong u z u equal sha u f(x) ha x = 10.
05:00 Kane ka plot ka dei kajuh kumba kumba ngi lah ia khmih ha ka case jong ka polynomialEvaluator function.
05:07 Mynta to ngan nym jied z bad delete i aka result.
05:13 Go back to Modeling perspective

Leit phai biang sha “Modeling prespective”

05:16 Now let me switch to the slides.

Mynta to ngan phai sha ki slides.

05:19 for loop is used to iterate statements a given number of times.

“for” loop la pyndonkam ban iterate ka statement jong u number ba ai ha ka por.

05:24 It can be used in algorithm and equation sections.

Lah ban pyndonkam ha ka “algorithm” bad “equation” sections.

05:29 Syntax for for loop is as shown with an example.

“Syntax” n aka bynta ka “for” loop ka dei kumba lah pyni ha ka nuksa.

05:34 To demonstrate how to use for loop let me go back to OMEdit.

Ban pyni kumno ban pyndonkam ka “for” loop to ngin ia phai biang sha ka “OMEdit”.

05:40 Click on polynomialEvaluatorUsingVectors tab.

Klik ha “polynomialEvaluatorUdingVectors” tab.

05:45 In the assignment statement for fx, we are accessing the elements of vector a.

Ha ka “assignment” statement n aka bynta ka “fx”, ngi lah access ia ki elements jong u vecotor “a”.

05:52 This can also be done using a for loop.

Kane lah ban leh da kaba pyndonkam ka “for” loop.

05:55 Now, let us see how to include a for loop in the algorithm section.

Mynta, to ngin ia peit kumno ban kynthup ka “for” loop ha ka “algorithm” section.

06:01 Firstly, Comment the assignment statement for fx by inserting double slash at the beginning and end.

Nyngkong eh, “Comment” ka assignment statement n aka bynta ka “fx” da kaba thep artylli ki slash ha kaba sdang bad kaba kut.

06:10 Save this function by pressing Ctrl+S.

Save kane ka function da kaba press “Ctrl+S”.

06:15 The for loop to be inserted has been provided in a text file named for-loop.txt.

Ka “for” loop ka ban thep ka lah pynbiang ha ka text file ba kyrteng “for-loop.txt”.

06:23 It is available on our website. I have opened this file using gedit.

Lah ban ioh n aka website ka jong ngi. Nga lah dep plié kane ka file da kaba pyndonkam “gedit”.

06:29 Windows users may use notepad or any other text editor to open it.

U nongpyndonkam ka Windows ruh u lah ban pyndonkam ka “notepad” lane kano kano ka text editor ban plié i aka .

06:35 Let me go to gedit.

To ngan leit sha ka “gedit”.

06:38 Copy all the statements by pressing Ctrl+C.

Copy baroh ka statements da kaba press “Ctrl+C”.

06:44 Go back to OMEdit

Leit phai biang sha ka “OMEdit”

06:46 Press Enter. Paste all the statements by pressing Ctrl + V.

Press “Enter”. Paste baroh ki statements da kaba press “Ctrl + V”.

06:53 Save this function by pressing Ctrl + S.

Save kane ka function da kaba press “Ctrl + S”.

06:57 Now, let me explain each statement of this loop.

Mynta, to ngan batai man la ka statement jong kane ka loop.

07:02 This statement assigns fx an initial value of zero before the loop starts.

Kane ka statement assigns “fx” kum ka initial value jong u zero shuwa b aka loop kan sdang.

07:09 Here, i serves as a loop counter.

Hangne, “i” ka trei kum ka loop counter.

07:12 The loop runs until value of i is 3.

Ka loop ka iaid haduh b aka value jong “i” udei u “3”.

07:16 It is not necessary to declare i before it is used.

Kam da long kaba donkam ban declare “i” shuwa ban pyndonkam i aka.

07:21 Let me scroll down a bit.

To ngan scroll i aka shapoh khyndiat.

07:24 This statement iteratively adds terms of the polynomial f(x).

Kane ka statement iteratively ka adds terms jogn ka polynomial “f(x)”.

07:30 Polynomial f(x) has been discussed while discussing polynomialEvaluator function.

Polynomial “f(x)” lah dep ia kren katba ngi dang ia kren “polynomialEvaluator” function.

07:37 This statement indicates the end of for loop.

Kane ka statement ka pyni ba kaba kut jong ka “for” loop.

07:41 Now, this function is complete.

Mynta, kane ka function ka lah dep.

07:44 To test this function let us use the class functionTester.

Ban test kane ka function to ngin ia pyndonkam ka class “functionTester”.

07:49 I have made no changes to this function to this class.

Ngam khlem leh kano kano ka jingkylla ha kane ka function jong kane ka “class”.

07:54 let me simulate this class by pressing Simulate button in the toolbar.

To ngan simulate kane ka class da kaba press “Simulate” button ha ka toolbar.

07:49 Select z in variables browser.

Jied “z” ha “variables browser”.

08:03 Note that the value of z remains the same after changes are made to the function.

Kynmaw b aka value jong u “z” u neh katjuh hadien ka jingkylla lah dep leh ha ka function.

08:10 Let me de-select z and delete the result.

To ngan nym jied “z” bad delete i aka result.

08:14 Go back to Modeling perspective

Leit phai boang sha “Modeling prespective”

08:17 Now let me go back to the slides once again.

Mynta to ngan leit phai biang sha ki slides sa shisien.

08:21 while loop is used to iterate statements until a given condition is satisfied.

“while” loop la pyndonkam ha ka oterate statements haduh b aka condition ba lah ai ka biang.

08:27 while loop cannot be used in equation section.

“while” loop kam lah ban pyndonkam ha ka “equation” section.

08:31 for loop is more frequently used in Modelica as compared to while.

“for” loop ka kham pyndonkam bha ha ka Modelica ban ia nujor bad ka “while”.

08:37 Let us discuss Arrays now.

To ngin ia kren i aka “Arrays” mynta.

08:40 Arrays are used to represent multi-dimensional data.

“Arrays” la pyndonkam ban ieng i aka “multi-dimensional” data.

08:44 They can be constructed using vector notation.

Ki lah ban shna da kaba pyndonkam “vector” notation.

08:48 Syntax for array declaration and indexing is as shown.

“Syntax” n aka bynta “array” declaration bad “indexing” ka dei kumba lah pyni.

08:55 To understated more about array construction and indexing.

Ban sngewthuh kham bun shaphang ka jingshna ka “array” bad “indexing”.

09:00 Let us write a class named matrixAdder which adds myMatrix and adder matrices to give mySum. myMatrix and adder matrices are as shown.

To ngin ia thoh ka “class” ba kyrteng “matrixAdder” kaba adds “myMatrix” bad “adder matrices” baa i “mySum”. “myMatrix” bad “adder matrices” kumba lah pyni.

09:14 Now, let me switch to OMEdit to demonstrate matrixAdder class.

Mynta, to ngan phai sha ka “OMEdit” ban pyni “matrixAdder” class.

09:19 It is already open in OMEdit.

Ka lah dep plié lypa ha “OMEdit”.

09:23 Click on matrixAdder tab.

Klik ha “matrixAdder” tab.

09:26 Open it in Text view.

Plié i aka ha “Text view”.

09:29 myMatrix is a Real parameter array.

“myMatrix” ka dei ka “Real” parameter array.

09:33 Numbers in square bracket represent size of this array.

Numbers ha ki brackets ba sawdong ka dei i aka size jong kane ka “array”.

09:39 The size of first dimension is 3.

Ka size jong ka dimension kaba nyngkong ka dei “3”.

09:42 Similarly, the size of second dimension is 2.

Kumjuh ruh, ka size jogn ka dimension kaba ark a dei “2”.

09:46 myMatrix array is constructed using three vectors of two elements each.

“myMatriz” array la shna da kaba pyndonkam lai tylli ki vectors jong artylli ki elements.

09:53 {1,2} represents the first vector.

“{1,2}” ka thew i aka ka vector ba nyngkong.

09:57 {3,4} is the second one and

“{3,4}” ka dei kaba ar bad

10:00 {5,6}} represents the third vector.

“{5,6}” ka thew i aka vector kaba lai.

10:04 Size of each of this vectors is equal to size of second dimension of this array.

Ka size jong man la kane ka vector ka equal i aka size kaba ar jong ka dimension jong kane ka array.

10:11 Hence, the size of second dimension of myMatrix is 2.

Na kata, ka size jong ka dimension kaba ar jong ka myMatrix ka dei “2”.

10:16 The number of vectors is equal to the size of first dimension. Hence, the size of first dimension is equal to 3.

Ka number jong ka vectors ka ia katjuh bad ka size jong ka dimension kaba nyngkong. Na kata, ka size jong ka dimension kaba nyngkong ka equal sha u “3”.

10:25 adder matrix is constructed in a similar fashion.

“adder” matrix la shna ha ka juh ka rukom.

10:29 To add this two arrays or matrices we need to access elements from two dimensions.

Ban add kine ki artylli ki array lane matrices ngi donkam ban access ki elements n aka two dimensions.

10:35 Hence a nested for loop is required.

Na kata “a” “nested for” loop ka donkam.

10:40 This for loop runs through the first dimension.

Kane ka “for” loop ka iaid lyngba ka dimension kaba nyngkong.

10:44 Similarly this for loop runs through the second dimension.

Kumjuh ruh kane ka “for” loop ka iaid lyngba ka dimension kaba ar.

10:49 Let me scroll down a bit.

To ngan scroll shapoh khyndiat.

10:52 Corresponding elements of myMatrix and adder matrices are added to yield mySum

Corresponding elements jong ka “myMatrix” bad “adder matrices” la pyndap ban pynmih “mySum”

11:00 This statements represent the end of each for loop. The class is now complete.

Kane ka statements ka thew ia kaba kut jong man ka “for” loop. Ka class mynta ka lah dep.

11:07 Let me simulate it by clicking on Simulate button.

To ngan simulate i aka da kaba klik ha “Simulate” button.

11:11 Close the pop up window if it appears.

Khang i aka pop up window lada ka paw.

11:15 Let me expand variables column.

To ngan pynheh i aka “variables” column.

11:18 Select adder[1,1], myMatrix[1,1], and mySum[1,1].

Jied “adder[1,1]”, “myMatrix[1.1]”, bad “mySum[1,1]”.

11:25 Note that adder[1,1] plus myMatrix[1,1] gives mySum[1,1] which means that the result is accurate.

Kynmaw b aka “adder[1,1]” plus “myMatrix[1,1]” ka ai “mySum[1,1]” kaba mut b aka result ka long accurate.

11:35 To ngan nym jied ia ki bad delete ia ka result.
11:40 To ngan leit phai biang sha ki slides.
11:43 Kum ka assignment: thoh ia ka function ba kyrteng “vectorReversal” ban reverse i aka order jong ki elements ha ka vector.
11:51 Kumjuh ruh thoh i aka function “matrisReversal” ban pynkylla ia ka order jong ki elements ha man la ki row jong ka matrix.
12:00 Thoh “functionTester” class ban test kine artylli ki functions.
12:05 Kane ka wanrah ia ngi sha kaba kut jong kane ka jing hikai.
12:09 Sngewbha peit ia ka video ba lah ban ioh n aka link harum: org /What\_is\_a\_Spoken\_Tutorial ka batai kyllum ia ka Spoken Tutorial project.
12:15 Ngi pynlong ki workshop da kaba pyndonkam ka spoken tutorials. Ka ai certificates. Sngewbha thoh sha ngi.
12:21 Lada phi don ka jong kylli kaba iadei bad kane ka spoken tutorial, sngewbha wan jngoh sha ka website harum.
12:28 Ngin lum ki coding jong ka nuksa ba lah dep leh jong ki kot kiba pawnam.
12:33 Ngi ai honorarium bad certificates ia kito kiba leh ia kane. Sngewbha wan jngoh ha ka website ba harum.
12:39 Ngi iarap ban migrate commercial simulator labs sha OpenModelica. Sngewbha wan jngoh ia ka website bah arum na ka bynta ka jingtip ba kham bun.
12:48 Spoken Tutorial Project la kyrshan da ka NMEICT, MHRD, jong ka Sorkar India.
12:55 Ngi ai khublei ia ka kynhun kaba shna jong ka “OpenModelica” ka jing kyrshan ka jong ki
13:00 khublei ba lah iasnoh lang ha kane ka jing hikai Ma nga I John Nongkynrih.

Contributors and Content Editors

John123, Mousumi