Difference between revisions of "ESim/C4/eSim-interface-to-OpenModelica/English"
(Created page with " {| border="1" |- || '''Visual cue''' || '''Narration''' |- ||Show Slide: '''Title Slide''' || Welcome to the spoken tutorial on “'''eSim''' interface to '''OpenMode...") |
Nancyvarkey (Talk | contribs) |
||
Line 25: | Line 25: | ||
'''System Requirements''' | '''System Requirements''' | ||
− | || To record this tutorial, I am using*'''Ubuntu Operating system version 20.04''' | + | || To record this tutorial, I am using |
+ | *'''Ubuntu Operating system version 20.04''' | ||
*'''eSim version 2.2''' | *'''eSim version 2.2''' | ||
*'''OpenModelica version 1.19.2''' | *'''OpenModelica version 1.19.2''' | ||
Line 70: | Line 71: | ||
|| Let us now explore the '''Modelica Converter''' option in '''eSim'''. | || Let us now explore the '''Modelica Converter''' option in '''eSim'''. | ||
− | I have already opened the''' eSim''' software on my | + | I have already opened the''' eSim''' software on my '''Desktop'''. |
|- | |- | ||
|| Only narration. | || Only narration. | ||
Line 128: | Line 129: | ||
|- | |- | ||
|| Point to '''Browse Netlist '''button | || Point to '''Browse Netlist '''button | ||
− | || The '''Browse Netlist | + | || The '''Browse Netlist''' button is used to browse the '''netlist''' file. |
Note that the file is identified with the extension''' .cir.out''' | Note that the file is identified with the extension''' .cir.out''' | ||
Line 171: | Line 172: | ||
Click on '''Open''' | Click on '''Open''' | ||
− | || '''Modelica Converter '''needs to know the path of '''OpenModelica ''' | + | || '''Modelica Converter '''needs to know the path of '''OpenModelica executable'''. |
− | Now, let us browse to the '''OpenModelica''' | + | Now, let us browse to the '''OpenModelica executable''' location. |
In my case, it is located in''' /usr/bin.''' | In my case, it is located in''' /usr/bin.''' | ||
|- | |- | ||
|| Point to the text box next to the '''Browse OM '''button'''.''' | || Point to the text box next to the '''Browse OM '''button'''.''' | ||
− | || The directory of the '''OpenModelica’s ''' | + | || The directory of the '''OpenModelica’s executable''' file is loaded in the '''Browse OM''' textbox. |
|- | |- | ||
|| Only narration | || Only narration | ||
Line 187: | Line 188: | ||
|| Click on the '''Load OMEdit''' button. | || Click on the '''Load OMEdit''' button. | ||
− | '''OpenModelica Connection Editor '''is a GUI to run and edit the model. | + | '''OpenModelica Connection Editor '''is a GUI to '''run''' and edit the '''model'''. |
|- | |- | ||
|| On '''OMEdit - OpenModelica Connection Editor '''Window | || On '''OMEdit - OpenModelica Connection Editor '''Window | ||
− | Point to the '''BJT_Amplifier''' project under | + | Point to the '''BJT_Amplifier''' project under the '''Libraries panel''' on the left panel |
|| We see that '''OMEdit '''has been loaded. | || We see that '''OMEdit '''has been loaded. | ||
− | The '''BJT_Amplifier''' project is visible under | + | The '''BJT_Amplifier''' project is visible under the '''Libraries '''on the left panel. |
|- | |- | ||
|| Click on '''BJT_Amplifier ''' | || Click on '''BJT_Amplifier ''' | ||
− | || To open the project, double click on the''' BJT_Amplifier '''on the left panel | + | || To open the project, double click on the''' BJT_Amplifier '''on the left panel. |
|- | |- | ||
|| Only narration | || Only narration | ||
− | || We see the | + | || We see the plot window of '''BJT_Amplifier '''has opened. |
|- | |- | ||
|| | || | ||
Click on '''Simulate''' button in the top toolbar | Click on '''Simulate''' button in the top toolbar | ||
− | || Now, let us simulate the '''BJT_Amplifier '''project. | + | || Now, let us '''simulate''' the '''BJT_Amplifier '''project. |
Line 211: | Line 212: | ||
|- | |- | ||
|| Point to the '''Messages Browser '''panel | || Point to the '''Messages Browser '''panel | ||
− | | | We can see the circuit model is getting compiled. | + | | | We can see the '''circuit model''' is getting '''compiled'''. |
|- | |- | ||
|| Hovering over the '''output''' tab | || Hovering over the '''output''' tab | ||
Point to the message | Point to the message | ||
− | ||The model gets compiled successfully. | + | ||The '''model''' gets '''compiled''' successfully. |
− | We see''' The simulation finished successfully '''displayed in the | + | We see''' The simulation finished successfully '''displayed in the output tab. |
|- | |- | ||
|| Point to '''Variables''' panel. | || Point to '''Variables''' panel. | ||
Line 235: | Line 236: | ||
|- | |- | ||
|| Click on '''der(v) '''checkbox | || Click on '''der(v) '''checkbox | ||
− | || Click on the '''der(v)''' checkbox to plot the graph of the '''derivative of | + | || Click on the '''der(v)''' checkbox to plot the graph of the '''derivative of Voltage.''' |
|- | |- | ||
|| Point to '''plot''' window | || Point to '''plot''' window | ||
Line 273: | Line 274: | ||
||We can plot the graphs of all the plot variables in the same way. | ||We can plot the graphs of all the plot variables in the same way. | ||
− | With this, we have successfully simulated a project by interfacing '''OpenModelica''' to '''eSim.''' | + | With this, we have successfully '''simulated''' a project by interfacing '''OpenModelica''' to '''eSim.''' |
|- | |- | ||
||Show Slide: | ||Show Slide: | ||
Line 282: | Line 283: | ||
In this tutorial, we have | In this tutorial, we have | ||
*Added a '''netlist '''file in''' Modelica Converter''' in '''eSim''' | *Added a '''netlist '''file in''' Modelica Converter''' in '''eSim''' | ||
− | *Converted the '''Ngspice | + | *Converted the '''Ngspice netlist''' to '''Modelica model''' |
*Loaded '''OMEdit '''from''' eSim''' | *Loaded '''OMEdit '''from''' eSim''' | ||
|- | |- | ||
Line 290: | Line 291: | ||
|| As an assignment, please do the following: | || As an assignment, please do the following: | ||
*Load the '''BJT_Biascircuit '''project in '''eSim''' | *Load the '''BJT_Biascircuit '''project in '''eSim''' | ||
− | *'''BJT_Biascircuit '''project is available in the | + | *'''BJT_Biascircuit '''project is available in the '''Code file''' link |
*Click on the '''BJT_Biascircuit '''on the right panel | *Click on the '''BJT_Biascircuit '''on the right panel | ||
*Click on the '''Modelica Converter.''' | *Click on the '''Modelica Converter.''' | ||
Line 296: | Line 297: | ||
*Click on the '''Convert''' option. | *Click on the '''Convert''' option. | ||
*Click on the '''Browse OM''' option | *Click on the '''Browse OM''' option | ||
− | *Browse to the path of the '''OpenModelica ''' | + | *Browse to the path of the '''OpenModelica executable''' |
*Check the path loaded in the textbox | *Check the path loaded in the textbox | ||
*Click on the '''Load OMEdit''' option | *Click on the '''Load OMEdit''' option | ||
− | *Simulate the model from the '''OMEdit''' interface | + | *'''Simulate''' the '''model''' from the '''OMEdit''' interface |
|- | |- |
Latest revision as of 15:50, 11 January 2023
Visual cue | Narration |
Show Slide:
Title Slide |
Welcome to the spoken tutorial on “eSim interface to OpenModelica”. |
Show Slide:
Learning Objectives |
In this tutorial, we will learn to
|
Show Slide:
System Requirements |
To record this tutorial, I am using
The process demonstrated in this tutorial is similar in Windows OS also. |
Show Slide:
Pre-requisites |
To follow this tutorial,
|
Show Slide:
Code Files |
|
Show Slide:
OpenModelica with eSim |
|
Show Slide:
About Modelica Converter: |
|
Open eSim | Let us now explore the Modelica Converter option in eSim.
I have already opened the eSim software on my Desktop. |
Only narration. | In this tutorial, we will see the plotting of curves in OpenModelica from eSim.
For that, let us look at the BJT_amplifier example project. I have downloaded the BJT_amplifier project files from the Code File link. Let us open the BJT_amplifier project in eSim. |
Click on the Open Project button on the top left corner | Click on the Open Project button on the eSim top toolbar. |
Double-click on the Downloads folder
|
Now, locate the Downloads folder and select the BJT_amplifier folder. |
Click on the Open | Click on the Open button at the top. |
Point to the BJT_amplifier project in the Projects Panel | Now the BJT_amplifier project appears under the Projects on the left panel.
The BJT_amplifier is a voltage divider amplifier using BJT. When input is given, it amplifies the input by a certain gain as output. |
Click on the BJT_Amplifier project in the Projects Panel | First of all, let us select the BJT_Amplifier project. |
Only narration | Next, we will see how to interface OpenModelica with eSim. |
Click on Modelica Converter icon | So, navigate to the left toolbar and click on the Modelica Converter icon.
The Modelica-1 window opens on the right panel. |
Only narration | Now let us look at the features of the window. |
Point to the netlist directory textbox | The textbox on the top displays the path to the netlist of the selected project.
Currently, it is showing the netlist of the BJT_amplifier project. |
Hover over Browse Netlist, Convert, Load OMEdit and Browse OM | The Modelica-1 window has four buttons on the right side:
|
Point to Browse Netlist button | The Browse Netlist button is used to browse the netlist file.
Note that the file is identified with the extension .cir.out |
Only narration | We can see that the BJT_amplifier.cir.out file is loaded in the Browse Netlist textbox.
We know that OpenModelica runs the Modelica model file. |
Click on the Convert button | Now let us convert the BJT_amplifier.cir.out Ngspice netlist to the Modelica model file.
To do so, click on the Convert button. |
Point to eSim dialog box
|
A pop-up window shows that Ngspice netlist gets converted to OpenModelica netlist.
Click on OK. |
Only narration | Next we will see how to load OMEdit from eSim.
So we have to link OpenModelica with eSim. |
Point to the Browse OM button
|
Make sure that OpenModelica is already installed in your system.
|
Browse to /usr/bin folder
Click on Open |
Modelica Converter needs to know the path of OpenModelica executable.
Now, let us browse to the OpenModelica executable location. In my case, it is located in /usr/bin. |
Point to the text box next to the Browse OM button. | The directory of the OpenModelica’s executable file is loaded in the Browse OM textbox. |
Only narration | Now, let us load the OpenModelica Connection Editor. |
Click on the Load OMEdit button | Click on the Load OMEdit button.
OpenModelica Connection Editor is a GUI to run and edit the model. |
On OMEdit - OpenModelica Connection Editor Window
Point to the BJT_Amplifier project under the Libraries panel on the left panel |
We see that OMEdit has been loaded.
The BJT_Amplifier project is visible under the Libraries on the left panel. |
Click on BJT_Amplifier | To open the project, double click on the BJT_Amplifier on the left panel. |
Only narration | We see the plot window of BJT_Amplifier has opened. |
Click on Simulate button in the top toolbar |
Now, let us simulate the BJT_Amplifier project.
|
Point to the Messages Browser panel | We can see the circuit model is getting compiled. |
Hovering over the output tab
Point to the message |
The model gets compiled successfully.
We see The simulation finished successfully displayed in the output tab. |
Point to Variables panel. | Now, the variable plots are visible under the Variables panel on the right side.
We can trace the graph of the required plots on the gridded Plot window by selecting it. |
Click on c1 | Click on c1. |
Click on the C checkbox | To plot the graph of Capacitor value C, let us click on the checkbox. |
Point to plot window | We see the Capacitor value is constant throughout. |
Click on der(v) checkbox | Click on the der(v) checkbox to plot the graph of the derivative of Voltage. |
Point to plot window | We see the derivative of Voltage is increasing exponentially.
To see the other plots, we need to remove the der(v) plot. Uncheck the der(v) checkbox to remove the derivative of Voltage plot. |
Click on i checkbox | Click on the i checkbox to plot the graph of the current. |
Point to plot window | We see the current plot is increasing exponentially.
Uncheck the i checkbox to remove the current plot. |
Hover over the textbox value of Capacitance C | We can even change the parameters and re-simulate the model. |
Click on the textbox next to C and type 10e-05 | So, let us edit and set the Capacitance C value to 10e-05. |
Click on Re-simulate button in the top toolbar
Highlight the message in Output tab |
Now, let us re-simulate theBJT_Amplifier project.
In the top toolbar, click on the Re-simulate button with a green right arrow icon. We see The simulation finished successfully displayed in the output tab. |
Hover over the plot | We see that the capacitance C value has changed in the plot. |
Only narration | We can plot the graphs of all the plot variables in the same way.
With this, we have successfully simulated a project by interfacing OpenModelica to eSim. |
Show Slide:
Summary |
This brings us to the end of the tutorial. Let us summarize.
In this tutorial, we have
|
Show Slide:
Assignment |
As an assignment, please do the following:
|
Show Slide:
About Spoken Tutorial Project |
The video at the following link summarizes the Spoken Tutorial project.
Please download and watch it. |
Show Slide:
Spoken Tutorial Workshops |
The Spoken Tutorial Project team conducts workshops and gives certificates.
For more details, please write to us. |
Show Slide:
Answers for THIS Spoken Tutorial |
Please post your timed queries in this forum. |
Show Slide:
FOSSEE Forum |
For any general or technical questions on eSim, visit the FOSSEE forum and post your question. |
Show Slide:
Circuit Simulation Project |
The FOSSEE team coordinates the Circuit Simulation Project.
For more details, please visit this site. |
Show Slide:
Textbook Companion Project |
The FOSSEE team coordinates the TextBook Companion Project.
For more details, please visit this site. |
Show Slide:
Lab Migration |
The FOSSEE team coordinates the Lab Migration Project.
For more details, please visit this site. |
Show Slide: Acknowledgement | Spoken Tutorial Project is funded by theMinistry of Education, Government of India. |
Show Slide: Thank you | This is Harisankar a FOSSEE summer fellow 2022, IIT Bombay signing off.
Thanks for joining. |