Comments (12)
*Commented by anonymous on 2014-04-01 16:09 UTC
Is there anything I can do to help get these patches accepted? I would like to be able to share my work with others without directing them to download my private git repo. Here is my current notebook, it goes from first principles to a full LQR based lateral/longitudinal controller in one IPython notebook using control/scipy/numpy/sympy.
from python-control.
*Commented by anonymous on 2014-04-01 16:12 UTC
Note that the current aerodynamic model is a bit off, I haven't put reasonable coefficients in yet. I just wanted to get something working. At the angle of attack it is at, it should be stalling but I didn't model stall. I have done a CFD analysis of a UAV in XFLR5 and will put those coefficients in today.
from python-control.
Commented by scottlivingston on 2014-04-01 16:44 UTC
You are abusing __repr__
by setting it to __str__
. This patch qualifies as an unnecessary hack for use in IPython. Cf.
https://docs.python.org/2.7/reference/datamodel.html#object.__repr__
from python-control.
*Commented by anonymous on 2014-04-01 16:59 UTC
I think setting repr to something would be useful. You could make it a call to the ctor string. The current address of the object that is default is useless. Also, can you take a look at the other patches. There are required changes there for my code to work. Like state-space array access.
from python-control.
Commented by scottlivingston on 2014-04-01 17:15 UTC
Anonymous: Are you James Goppert? Please log-in so that your username is archived in these comments.
from python-control.
Commented by jgoppert on 2014-04-01 17:36 UTC
Yes, sorry about that, was using my cell.
from python-control.
Commented by murrayrm on 2014-04-02 20:37 UTC
I'll try to take a look at the various patches and incorporate them this coming weekend. For this particular patch, my plan is to follow the python guidelines.
from python-control.
*Commented by anonymous on 2014-04-02 21:45 UTC
Thanks!
from python-control.
Commented by jgoppert on 2014-04-02 21:48 UTC
I'm currently working on packaging slycot for pypi. Kind of a headache, but I'm getting there.
from python-control.
Included in 71cfb32. But we should probably redefine __repr__
to give an expression that will recreate the object, rather than duplicating __str__
, as mentioned above.
from python-control.
I traced the integration of commit 71cfb32 through pull request #28 . Neither here (#16) nor there was the concern about abuse of __repr__
addressed. Or rather, it was decided as something that can be changed later. For comparison and a suggestion as to why this may matter,
from __future__ import print_function
import numpy as np
x = np.random.rand(3)
print(A.__str__())
print(A.__repr__())
whereas
from __future__ import print_function
import control
S = control.StateSpace([[-1.]], [[1.]], [[1.]], [[0.]])
print(S.__str__())
print(S.__repr__())
As an example of how we may create a __repr__
method that is consistent with the Python data model, consider the following (continuing the previous code snippet):
def example_repr(S):
return "StateSpace("+repr(S.A)+", "+repr(S.B)+", "+repr(S.C)+", "+repr(S.D)+")"
print(example_repr(S))
This representation string is easily used in eval()
, after ensuring the appropriate names are available.
from control import StateSpace
from numpy import matrix
S2 = eval(example_repr(S))
where S2
is an instance of StateSpace
.
from python-control.
Changed milestone on this closed release to improve tracking.
from python-control.
Related Issues (20)
- How to convert finite step response model to state space representation? HOT 2
- Output calcs produce 0's at every other call HOT 2
- equations not showing up correctly in online docs HOT 2
- IndexError: index -1 is out of bounds for axis 0 with size 0 HOT 4
- "Interconnect" input specification. HOT 2
- UnboundLocalError: local variable 's' referenced before assignment HOT 2
- Version 0.10.1 release plans
- Display Connection Matrix HOT 8
- (accidentally opened issue with garbage title) HOT 1
- Observability Gramian for discrete-time systems HOT 8
- `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
- Wrong parameter name in documentation HOT 1
- Parallel system interconnection using `control.interconnect()` HOT 4
- Plotting nyquist plot from FrequencyResponseData fails HOT 3
- forced_response giving different output depending on Python and/or numpy version HOT 9
- inconsistent kwarg klist/kvect/gains in rlocus doc HOT 3
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.