Basic Terms and Operations Version 0.5 Preview 08 / 2017
ft
W
a a r D gp n .3 i 0 k r o
r e p
Focus
Ver. 0.5 Prev.
- simple open source simulation environment created in Python, Kivy platform and NumPy library, platform independed (Linux, Win, Mac)
simulator
- applications simulation: linear, nonlinear, discrete a hybrid models, real time simulations, api for creating user-defined simulation components science: data collection and processing from laboratory instruments, real time experiment control, remote front-end education: interactive presentations and demonstrations, laboratory work and experiments, polytechnical education, robotics, mechatronics
- universal block editor (part of pse), platform independend, with minimal dependence on the graphics subsystem - portable to other graphics platforms with Python API (wxPython, pyQt ...) - api for creating user-defined graphical components (Box, Wired ...)
editor
- embedded preprocessor to check the validity of the diagram - rules derived from digital electronics, oriented graphs etc. - internal editor data structures exportable in JSON or specific formats (Spice ...) - dictionary of components, wires, - relations between outputs and inputs, - statistical data etc.
Ver. 0.5 Prev.
Environment - Basic Terms Open / Close File menu
Prev / Next Screen
Start / Stop
Zoom In / Out
Grid On / Off
Screen Lock
Setup
Interactive mode
Parameter
Library Draw wire
Wire Reference
Configure Move Component
Diagram - Basic Terms Terminal
Ver. 0.5 Prev.
Port
Connection
Wire Parameter Value
Unconnected Open Terminals
Vertex
Parameter Name
Wire Reference
Bus Reference Component Reference
Bus
Multiple Terminal Connection
Bus Compressor
Bus Expander
Library
Sources (Const, Generators ...) Sinks (Console, File ...) Networks & Control Graph (Y/T, X/Y Graphs) Math (Math operations and functions) Digital (Discrete and digital components) Analog (Continuous components) Clock (Sync and Delays) Interactive (Button, Slider, Display ...)
Ver. 0.5 Prev.
Ver. 0.5 Prev.
on-Screen Menu Wire Menu
Component Menu
Configure wire
Add connection
Copy component
Configure
Add vertex
Delete wire
Swap vertically
Delete component
Connection Menu
Convert to vertex
Delete connection
Vertex Menu
A
Show / Hide ref.
Convert to connection
Adjust wire
Delete vertex
Pre-Processor (1)
Ver. 0.5 Prev.
Handling wires with Port Port with bidirectional terminal
Virtual (unvisible) wires
Virtual (unvisible) connection Connects all ports with the same name All virtual components (wires, connections) are part of the diagram
Ver. 0.5 Prev.
Pre-Processor (2) Handling wires
Handling open output terminal A13
write
Handling open input terminal
[x]
[0]
Shared value, value is not used
read
A14
Shared value, default value = [0]
read Each wire is represented as association 1: N, independently of the wire topology
A13
write
[n]
A3 A4 A6 A8 A10 A11
Ver. 0.5 Prev.
Pre-Processor (3) Common Errors Simple
Wire without output terminal or with more output terminals
Complex
Value error, a.e. sin([ [[1], [1]], [1] ])
Wire loop Algebraic loop with continuous components
Unconnected wire
Pre-Processor (4)
Ver. 0.5 Prev.
Scalars, Vectors and Matrics [1]
[[1], [2]]
[[[1], [2]], [3]]
Internal definition: Scalar is a vector of unit length
[[[[1], [2]], [3]], [3]] [[1], [2], [3]] [[2], [4], [6]]
pse uses standard numpy / sciopy operations
vector + vector
vector + scalar [10]
[[12], [14], [16]]
Ver. 0.5 Prev.
Pre-Processor (5) Scalars, Vectors and Matrics Value error
Value error
func([ [[1],[2],[3]], [[4], [5]] ])
func([ [[1],[2],[3]], [4], [5] ])
Lost value
[ [1], [2], [3] ]
[1] Numerical loop
[2]
Simulation
Ver. 0.5 Prev.
Solvers Small set of Runge Kutta 2 (Euler), fixed step solvers
Real time synchronised Runge Kutta 2 solver, simulation as thread (Kivy address space)
Virtual time Runge Kutta 2 solver, simulation as thread (Kivy address space)
Virtual time Runge Kutta 2 solver, simulation as process
Real time synchronised Runge Kutta 2 solver, simulation as process
Linux only
Test & Examples 001 - Lissajous curve
Ver. 0.5 Prev.
Test & Examples 002 - Wires & Bus
Ver. 0.5 Prev.
Install Linux - Ubuntu 1. Install Python 3 sudo apt-get install python 3 2. Install SciPy / Numpy sudo apt-get install python3-scipy or follow instructions on https://www.scipy.org/install.html 3. Install Kivy 1.10.0 follow instructions on https://kivy.org/#download 4. Download pse for latest version visit / follow pse project page https://www.researchgate.net/project/pse-Python-Simulation-Environment 5. Unpack source code and run python3 pse.py 6. Load and run examples and tests from ./test directory
Ver. 0.5 Prev.
Install Windows 1. Install Python 3 follow instructions on https://www.python.org/downloads/ check and set PATH variable, if necessary 2. Install SciPy / Numpy follow instructions on https://www.scipy.org/install.html 3. Install Kivy 1.10.0 follow instructions on https://kivy.org/#download 4. Download pse for latest version visit / follow pse project page https://www.researchgate.net/project/pse-Python-Simulation-Environment 5. Unpack source code and run (command window) python3 pse.py 6. Load and run examples and tests from ./test directory 7. In your work use RK2T and RT2T solvers only
Ver. 0.5 Prev.
Acknowledgment & Contact
Contact:
[email protected] Peter Fabo, Trenčín, Slovakia, Europe
Ver. 0.5 Prev.