OpenModelica/C2/OpenModelica-Connectors/English-timed

From Script | Spoken-Tutorial
Revision as of 11:11, 19 March 2018 by Jyotisolanki (Talk | contribs)

Jump to: navigation, search
Time Narration
00:01 Welcome to this spoken tutorial on OpenModelica Connectors.
00:06 In this tutorial, we will learn to: Create a new class , Open an existing class , Connect, different classes , Build a model and Simulate the model.
00:22 To record this tutorial, I am using OpenModelica version 1.11.0 and Ubuntu Linux OS 14.04
00:34 But, the process demonstrated in this tutorial is identical in other OS such as- Windows, Mac OS X or FOSSEE OS on ARM .
00:47 To practice this tutorial, you need to know about OMEdit. The Prerequisite tutorials are mentioned on our website.
00:57 RLC_Circuit file used in the tutorial is provided as a code file on our site.
01:04 Download the files from Code Files link.
01:09 I have already opened the OMEdit window.
01:13 Now we will discuss how to create a new model.
01:18 First we will create a new class. So go to the File menu and select New Modelica Class.
01:27 Create New Modelica Class window appears.
01:31 In the Name field, enter the name of the class which we want to create.
01:37 I will enter the name as Sample.
01:41 In the Specialization field, select the type of class you wish to create. I will choose Class.
01:50 Then click on OK.
01:53 A new class will be created with the given name.
01:57 We will learn more about classes in the upcoming tutorials.
02:02 Now we will save this class.
02:05 For this, right-click on Sample class and click on Save.
02:11 Choose an appropriate location to save this file.
02:15 Let's close the Sample file. Right-click on Sample and select Unload.
02:22 Click Yes in the confirmation dialog box that appears.
02:27 Now we shall learn how to open an existing class.
02:32 To open a class, go to the File menu. Then click on Open Model/Library File.
02:40 Select the desired file you wish to open.
02:44 I will choose RLC_Circuit.mo file downloaded earlier from Code files.
02:52 Click on the Open button.
02:55 Now we will learn about Connectors.
02:59 A Connector is a way for one model to exchange information with another model.
03:07 Use of Connectors:
03:09 Connectors are used in: Connections , Communication ,Coupling between component and outside world.
03:17 Next, we will learn to connect classes.
03:20 For this, I will use RLC_Circuit file which we opened earlier.
03:28 RLC_Circuit is a Modelica package containing different classes.
03:34 Let’s expand the package.
03:37 Here we can see various classes,' namely, Ground, VoltageSource , Resistor , Capacitor and Inductor
03:49 and also a connector named Pin
03:53 We will learn more about classes and connectors in upcoming tutorials in this series.
04:00 This package also contains a circuit class.
04:05 Double-click on the circuit file and go to the Text view.
04:11 Here we can see that the class does not contain any code.
04:17 Now go to Diagram View.
04:20 Let us place all the blocks/components in the grid area.Then we will connect them.
04:29 Click on Resistor and drag and drop it into the grid space.
04:35 We get a message, Enter Component Name.
04:38 In the Name field, enter the component name as R and click OK.
04:47 Click on Inductor Drag and drop it into the grid space and place it next to the Resistor
04:56 Enter the component name as L and click OK.
05:02 Click on Capacitor Drag and drop it into the grid space and place it next to the Inductor
05:10 Enter the component name as C and click OK.
05:15 Next, click on VoltageSource and drag and drop it into the grid space.
05:22 Place it above the R, L and C which are placed in series.
05:28 Enter the component name as ACVoltage.
05:32 Note that, please do not put any space in the component name field.
05:38 It will give translation error at the time of simulation. Now click OK.
05:45 Next, click on Ground and drag and drop it into the grid space.
05:52 Place it below the R, L and C components in series.
05:57 Enter the component name as G and click OK.
06:02 Now we have all the required components to construct the RLC Circuit in series.
06:09 Let's connect these components.
06:12 Hover the mouse to the left part of component.
06:16 A pop up RLC underscore Circuit dot pin p appears.
06:22 This represents positive pin.
06:25 Similarly, the right part of component shows a pop up as RLC underscore Circuit dot pin n.
06:34 This represents negative pin.
06:37 Place the cursor over the negative pin of the Resistor.
06:42 We can see a '+' sign when the cursor is placed over n pin.
06:48 Click on the pin.
06:49 Hold and drag it to the p pin of the Inductor.
06:54 Click on Inductor's p pin and then release the cursor.
07:01 Next, we will connect n pin of the Inductor with the p pin of the Capacitor.
07:08 Click on the n pin of the Inductor.
07:11 Hold and drag it to the p pin of the Capacitor.
07:15 Click on the p pin of the Capacitor.
07:20 Now we have connected the Resistor, Inductor and Capacitor in series.
07:28 Next step is to provide the VoltageSource.
07:32 Click on the p pin of the Resistor.
07:36 Hold and drag it to the p pin of the VoltageSource.
07:42 Similarly, we will connect the n pin of the Capacitor with the n pin of the VoltageSource.
07:50 Click on the n pin of the Capacitor.
07:53 Hold and drag it to the n pin of the VoltageSource.
07:58 Click on the n pin and release the cursor.
08:03 Next step is to Ground the circuit.
08:07 Click on the n pin of the VoltageSource.
08:11 Hold and drag it to the Ground.
08:14 Note that Ground has got only one pin which is the p pin.
08:20 Click on it and release the cursor. Now the circuit is complete.
08:25 Pause the tutorial and check that your circuit looks like mine.
08:33 Press CTRL S to save the class.
08:37 Now we will check for the correctness of the class.
08:41 Click on Check All Models button.
08:45 Observe the Messages Browser.
08:49 It shows the number of equations and the number of variables.
08:53 Model will be ready to simulate if both of them are equal.
08:58 Click on the Simulate button. A new window appears.
09:03 This output window displays the success message.
09:09 Expand R and click on Ir to get the plot between Ir and time.
09:18 We will learn about Equations and Variables in the upcoming tutorials.
09:24 That's all for this tutorial. Let's summarize.
09:28 In this tutorial, we have learnt to, Create a new class , Open an existing class , Connect different classes , Build a Model and Simulate the Model .
09:43 As an assignment- Construct a RLC Circuit where: Resistor, Inductor and Capacitor are in parallel connection.
09:53 Use the same classes and connector available in the RLC_Circuit package.
10:01 This is the diagram of the circuit which needs to be constructed.
10:07 Watch the video available at the following link.http://spoken-tutorial.org/It summarizes the Spoken Tutorial project.
10:15 The Spoken Tutorial Project Team Conducts workshops using spoken tutorials ,Gives certificates to those who pass an online test. For more details, please write to us.
10:31 Please post your times queries in this forum.
10:34 The FOSSEE team coordinates coding of solved examples of popular books. We give honorarium and certificates for those who do this. For more details, please visit this site.
10:49 The FOSSEE team helps migrate commercial simulator labs to OpenModelica.We give honorarium and certificates for those who do this. For more details, please visit this site.
11:06 Spoken Tutorial and FOSSEE projects are funded by NMEICT, MHRD, Government of India.
11:15 This tutorial is contributed by Kaushik Datta and Priyam Nayak.

Thanks you for joining.

Contributors and Content Editors

Jyotisolanki, Sandhya.np14