Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
pyMOR
pymor
Commits
cceeb8db
Commit
cceeb8db
authored
Apr 20, 2022
by
Petar Mlinarić
Browse files
[models.iosys] allow non-existent C in mat file
parent
24959527
Pipeline
#137770
passed with stages
in 39 minutes and 27 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/pymor/models/iosys.py
View file @
cceeb8db
...
...
@@ -344,7 +344,7 @@ class LTIModel(Model):
----------
file_name
The name of the .mat file (extension .mat does not need to be included) containing A, B,
C,
and optionally
D
and E.
and optionally
C, D,
and E.
sampling_time
`0` if the system is continuous-time, otherwise a positive number that denotes the
sampling time (in seconds).
...
...
@@ -372,13 +372,13 @@ class LTIModel(Model):
import
scipy.io
as
spio
mat_dict
=
spio
.
loadmat
(
file_name
)
assert
'A'
in
mat_dict
and
'B'
in
mat_dict
and
'C'
in
mat_dict
assert
'A'
in
mat_dict
and
'B'
in
mat_dict
A
=
mat_dict
[
'A'
]
B
=
mat_dict
[
'B'
]
C
=
mat_dict
[
'C'
]
D
=
mat_dict
[
'D'
]
if
'D'
in
mat_dict
else
None
E
=
mat_dict
[
'E'
]
if
'E'
in
mat_dict
else
None
C
=
mat_dict
.
get
(
'C'
,
B
.
T
)
D
=
mat_dict
.
get
(
'D'
)
E
=
mat_dict
.
get
(
'E'
)
return
cls
.
from_matrices
(
A
,
B
,
C
,
D
,
E
,
sampling_time
=
sampling_time
,
state_id
=
state_id
,
solver_options
=
solver_options
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment