-
Notifications
You must be signed in to change notification settings - Fork 34
Running
Peter Corke edited this page Jul 8, 2020
·
9 revisions
#!/usr/bin/env python3
import bdsim
.
.
bd.run(10)
bd.done()
The first line runs the simulation for the specified amount of time. Graphics behaviour is controlled by command line switches:
Switch | Behaviour |
---|---|
-g | disable graphics, simulation runs quickly, returns numerical result only |
-a | enable animation, simulation runs more slowly |
The second line blocks until either the figures are all closed, or a SIGINT is received. Without this the program "falls of the end" and the graphics are not seen.
Pretty much the same as above. The BlockDiagram
constructor does access the command line arguments by defaults. If you use these for your own purposes, in particular use these same flags for your own purpose, then you can set some arguments to the constructor
Argument | Behaviour |
---|---|
sysargs | ignore command line arguments (default True) |
graphics | enable graphics, simulation runs quickly, returns numerical result only (default True) |
animation | enable animation, simulation runs more slowly (default False) |
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