Repository navigation
Add ab04md #201
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
Merged
Merged
Add ab04md #201
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3598ac9
Add ab04md wrapper
KybernetikJo 52cc0f8
Unittest added for ab04md.
KybernetikJo 416b352
Add docstring, Change parameter name from type_bn to type_t
KybernetikJo 6643167
Update slycot/analysis.py
KybernetikJo fe5c56a
Update docstring (remove input mark from int types)
KybernetikJo 8ad0236
Improve docstring
KybernetikJo 2289d93
Update docstring, minor fixes
KybernetikJo 118bf58
cleanup test file
bnavigator File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add docstring, Change parameter name from type_bn to type_t
- Loading branch information
commit 416b352ec96fe5b6221fe6c4c99d2a78479424a4
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -139,19 +139,75 @@ def ab01nd(n, m, A, B, jobz='N', tol=0, ldwork=None): | |||||
| Z = None | ||||||
| return Ac, Bc, ncont, indcon, nblk, Z, tau | ||||||
|
|
||||||
| def ab04md(type_bn, n, m, p, A, B, C, D, alpha=1.0, beta=1.0, ldwork=None): | ||||||
| """ a,b,c,d = ab04md() | ||||||
| def ab04md(type_t, n, m, p, A, B, C, D, alpha=1.0, beta=1.0, ldwork=None): | ||||||
| """ At,Bt,Ct,Dt = ab04md(type_bn, n, m, p, A, B, C, D, [alpha, beta,ldwork]) | ||||||
|
|
||||||
| Parameters | ||||||
| ---------- | ||||||
| type_t : {'D','C'} | ||||||
| Indicates the type of the original system and the | ||||||
| transformation to be performed as follows: | ||||||
| = 'D': discrete-time -> continuous-time; | ||||||
| = 'C': continuous-time -> discrete-time. | ||||||
| n : input int | ||||||
|
KybernetikJo marked this conversation as resolved.
Outdated
|
||||||
| The order of the matrix A, the number of rows of matrix B and | ||||||
| the number of columns of matrix C. It represents the dimension of | ||||||
| the state vector. n > 0. | ||||||
| m : input int | ||||||
| The number of columns of matrix B. It represents the dimension of | ||||||
| the input vector. m > 0. | ||||||
| p : input int | ||||||
| The number of rows of matrix C. It represents the dimension of | ||||||
| the output vector. p > 0. | ||||||
| A : input rank-2 array('d') with bounds (n,n) | ||||||
| The leading n-by-n part of this array must contain the system state | ||||||
| matrix A. | ||||||
| B : input rank-2 array('d') with bounds (n,m) | ||||||
| The leading n-by-m part of this array must contain the system input | ||||||
| matrix B. | ||||||
| C : input rank-2 array('d') with bounds (p,n) | ||||||
| The leading p-by-n part of this array must contain the system output | ||||||
| matrix C. | ||||||
| D : input rank-2 array('d') with bounds (p,m) | ||||||
| The leading p-by-m part of this array must contain the system direct | ||||||
| transmission matrix D. | ||||||
| alpha : double | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| Parameter specifying the bilinear transformation. | ||||||
| Recommended values for stable systems: alpha = 1, alpha != 0, | ||||||
| beta : double | ||||||
| Parameter specifying the bilinear transformation. | ||||||
| Recommended values for stable systems: beta = 1, beta != 0, | ||||||
| ldwork : int | ||||||
| The length of the cache array. | ||||||
| ldwork >= max(1, n) | ||||||
| Returns | ||||||
| ------- | ||||||
| At : output rank-2 array('d') with bounds (n,n) | ||||||
| The state matrix At of the transformed system. | ||||||
| Bt : output rank-2 array('d') with bounds (n,m) | ||||||
| The input matrix Bt of the transformed system. | ||||||
| Ct : output rank-2 array('d') with bounds (p,n) | ||||||
| The output matrix Ct of the transformed system. | ||||||
| Dt : output rank-2 array('d') with bounds (p,m) | ||||||
| The transmission matrix Dt of the transformed system. | ||||||
| Raises | ||||||
| ------ | ||||||
| SlycotArithmeticError | ||||||
| :info == 1: | ||||||
| If the matrix (ALPHA*I + A) is exactly singular | ||||||
| :info == 2: | ||||||
| If the matrix (BETA*I - A) is exactly singular. | ||||||
| """ | ||||||
|
|
||||||
| hidden = ' (hidden by the wrapper)' | ||||||
| arg_list = ['type_bn', 'n', 'm', 'p', 'alpha', 'beta', | ||||||
| arg_list = ['type_t', 'n', 'm', 'p', 'alpha', 'beta', | ||||||
| 'A', 'LDA'+hidden, 'B', 'LDB'+hidden, 'C', 'LDC'+hidden, 'D', 'LDD'+hidden, | ||||||
| 'IWORK'+hidden, 'DWORK'+hidden, 'ldwork', 'info'+hidden] | ||||||
|
|
||||||
| if ldwork is None: | ||||||
| ldwork = max(n, 3*m) | ||||||
| ldwork = max(1, n) | ||||||
|
|
||||||
| out = _wrapper.ab04md(type_bn, n, m, p, alpha, beta, A, B, C, D, ldwork=ldwork) | ||||||
| out = _wrapper.ab04md(type_t, n, m, p, alpha, beta, A, B, C, D, ldwork=ldwork) | ||||||
| info=out[-1] | ||||||
| raise_if_slycot_error(info, arg_list) | ||||||
|
|
||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.