-
Notifications
You must be signed in to change notification settings - Fork 45
add support for ag08bd, sb10jd and tg01fd #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
""" A,B,C,D = sl10jd(n,m,np,A,B,C,D,E,[ldwork])
To convert the descriptor state-space system
E*dx/dt = A*x + B*u
y = C*x + D*u
into regular state-space form
dx/dt = Ad*x + Bd*u
y = Cd*x + Dd*u .
Required arguments:
n : input int
The order of the descriptor system. n >= 0.
m : input int
The column size of the matrix B. m >= 0.
np : input int
The row size of the matrix C. np >= 0.
A : rank-2 array('d') with bounds (n,n)
The leading n-by-n part of this array must
contain the state matrix A of the descriptor system.
B : rank-2 array('d') with bounds (l,m)
The leading n-by-m part of this array must
contain the input matrix B of the descriptor system.
C : rank-2 array('d') with bounds (np,n)
The leading np-by-n part of this array must
contain the output matrix C of the descriptor system.
D : rank-2 array('d') with bounds (np,m)
The leading np-by-m part of this array must
contain the matrix D of the descriptor system.
E : rank-2 array('d') with bounds (l,n)
The leading n-by-n part of this array must
contain the matrix E of the descriptor system.
Optional arguments:
ldwork : input int
The length of the cache array.
ldwork >= max( 1, 2*n*n + 2*n + n*MAX( 5, n + m + np ) ).
For good performance, ldwork must generally be larger.
Return objects:
A : rank-2 array('d') with bounds (nsys,nsys)
The leading nsys-by-nsys part of this array
contains the state matrix Ad of the converted system.
B : rank-2 array('d') with bounds (nsys,m)
The leading NSYS-by-M part of this array
contains the input matrix Bd of the converted system.
C : rank-2 array('d') with bounds (np,nsys)
The leading NP-by-NSYS part of this array
contains the output matrix Cd of the converted system.
D : rank-2 array('d') with bounds (np,m)
The leading NP-by-M part of this array contains
the matrix Dd of the converted system.
"""
hidden = ' (hidden by the wrapper)'
arg_list = ['n', 'm', 'np', 'A', 'lda'+hidden, 'B', 'ldb'+hidden,
'C', 'ldc'+hidden, 'D', 'ldd'+hidden, 'E', 'lde'+hidden, 'nsys',
'dwork'+hidden, 'ldwork', 'info']
if ldwork is None:
ldwork = max(1, 2 * n * n + 2 * n + n * max(5, n + m + np))
A,B,C,D,nsys,info = _wrapper.sb10jd(n,m,np,A,B,C,D,E,ldwork)
if info < 0:
error_text = "The following argument had an illegal value:
"+arg_list[-info-1]
e = ValueError(error_text)
e.info = info
raise e
elif info == 1:
e = ArithmeticError("The sb10jd algorithm did not converge")
e.info = 1
raise e
elif info != 0:
e = ArithmeticError('sb10jd failed')
e.info = info
raise e
return A[:nsys,:nsys],B[:nsys,:m],C[:np, :nsys],D[:np, :m]
Correct some spelling and alignments
|
Any possibility you could add some unit tests? |
|
Unit tests for the three functions added. |
|
If you use |
|
I tried the max(shape(,0),1) for ld, but as I understand you this does not help me. Is this a critical issue? Is it solved in other slycot functions? |
|
Ah sorry, let me clarify. I was just mentioning the fact that, suppose an input matrix is the empty matrix Then when you supply this to the low level fortran routines, because now the shape is instead of the current |
|
I have corrected the MAX(ldx,1) issue. Anything else missing? |
|
I did a quick look at the (updated) code and this looks good to go to me. Will merge into master branch 24 hours if nobody else objects. |
No description provided.