Comments (8)
There is no hosted doc of Slycot (yet) (python-control/Slycot#202).
- You can look at the documentation of SLICOT's SB03MD
- There are the docstrings, which are used by IDEs like spyder to render documentation on-the-fly.
You are probably looking for the dico='D'
parameter of slycot.sb03md57
.
from python-control.
Expected output should be this I think:
array([[ 2.06193690, -0.57482614],
[-0.57482614, 0.78661650]])
from python-control.
Where is the documentation on slycot? I tried googling and found the API but couldn't find anything specific on sb03md
.
From wikipedia, the two equations that need to be solved are quite similar:
Observability Gramian for a continuous-time system:
Observability Gramian for a discrete-time system:
So I guess I just need to figure out how to do the second one.
Any advice/pointers would be appreciated.
from python-control.
Okay well that was easy. If I simply allow dico='D'
option it calculates the correct Gramians.
The code is all there, just commented-out:
# TODO: Check for continuous or discrete, only continuous supported for now
# if isCont():
# dico = 'C'
# elif isDisc():
# dico = 'D'
# else:
I simply replaced above with:
if sys.isctime():
dico = 'C'
elif sys.isdtime():
dico = 'D'
else:
raise ValueError("sys")
Is there a reason this wasn't implemented? Maybe at the time of writing isCont
and isDisc
didn't exist and the author was planning to come back and finish it but didn't perhaps?
from python-control.
Unless anyone knows of a problem with this, I'll just go ahead and implement it, including updated unit tests.
from python-control.
I noticed this check for stability in the continuous-time case:
# Check for continuous or discrete
if sys.isctime():
dico = 'C'
# TODO: Check system is stable, perhaps a utility in ctrlutil.py
# or a method of the StateSpace class?
if np.any(np.linalg.eigvals(sys.A).real >= 0.0):
raise ValueError("Oops, the system is unstable!")
Is this the right way to do this for discrete-time systems?
elif sys.isdtime():
dico = 'D'
if np.any(np.abs(sys.poles()) >= 1.):
raise ValueError("Oops, the system is unstable!")
Correct me if I'm wrong but we don't have an sys.isstable
method yet.
from python-control.
I've submitted the pull request.
One other thing I noticed, the gram function has an argument type
which is a reserved Python keyword.
def gram(sys, type):
Should we change this to something else?
Or we could replace gram
with obsv_gram
and ctrl_gram
.
from python-control.
Related Issues (20)
- A way to combine variable-step integration with a discrete-time controller HOT 1
- control.bode configured with omega_limits not showing minor ticks HOT 1
- State Space plant inversion not implemented HOT 1
- doctests failing
- control.bode(Hz=True) the conversion is wrong. HOT 2
- Gain margin is incorrect and does not match plot HOT 1
- Different time response using TF or IO system representation HOT 3
- gain offset using control.matlab.c2d using method='matched' ? HOT 3
- Interconnect function strange behavior HOT 3
- TypeError: No support for MIMO without slycot HOT 4
- TimeResponseData.to_pandas() fails if there are no states in a NonlinearIOSystem HOT 1
- plotting example mimo system HOT 1
- Display Connection Matrix HOT 8
- (accidentally opened issue with garbage title) HOT 1
- `phase_plot` ODE function signature is not compatible with `solve_ivp` and `StateSpace.dynamics` HOT 2
- Strange nondeterministic issues when using `phase_plot` with `X`, `Y` and `X0` set HOT 1
- `control.mixsyn` hangs on M1 HOT 2
- Scaling for control.impulse_response discrete time is not correct HOT 6
- documentation out of date HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-control.