Software:Se-lib

From HandWiki
se-lib
Se-lib activity diagram.svg
Original author(s)Ray Madachy
Developer(s)Ryan Longshore
Initial releaseNovember 30, 2022 (2022-11-30)
Stable release
0.27.4 / October 19, 2023; 8 months ago (2023-10-19)
Written inPython
Operating systemCross-platform
TypeSystems Modeling
LicenseMIT
Websitese-lib.org

The Systems Engineering Library (se-lib) is a free and open-source library written in Python. Current capabilities for systems modeling include SysML and UML textual notation and diagrams, other modeling diagram types, time-based simulation including discrete-event simulation and continuous systems modeling with system dynamics, system reliability modeling, system cost modeling, and systems engineering process and project management. It is interoperable with other modeling tools.

Overview

The goals of se-lib are to [1]:

  • Lower access barrier to system modeling with open source tool environment.
  • Provide integrated capabilities for systems modeling, analysis, and documentation
  • Be digital engineering compliant.
  • Be compatible with other modeling tools and libraries on desktop and cloud platforms.

se-lib development has been supported by the Naval Postgraduate School Foundation for critical technologies and education programs .[2] As a seed project it was funded for "adoption of engineers across disciplines in support of digital engineering practice, teaching and research in the DOD".

It has been used in graduate courses for modeling and simulation, capability engineering, and systems software engineering at Naval Postgraduate School. se-lib has also been used for masters capstone projects and research deliverables. It has been the subject of professional training venues for systems engineers with the International Council on Systems Engineering.[3]

The Boehm Center for Systems and Software Engineering is a cooperating organization.[4] The se-lib system cost models in particular have been featured and transitioned through the Center.

se-lib was originally called the Python Modeling Library (PyML), and was renamed to be more specific for systems engineering applications.[5]

Implementation

se-lib is written in Python, and uses the primary libraries of SimPy for discrete event simulation, PySD for a system dynamics engine, Matplotlib for plotting, and graphviz for generating diagrams.

It uses the XMILE format for system dynamics models, making it file-compatible with Vensim and Stella for simulation.

Examples

SysML and UML

The following generates a use case model diagram:

import selib as se

# system model
system_name = "Course Portal"
actors = ['Student', 'Instructor']
use_cases = ['Post Discussion', 'Take Quiz', 'Create Quiz']
interactions = [('Student', 'Post Discussion'), ('Instructor', 'Post Discussion'), ('Student', 'Take Quiz'), ('Instructor', 'Create Quiz')]
use_case_relationships = []

# create diagram
se.use_case_diagram(system_name, actors, use_cases, interactions, use_case_relationships, filename=system_name+'use case diagram.pdf')
Se-lib course portal use case diagram

Discrete Event Simulation

Online discrete event modeling examples are available in playground mode at.[6]

A discrete event model for electric car charging is:

# electric car charging simulation
init_de_model()

add_source('incoming_cars',
           entity_name="Car",
           num_entities = 50,
           connections={'charger': .7, 'impatient_cars': .3},
           interarrival_time='np.random.exponential(5)')

add_server(name='charger',
           connections={'payment': 1},
           service_time='np.random.uniform(0, 16)',
           capacity = 1)

add_delay(name='payment',
           delay_time = 'np.random.uniform(1, 3)',
           connections={'served_cars': 1},)

add_terminate('served_cars')
add_terminate('impatient_cars')

draw_model_diagram()

model_data, entity_data = run_model()
plot_histogram(model_data['charger']['waiting_times'], xlabel="Charger Waiting Time")
Se-lib electric car model diagram from discrete event simulation
Se-lib electric car model output

References

External links