A simulation for electricity transmission using Modelica language.
Since all the tools come from OpenModelica (a free tool), you can easily start and test the simulation in any OS.
See the following link about OpenModelica: https://www.openmodelica.org/
2. West Lab
OpenModelica
• OS
- Linux
- Windows
- Mac
ØPartly supported
ØInstall
• Homebrew
• Macport
- Virtual Machine (ubuntu)
Ø https://openmodelica.org/download/virtual-
machine
Ø Installation
1. Install virtualbox
2. Download box file, and vmdk file in same
directory
3. Double click the box file
Ø Bug: cannot login
• Change GUI manager
2
3. West Lab
3
1. Modelica introduction
2. Thermal simulation using Modelica
3. Exercise1: RL Circuit
4. Exercise2: Transmission Loss
5. Exercise3: Power World
4. West Lab
What is Modelica?
4
TUTORIAL – COURSE
Introduction to Object-Oriented
Modeling and Simulation with Modelica
Using OpenModelica
Peter Fritzson
Copyright (c) Open Source Modelica Consortium
Version 2012
https://www.modelica.org/libraries
A language for modeling of
complex physical system.
Primarydesigned for simulation.
5. West Lab
What is Modelica?
5
TUTORIAL – COURSE
Introduction to Object-Oriented
Modeling and Simulation with Modelica
Using OpenModelica
Peter Fritzson
Copyright (c) Open Source Modelica Consortium
Version 2012
https://www.modelica.org/libraries
A language for modeling of
complex physical system.
Combine multi-domainmodeling
6. West Lab
What is Modelica?
6
Declarative language
Equations and mathematicalfunctions allow acausal modeling,
high level specification,increasedcorrectness
Multi-domain modeling
Combine electrical,mechanical,thermodynamic,hydraulic,
biological,control,event, real-time,etc…
Everything is a class
Strongly typed object-orientedlanguage with a general class
concept, Java & MATLAB-like syntax
Visual component programming
Hierarchical system architecture capabilities
Efficient, non-proprietary
Efficiencycomparable to C; advanced equation compilation,
e.g. 300 000 equations,~ 150 000 lines on standard PC
8. West Lab
Modelica Free/Commercial Libraries
8
• Modelica Library
- Modelica
- Power system
- Vehicle
- Mathematics
- Chemical
- Building
https://www.modelica.org/libraries
9. West Lab
Modelica Tutorial
9
• Exercise 1
- RL Circuit model
• Exercise 2
- TransmissionLoss model
• Exercise 3
- Power World
10. West Lab
Exercise 1: RL Circuit
10
• Goal
- Making a basic RL circuit model using Modelica language
- Executing a simulationand plottingthe result
- Understanding the relationshipbetween electrical-thermalenergy
• Library
- Modelica library
28. West Lab
Exercise 2: Transmission Loss
28
• Goal
- Making a simple model representingtransmissionloss
using PowerSystems library
- Using the icon setting
- Understanding the outer/inner variables
• Library
- PowerSystems
37. West Lab
37
if PhaseSystem.m > 0 then
omegaRef = der(PhaseSystem.thetaRef(terminal_p.theta));
else
omegaRef = 0;
end if;
v = R * i + omegaRef * L * j(i);
zeros(PhaseSystem.n) = terminal_p.i + terminal_n.i;
if PhaseSystem.m > 0 then
terminal_p.theta = terminal_n.theta;
end if
Equation of the line model
39. West Lab
39
1. Set 1. FixedVoltageSource, 2. FixedCurrennt, and 3. System
from Powersystem.Generic
2. Open the parameter window of the FixedCurrent by double
click and change the parameter
Simulationof the line model
40. West Lab
40
1. Set 1. FixedVoltageSource, 2. FixedCurrennt, and 3. System
from Powersystem.Generic
2. Open the parameter window of the FixedCurrent by double
click and change the parameter
Simulationof the line model
47. West Lab
Exercise 3: Power World
47
• Goal
- Simulatingthe simplifiedpower grid including
ØVoltage
ØCurrent
ØFrequency
- Considering transmissionloss,and voltage conversion
- Using dynamic wind and electricityconsumptiondata
• Library
- PowerSystems
* The Power World uses Generic components
with the quasi-static ThreePhase_dq because
fast electrical transients and asymmetries are
neglected. For more precise simulation of
power grid, you can use the SPOT from
PowerSystems supporting AC 3 phase.
48. West Lab
Exercise 3: Power World
48
• Goal
- Simulatingthe simplifiedpower grid including
ØVoltage
ØCurrent
ØFrequency
- Considering transmissionloss,and voltage conversion
- Using dynamic wind and electricityconsumptiondata
• Library
- PowerSystems
* The Power World uses Generic components
with the quasi-static ThreePhase_dq because
fast electrical transients and asymmetries are
neglected. For more precise simulation of
power grid, you can use the SPOT from
PowerSystems supporting AC 3 phase.
49. West Lab
49
Exercise 3: Power World
1. Add System from PowerSystems
2. Add PowerPlant, HydroPlant, WindFarm, and City
from PowerSystems.Examples.Components
56. West Lab
56
1. Add LoadDispatcher from
PowerSystems.Example.PowerWorld.Components
2. Add RealExpression from Modelica.Blocks.Sources
Exercise 3: Power World
68. West Lab
SPOT: more precise power-system simulation
68
* The Power World uses Generic components
with the quasi-static ThreePhase_dq because
fast electrical transients and asymmetries are
neglected. For more precise simulation of
power grid, you can use the SPOT from
PowerSystems supporting AC 3 phase.