-
Notifications
You must be signed in to change notification settings - Fork 33
Changes
Peter Corke edited this page Jun 7, 2021
·
4 revisions
- arithmetic operators autogenerate blocks
-
*
operator replaced by>>
operator, thanks to Cal Hays for both suggestions - simple event handling allow more accurate results for discontinuous inputs, eg. STEP block
- new RAMP and NULL block, the latter useful for testing
- new DICT block, like a mux but with names, works with ITEM block
- PRINT block now has better formatting
- SCOPEXY block has named input ports now:
x
andy
- unit tests working again
-
len(blockdiagram)
is the number of blocks - fix bug with
BDSim()
being instantiated multiple times - new way to schedule execution of blocks, now a data flow graph
- updates to wiki documentation, some documentation polish
Coming soon, a GUI-based editor.
The old syntax
import bdsim
bd = bdsim.BlockDiagram() # create an empty block diagram
.
.
.
out = bd(5) # simulate the model
is now
import bdsim
sim = bdsim.BDSim(animation=True) # create simulator
bd = sim.blockdiagram() # create an empty block diagram
.
.
.
out = sim.run(bd, 5) # simulate the model
Trying to separate out all the operating specific stuff (matplotlib, argparse, SciPy) from the blocks and wires. Longer term aim is to make the blocks stateless, but not there yet.
clock = bd.clock(2, 'Hz') # create a 2Hz clock
zoh = bd.ZOH(clock) # create a ZOH block that samples on this clock
A clock can drive multiple clocked blocks. The discrete state associated with a particular clock is kept within the Clock
block.# Getting started
Copyright (c) Peter Corke 2020-23
- Home
- FAQ
- Changes
- Adding blocks
- Block path
- Connecting blocks
- Subsystems
- Compiling
- Running
- Runtime options
- Discrete-time blocks
- Figures
- Real time control
- PID control
- Coding patterns