Difference between revisions of "OpenModelica"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with "'''OpenModelica''' is an open source modelling and simulation environment intended for industrial and academic usage.It is an object oriented declarative multi domain modellin...")
 
 
(5 intermediate revisions by 3 users not shown)
Line 5: Line 5:
 
This environment can be used to work for both steady state as well as dynamic systems. Attractive strategy when dealing with design and optimization problems. As all the equations are solved simultaneously it doesn't matter whether the unknown variable in an input or output variable.
 
This environment can be used to work for both steady state as well as dynamic systems. Attractive strategy when dealing with design and optimization problems. As all the equations are solved simultaneously it doesn't matter whether the unknown variable in an input or output variable.
  
 +
The Spoken Tutorial Effort for OpenModelica was contributed by Bhargava Nemmaru from the Spoken Tutorial Project and is supported by Rahul Jain, Kaushik Datta, Rahul Nagraj (intern) and Jayaram Ganesh (intern) from IIT Bombay.
 +
 +
'''Learners''': Chemical Engg students to learn how to do energy balance
  
 
__TOC__
 
__TOC__
Line 12: Line 15:
 
==Basic Level==
 
==Basic Level==
  
1. '''Developing an equation-based model'''
+
1. '''Overview of OpenModelica'''
  
* Introduction to OMEdit
+
* Introduction to Modeling and Simulation
* Declaration of variables and equations
+
* What is OpenModelica
* Simulation of a model in OMEdit
+
* Subsystems of OpenModelica Environment
* Changing simulation conditions using Simulation Setup toolbox
+
* Features of OpenModelica
 +
* Spoken Tutorials available on OpenModelica
 +
* Timed discussion forum
 +
* About Spoken Tutorial project
 +
* Textbook companions for OpenModelica
 +
* Lab migration for OpenModelica
  
2. '''Control flow and Event handling'''
+
2. '''Introduction to OMEdit'''
  
* Using if-else statement in Modelica
+
* What is OpenModelica
 +
* What is OMEdit
 +
* Perspectives in OMEdit
 +
* Browsers in OMEdit
 +
* View icons in OMEdit
 +
* Open a Class from Libraries Browser
 +
* Using Thermal library
 +
* Using HeatTransfer library
 +
* Checking for correctness of the model
 +
* Using Simulate button
 +
* Plotting using conduction variable
 +
* Using Re-simulate button
 +
* Using Simulation Setup
 +
* Specifying Stop Time
 +
* Using New Parametric Plot Window
 +
* How to delete results
 +
 
 +
3. '''Examples through OMEdit'''
 +
 
 +
* Using Modelica library
 +
* Using Electrical library
 +
* Using Analog library
 +
* Open Rectifier Class
 +
* Changes in input variable values
 +
* Compare the variables values
 +
* Plotting between different variables
 +
* Using Mechanics library
 +
* Using Multibody library
 +
* Open DoublePendulum class
 +
* Comparing input values
 +
* Plotting between time vs a_rel
 +
* Specifying Start Time and Stop Time
 +
* Changing Simulation interval
 +
 
 +
4. '''OpenModelica Connectors'''
 +
 
 +
* Creating new Modelica class
 +
* Open an existing class
 +
* Connectors
 +
* Use of Connectors
 +
* Adding Resistor, Inductor and Capacitor
 +
* Adding Voltage Source and Ground
 +
* Adding pin connector
 +
* Connection of different classes
 +
* Connecting through different pins
 +
* Plotting between input variables
 +
 
 +
5. '''Developing an equation-based model'''
 +
 
 +
* Defining different Perspectives
 +
* Defining Libraries Browser
 +
* Defining different View icons
 +
* Creating a new Modelica class
 +
* Variable and Parameter declaration
 +
* Defining Start and Unit attribute
 +
* Defining min and max attribute
 +
* Defining Comments
 +
* Declaration of equations
 +
* Using Simulation Setup button
 +
* Specifying Stop Time
 +
* Correcting errors in Messages browser
 +
 
 +
6. '''Control flow and Event handling'''
 +
 
 +
* Defining initial equation
 +
* Using if-else statement
 +
* Using Plotting perspective
 
* Handling time and state events
 
* Handling time and state events
* Using when statement in Modelica
+
* Defining reinit() function
 +
* Rectify the errors in Messages Browser
 +
* Using Simulate button
 +
* Using Simulation Setup option
 +
* Specifying Stop Time
 +
* Using when statement
  
3. '''Functions and Types'''
+
7. '''Functions and Types'''
  
* Defining a function in Modelica
+
* Defining a function
 +
* Defining Real variable
 +
* Defining Input and Output variable
 
* Using algorithm
 
* Using algorithm
* Defining custom types in Modelica
+
* Defining assignment statement
 +
* Restrictions on functions
 +
* Defining data types
  
4. '''Arrays in Modelica'''
+
8. '''Arrays in Modelica'''
  
* Declaring array variables in Modelica
+
* Defining Vector
 +
* Defining Vector Indexing
 +
* Declaring array variables
 +
* Using for loops
 +
* Using while loops
 
* Constructing arrays
 
* Constructing arrays
* Using for and while loops
+
* Using Nested for loop
  
5. '''Array Functions and Operations'''
+
9. '''Array Functions and Operations'''
  
 
* Using OMShell
 
* Using OMShell
* Using array construction functions in Modelica
+
* Using fill() functions
* Performing arithmetic operations on vectors and matrices
+
* Using zeros() and identity() function
* Using array conversion functions
+
* Performing arithmetic operations
 +
* Using min() and max() function
 +
* Using sum() and Product ()
 +
* Using abs() and Size () functions
 +
* Using ndims() function
  
 
==Intermediate Level==
 
==Intermediate Level==
  
  
6. '''Modelica Packages'''
+
10. '''Modelica Packages'''
  
* Creating a package of classes in Modelica
+
* Defining Package
* Reference classes in a package
+
* Defining Single file storage
* Importing classes in a package
+
* Creating a package of classes
 +
* Using Within statement
 
* Using Modelica library
 
* Using Modelica library
 +
* Reference classes in a package
 +
* Using Import statements
  
7. '''Annotations in Modelica'''
+
11. '''Annotations in Modelica'''
  
* Specifying model annotations in Modelica
+
* Using Annotations
 +
* Using experiment annotation
 +
* Using Simulation Setup button
 +
* Specifying model annotations
 +
* Applying Documentation annotation
 
* Defining a record
 
* Defining a record
  
8. '''Icon and Diagram Views'''
+
12. '''Icon and Diagram Views'''
  
* Specifying Icon and Diagram Views of a class in Modelica
+
* Specifying Icon and Diagram Views of a class
 +
* Using Annotations
 +
* Using coordinateSystem
 +
* Using Extent
 +
* Specifying Grid and Component
 +
* Defining OriginX and OriginY
 +
* Defining Extent1X and Extent1Y
 +
* Using Line and Fill Style
 
* Inserting figures in Icon/Diagram View
 
* Inserting figures in Icon/Diagram View
  
9. '''Component-oriented modeling'''
+
13. '''Component-oriented modeling'''
  
* Instantiating a model in Modelica
+
* Instantiating a class
* Defining connectors
+
* Defining Component orientation
* Developing model of a simple electric circuit using component models
+
* Defining Acausal connectors
 +
* Simulating an Electric Circuit
 +
* Defining Resistor,VoltageSource and Ground
 +
* Defining pin connector
 +
* Connecting different classes
 +
* Connecting pins
 +
* Using Plotting Perspectives
 +
* Using Variables Browser
  
10. '''Block Component Modeling'''
+
14. '''Block Component Modeling'''
  
 
* Defining a block in Modelica
 
* Defining a block in Modelica
 
* Connecting blocks
 
* Connecting blocks
* Using blocks from Modelica library
+
* Using MISO block
 +
* Using Modelica Library
 +
* Defining RealInput and RealOutput connectors
 +
* Instantiating Sum and Product function
 +
* Using nin parameter
 +
* Using Simulate button

Latest revision as of 17:00, 19 November 2019

OpenModelica is an open source modelling and simulation environment intended for industrial and academic usage.It is an object oriented declarative multi domain modelling language for complex systems. The OpenModelica environment allows most of the expression, algorithm, and function parts of Modelica to be executed interactively, as well as equation models and Modelica functions to be compiled into efficient C code. The generated C code is combined with a library of utility functions, a run-time library and a numerical DAE solver. OpenModelica Connection Editor is the new Graphical User Interface for graphical model editing in OpenModelica.

Modelica has emerged as a strong contender in the arena of simulation languages. Modelica's object-oriented design makes it easy to develop chemical engineering unit operations and connect them to one another. With proprietary databases of thermodynamic and physical properties interfaced into the software, simulation of Chemical Engineering models has become much more user friendly and provides accurate results.

This environment can be used to work for both steady state as well as dynamic systems. Attractive strategy when dealing with design and optimization problems. As all the equations are solved simultaneously it doesn't matter whether the unknown variable in an input or output variable.

The Spoken Tutorial Effort for OpenModelica was contributed by Bhargava Nemmaru from the Spoken Tutorial Project and is supported by Rahul Jain, Kaushik Datta, Rahul Nagraj (intern) and Jayaram Ganesh (intern) from IIT Bombay.

Learners: Chemical Engg students to learn how to do energy balance


Basic Level

1. Overview of OpenModelica

  • Introduction to Modeling and Simulation
  • What is OpenModelica
  • Subsystems of OpenModelica Environment
  • Features of OpenModelica
  • Spoken Tutorials available on OpenModelica
  • Timed discussion forum
  • About Spoken Tutorial project
  • Textbook companions for OpenModelica
  • Lab migration for OpenModelica

2. Introduction to OMEdit

  • What is OpenModelica
  • What is OMEdit
  • Perspectives in OMEdit
  • Browsers in OMEdit
  • View icons in OMEdit
  • Open a Class from Libraries Browser
  • Using Thermal library
  • Using HeatTransfer library
  • Checking for correctness of the model
  • Using Simulate button
  • Plotting using conduction variable
  • Using Re-simulate button
  • Using Simulation Setup
  • Specifying Stop Time
  • Using New Parametric Plot Window
  • How to delete results

3. Examples through OMEdit

  • Using Modelica library
  • Using Electrical library
  • Using Analog library
  • Open Rectifier Class
  • Changes in input variable values
  • Compare the variables values
  • Plotting between different variables
  • Using Mechanics library
  • Using Multibody library
  • Open DoublePendulum class
  • Comparing input values
  • Plotting between time vs a_rel
  • Specifying Start Time and Stop Time
  • Changing Simulation interval

4. OpenModelica Connectors

  • Creating new Modelica class
  • Open an existing class
  • Connectors
  • Use of Connectors
  • Adding Resistor, Inductor and Capacitor
  • Adding Voltage Source and Ground
  • Adding pin connector
  • Connection of different classes
  • Connecting through different pins
  • Plotting between input variables

5. Developing an equation-based model

  • Defining different Perspectives
  • Defining Libraries Browser
  • Defining different View icons
  • Creating a new Modelica class
  • Variable and Parameter declaration
  • Defining Start and Unit attribute
  • Defining min and max attribute
  • Defining Comments
  • Declaration of equations
  • Using Simulation Setup button
  • Specifying Stop Time
  • Correcting errors in Messages browser

6. Control flow and Event handling

  • Defining initial equation
  • Using if-else statement
  • Using Plotting perspective
  • Handling time and state events
  • Defining reinit() function
  • Rectify the errors in Messages Browser
  • Using Simulate button
  • Using Simulation Setup option
  • Specifying Stop Time
  • Using when statement

7. Functions and Types

  • Defining a function
  • Defining Real variable
  • Defining Input and Output variable
  • Using algorithm
  • Defining assignment statement
  • Restrictions on functions
  • Defining data types

8. Arrays in Modelica

  • Defining Vector
  • Defining Vector Indexing
  • Declaring array variables
  • Using for loops
  • Using while loops
  • Constructing arrays
  • Using Nested for loop

9. Array Functions and Operations

  • Using OMShell
  • Using fill() functions
  • Using zeros() and identity() function
  • Performing arithmetic operations
  • Using min() and max() function
  • Using sum() and Product ()
  • Using abs() and Size () functions
  • Using ndims() function

Intermediate Level

10. Modelica Packages

  • Defining Package
  • Defining Single file storage
  • Creating a package of classes
  • Using Within statement
  • Using Modelica library
  • Reference classes in a package
  • Using Import statements

11. Annotations in Modelica

  • Using Annotations
  • Using experiment annotation
  • Using Simulation Setup button
  • Specifying model annotations
  • Applying Documentation annotation
  • Defining a record

12. Icon and Diagram Views

  • Specifying Icon and Diagram Views of a class
  • Using Annotations
  • Using coordinateSystem
  • Using Extent
  • Specifying Grid and Component
  • Defining OriginX and OriginY
  • Defining Extent1X and Extent1Y
  • Using Line and Fill Style
  • Inserting figures in Icon/Diagram View

13. Component-oriented modeling

  • Instantiating a class
  • Defining Component orientation
  • Defining Acausal connectors
  • Simulating an Electric Circuit
  • Defining Resistor,VoltageSource and Ground
  • Defining pin connector
  • Connecting different classes
  • Connecting pins
  • Using Plotting Perspectives
  • Using Variables Browser

14. Block Component Modeling

  • Defining a block in Modelica
  • Connecting blocks
  • Using MISO block
  • Using Modelica Library
  • Defining RealInput and RealOutput connectors
  • Instantiating Sum and Product function
  • Using nin parameter
  • Using Simulate button

Contributors and Content Editors

Kaushik Datta, Nancyvarkey, PoojaMoolya