OpenModelica/C2/Functions-and-Types/Khasi

From Script | Spoken-Tutorial
Jump to: navigation, search
Time Narration
00:01 Ngi pdiang sngewbha sha ka spoken tutorial ha ka Functions and Types.
00:06 Ha kane ka jinghikai, ngin ia pule: Kumno ban define ka function.
00:12 Kumno ban pyndonkma ka algorithm. Kumno ban define ka type.
00:17 Ban record kane ka jinghikai, nga pyndonkam OpenModelica 1.9.2 bad Ubuntu operating system version 14.04
00:27 Tangba, kane ka rukom ka iasyriem ha Windows, ”Mac OS X” lane FOSSEE OS.
00:35 Ban sngewthuh kane ka jinghikai phi donkam ban tip kumno ban define ka class ha Modelica.
00:41 Phi donkam ka jingtip jong ki functions ha kano kano ka programming language.
00:46 Ki jinghikai pre-requisite lah dep batai ha ka website ka jong ngi. Sngewbha sa pule ia ki.
00:52 To ngin ia kren ia ka function mynta.
00:55 function ka dei ka class kaba kyrpang ba lah ban shim ki input bad return output.
01:01 Ka don ki algorithm section.
01:04 Ka function kam lah ban don ki equations bad kam lah ban simulate.
01:10 Ka syntax jong ka “function”kadei kumba la pyni.
01:15 Mynta to ngin ia thoh ka function ba kyrteng polynomialEvaluator kaba shim x kum ka input bad kan return f(x) = a x (squared) (plus) b x (plus) c ha kaba a=1, b=2 bad c=1 kum ka output.
01:36 polynomialEvaluator file lah ban ioh na ka website ka jong ngi.
01:40 Sngewbha download bad save baroh ki files ba lah ban ioh na Code Files link.
01:46 Ban pyni polynomialEvaluator function, to ngan leit sha OMEdit.
01:52 OMEdit mynta ka lah plié ha Welcome prespective.
01:56 Phi lah iohi tang ka liang jong ka OMEdit window naduh ba nga lah zoomed hapoh.
02:02 Ngan pyni ia phi ka jaka kaba kham biang da kaba kynriah ka window lada donkam.
02:09 Ban plie ka files kaba phi lah dep download, klik ha Open Model/Library File tool.
02:16 Nga lah dep save baroh ki files ha ka folder.
02:19 To ngan jied lang ia ki bad klik ha open.
02:24 Lada ngi lah dep save kine ki file ha ki folder kiba pher, phi lah ban plié man la kawei la ka jong.
02:31

Kynmaw ba kine harum classes lane functions mynta lah plié ha OMEdit: bouncingBallWithUserTypes , functionTester ,multipleFunctionTester, multiplePolynomialEvaluator bad polynomialEvaluator.

02:51 Ban plie polynomialEvaluator function bad view iaka, Right-klik hau icon ha Libraries Browser bad jied View Class.
03:02 Lada ka function ka plie ha ka Text View, plie ia ka ha ka Text View.
03:08 Ka kyrteng jong kane ka function ka dei polynomialEvaluator kumba ngi lah dep ia kren.
03:14 x u dei u real variable.
03:17 input ka dei ka keyword kaba pyndonkam ban kdew input variables.
03:22 Kumjuh ruh, output ka dei ka keyword kaba dei ban kdew output variables.
03:28 “fx” udei u real variable uba ieng ia u f(x).
03:33 Uno uno u variable lane parameter ubym dei u input lane output la kdew da kaba pyndonkam protected.
03:42 a u dei real parameter bad u value jong u udei 1.
03:47 Ki values jong u a, b bad c lah dep iakren lypa ha ki slides.
03:53 Sngewbha kynmaw ba a, b bad c kidei ki “protected” parameters.
03:59 Algorithm ki ieng na ka bynta ka jing sdang jong ka algorithm section jong ka function.
04:05 Algorithm section ka lah ban don ki assignment tang ki statements.
04:10 Kane ka sign ka kdew ia ka assignment.
04:14 Haka assignment statement ka value jong ka liang kamon la assigned sha ka liang jong ka liang kadiang.
04:20 Ka liang kadiang kumba ka dei ka expression ka bym tip.
04:25 Ha kane ka case fx udei u variable bym tip.
04:29 Ka value jong ka expression sha ka liang kadiang hangne lah ban khein lada u value jong u x ym tip.
04:36 x u kumba u long u pass ka input kum argument sha u function haba u lah shah khot.
04:43 Mynta to ngin ia peit kumno ban call ia ka function da kaba pyndonkam function Tester class.
04:49 function Tester icon lah dep iohi lypa ha ka Libraries Browser namar nga lah dep plié lypa ia ka.
04:56 Ban plié ia kane class, klik arsien ha une u icon.
05:01 Kane ka dei kawei na ka rukom ban peit ia ka “class”.
05:05 Phi lah ruh ban right klik ha u icon bad jied View Class.
05:11 “z” u dei u “real” variable.
05:14 polynomialEvaluator function lah khot bad ka input argument jong 10 units bad la equated shaz.
05:23 Ka input value(varaible) jong u polynomialEvaluator kata ka dei x u shim ia ka value jong 10 units.
05:31 Mynta to ngin ia simulate kane ka class.
05:34 Ban simulate kane ka class phi lah ban right klik ha functionTester icon ha Library Browser bad jied Simulate.
05:45 Ka class mynta lah dep simulate.
05:47 Phi lah ruh ban pyndonkam ka Simulate button ha ka toolbar ban simulate ka class.
05:53 Mynta to ngan pyni ia phi ka Plotting prespective da kaba kynriah lut sha ka OMEdit wondow sha ka kadiang.
06:00 Jied z ha ka variables browser
06:04 Kymnaw ba ka value jong u z u equal sha u value jong f(x) ha x = 10.
06:12 Mynta to ngan nym jied z bad delete kane ka result.
06:18 To ngan leit phai biang sha ka Modeling prespective.
06:21 Klik ha polynomialEvaluator tab ba sha jrong.
06:25 Kynmaw ba ka polynomialEvaluator function ka don tang kawei ka output variable.
06:31 Mynta to ngan pyni ia phi kumno ban output ar lane bun ki variables da kaba pyndonkam ka function.
06:38 Nga lah dep shna ka function ba kyrteng multiplePolynomialEvaluator kaba don artylli ki output variables.
06:45 Before viewing that function let me close the tabs of PolynomialEvaluator and FunctionTester.

Shuwa ban peit kitei ki “function” to ngan khang ka tab jong “PolynomialEvaluator” bad “Function Tester”.

06:54 Namar ka Libraries Browser kam da paw, to ngan shift ia ka window sha ka kamon.
07:01 Klik arsien ha multiplePolynomialEvaluator, multipleFunctionTester bad bouncingBallWithUserTypes.
07:11 Shift biang ia ka window sha ka jaka ba dei.
07:15 Leit sha multiplePolynomialEvaluator tab.
07:19 Kane ka function ka iasyriem bad ka polynomialEvaluator function lait noh na ka bynta ka additional output variable.
07:27 An output variable name gx has been declared.

Ka “output” variable ka kyrteng “gx” lah dep declare.

07:32 gx la assigned u value jong a x (squared) (minus) b x (plus) c
07:38 Ka order ha kaba ka output lane input variables ba lah declare ki long kongsan.
07:45 Ngin sa ia sngewthuh kham bun shapang kane ynda ngi ia kren multipleFunctionTester class.
07:51 Mynta to ngan phai sha ka multipleFunctionTester tab.
07:56 y bad z la declare kum real variables.
08:01 multiplePolynomialEvaluator function la khot bad ka input argument jong 10 units.
08:08 Kane kamut ba ka input variable jong multiplePolynomialEvaluator ka shim ia ka value jong 10 units.
08:17 y bad z ka shim i aka value jong f(x) bad g(x) ha x=10 kumjuh ruh.
08:26 y ka shim ia ka value jong ka output variable fx namar kane ka declaration jong fx ka paw shuwa ka declaration jong gx ha ka function.
08:37 Mynta to ngan simulate kane ka class.
08:40 Klik ha Simulate button. Khang i aka pop up window.
08:46 Jied y bad z ha ka variables browser.
08:51 Kynmaw baka values jong u y bad z ki dei kijuh kum f(x) bad g(x) ha x=10 kumjuh ruh.
09:01 Delete ka result bad phai biang sha Modeling Prespective.
09:06 Mynta, to ngan pynkylla ka order jong u y bad z.
09:11 Delete (y,z) bad type (z,y).
09:17 Bad save kane ka class da kaba press Ctrl + S.
09:22 Simulate ia kane ka class sa shisien. Khang ia ka pop up window.
09:28 Jied y bad z ha ka variables browser sa shisien.
09:33 Kynmaw b aka values jong u y bad z lah dep pynkylla kum ban ia nujor bad ka case kaba lah dep.
09:41 To ngan delete kane ka result bad phai biang sha Modeling Prespective.
09:47 To ngan leit phai biang sha ki slides.
09:50 algorithm ka dei ka Modelica syntax element ban pynlong ka procedural programming.
09:56 Tang assignment statement la shah ha ka algorithm section.
10:01 Assignment statements ka pyndonkam ki symbol harum.
10:06 Data flow ha ka assigment statements na ka kamon sha ka kadiang.
10:10 Ki don khyndiat ki jing pyrkhing ha ki functions ba define ha Modelica.
10:16 Ka jing Pyndonkam ka der() ha ka function ka long invalid. Pyndonkam jong ka time variables kam lah ban shah.
10:23 Ka jing pyndonkam jong u when statement kam shah ha kane ka function.
10:28 ka function ka lah ban don bun ban ia ka wei ka jaka jong ka algorithm bad Models kam lah ban pass kum ka arguments.
10:36 type ka dei ka class kaba kyrpang ban define custom data-type ha Modelica.
10:42 Kum ka nuksa, physical quantities kum velocity bad current lah ban define kum data-types.
10:50 Ki lah ban pyndonkam hadien ban declare ia kiwei ki variables.
10:54 Attributes jong ka Modelica data-type kum unit, bad start lah ban pynkylla kumba ka dei.
11:01 Kum ka nuksa, ha ka case ba haneng velocity lah define ba kan dei kajuh kum ka real data type.
11:08 Tangba ka unit la modify sha m/s.
11:12 Nga lah dep shna ka model ba kyrteng bouncingBallWithUserTypes sha ka rukom simulate definition.
11:19 To ngan leit phai biang sha ka OMEdit ban demonstrate kane ka model.
11:24 Klik ha ka bouncingBallWithUserTypes tab.
11:28 Kane ka model ka iasyriem bad ka bouncingBall model kumba ngi lah ia kren ha ka jinghikai kaba lah dep.
11:35 Sngewbha pule lyngba sha ka jinghikai per-requisite ban sngewthuh bouncingBall model.
11:41 Length la define kum ka Real datatype. Bad ka unit ba lh modified sha m.
11:47 Kumjuh ruh Velocity la define kum Real bad ka unit la modofied sha m/s.
11:54 h ka ieng ia ka jing jrong jong ka ball na sla pyrthei.
11:58 La define kum length datatype.
12:02 Kumjuh ruh v ka ieng ia ka velocity jong ka ball.
12:05 La declare ba kan dei ka velocity datatype.
12:09 Ki variable declaration ba sah bad ki equations jong kane ka model ki iasyriem bad bouncingBall model.
12:18 Mynta to ngan simulate kane. Khang ia ka pop up window.
12:24 Ha ka Variables Browser kynmaw ba u h bad v ki don la ki units ba iadei bad ki data-types.
12:34 To ngan jied h ha ka variables browser.
12:38 Ka plot h pyrshah time ka syrien ba kata jong ka bouncingBall model.
12:43 To ngan nym jied h.
12:46 Mynta to ngan leit phai biang sha ki slides.
12:49 Kum ka assignment leh ia ka jing pyrkhing ha functions bad peit i aka jingbakla ba pynmih.
12:56 Kane ka wanrah ia ngi sha kaba kut jong kane ka jinghikai.
12:59 Peit i aka video ba lah ban ioh na ka link harum. http://spoken-tutorial.org/ http://spoken-tutorial.org] /What\_is\_a\_Spoken\_Tutorial ka batai kyllum ia ka Spoken Tutorial project
13:05 Ngi pynlong ki worksohop da kab pyndonkam ka spoken tutorials sngewbha phone sha ngi.
13:10 Lada phi don kano kano ka jingkylli ha kane ka spoken tutorial, sngewbha wan jong i aka website.
13:15 Ngi coordinate codeing jong ki nuksa ba lah dep khein jong ki kot kiba paw. Sngewbha wan jngoh sha ka website ban tip kham bun.
13:23 Ngi iarap ban migrate ki commercial simulator labs sha OpenModelica.
13:29 Spoken Tutorial Projectla kyrshan da ka NMEICT, MHRD, sorkar India.
13:36 Ngi ai khublei ia ka kynhun jong ki nongshana jong ka OpenModelica ka jign kyrshan ka jong ki.

Ma nga I John Nongkynrih. Khublei shibun.

Contributors and Content Editors

John123, Mousumi