You are on page 1of 17

Basic Terms and Operations

Version 0.5 Preview


08 / 2017

ft e r
r a a p
D gp
k i n 0 .3
o r
W
Focus Ver. 0.5 Prev.

- simple open source simulation environment created in Python, Kivy platform


and NumPy library, platform independed (Linux, Win, Mac)

- 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
simulator 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 ...)

- embedded preprocessor to check the validity of the diagram


editor - 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.
Environment - Basic Terms Ver. 0.5 Prev.

Open / Close Prev / Next Zoom Grid


File menu Screen Start / Stop In / Out On / Off Screen Lock

Setup

Interactive mode
Parameter

Library

Wire
Draw wire

Reference
Configure

Move
Component
Diagram - Basic Terms Ver. 0.5 Prev.

Terminal Connection Port

Wire Unconnected
Open
Parameter Terminals
Vertex
Value

Parameter Wire Reference


Name Bus Reference

Component
Reference

Bus

Multiple Terminal Bus Bus


Connection Compressor Expander
Library Ver. 0.5 Prev.

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 ...)


on-Screen Menu Ver. 0.5 Prev.

Wire Menu Component Menu

Configure wire Add connection Copy component Configure

Add vertex Delete wire Swap vertically Delete component

Connection Menu Vertex Menu

A Show / Hide ref. Convert to connection


Convert to vertex Delete 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


Pre-Processor (2) Ver. 0.5 Prev.

Handling wires

Handling open Handling open


output terminal input terminal

A13 [x] [0] A14


write read

Shared value,
value is not used
Shared value,
default value = [0]

read
A3
Each wire is represented
A4
as association 1: N,
independently of the wire A6
A13 [n] A8
topology write
A10
A11
Pre-Processor (3) Ver. 0.5 Prev.
Common Errors

Simple Complex

Wire without output


terminal or with
Value error, a.e.
more output
sin([ [[1], [1]], [1] ])
terminals

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]]
Pre-Processor (5) Ver. 0.5 Prev.

Scalars, Vectors and Matrics

Value error
Value error

func([ [[1],[2],[3]], [4], [5] ]) func([ [[1],[2],[3]], [[4], [5]] ])

[1]
Lost value
Numerical loop

[ [1], [2], [3] ] [2]


Simulation Ver. 0.5 Prev.

Solvers

Small set of Runge Kutta 2 (Euler), fixed step solvers

Real time synchronised Virtual time


Runge Kutta 2 solver, Runge Kutta 2 solver,
simulation as thread simulation as thread
(Kivy address space) (Kivy address space)

Real time synchronised Virtual time


Runge Kutta 2 solver, Runge Kutta 2 solver,
simulation as process simulation as process

Linux only
Test & Examples Ver. 0.5 Prev.

001 - Lissajous curve


Test & Examples Ver. 0.5 Prev.

002 - Wires & Bus


Install Ver. 0.5 Prev.

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


Install Ver. 0.5 Prev.

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


Acknowledgment & Contact Ver. 0.5 Prev.

Contact: fabo.peter@gmail.com
Peter Fabo, Trenčín, Slovakia, Europe

You might also like