Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Python Toolbox to draw Control Block Diagrams

License

NotificationsYou must be signed in to change notification settings

upb-lea/control-block-diagram

Repository files navigation

Overview|Quickstart|Examples|Installation

Overview

The control-block-diagram package is a Python Toolbox for drawing block diagrams. It is builduponPylatex, and therefore, can generate Latexfiles and also PDF files. It allows you to construct typical control block diagrams with theusual building blocks, i.e., PI-Controllers, Adders, Multiplier. It is also possible todefine own blocks.

Getting Started

The easiest way to get started with the ControlBlockDiagram Toolbox is to play around with the Hands On Jupyter Notebook. There the most important functions are explained and demonstrated with simple examples.

Hands On Jupyter Notebook

A basic routine is as simple as:

fromcontrol_block_diagramimportControllerDiagramfromcontrol_block_diagramimportPoint,Box,Connectionif__name__=='__main__':doc=ControllerDiagram()box_control=Box(Point(0,0),text='Control')box_block=Box(box_control.position.add_x(3),text='Block')box_diagram=Box(box_block.position.add_x(3),text='Diagram')Connection.connect(box_control.output,box_block.input)Connection.connect(box_block.output,box_diagram.input)doc.save('pdf')doc.show()

The output of this code is:

Examples

There are some examples in the examples folder:

Installation

  • Install from PyPI:>>> pip install control-block-diagram

  • Install from GitHub source:

git clone git@github.com:upb-lea/control-block-diagram.git cd control-block-diagram# Then eitherpython setup.py install# or alternativelypip install -e .# or alternativelypip install git+https://github.com/upb-lea/control-block-diagram

You also need a latex compiler such as pdfLaTex to create a PDF file. For example, you can get this from the latex distributionMiKTeX.


[8]ページ先頭

©2009-2025 Movatter.jp