Skip to content

Commit 93c4c8d

Browse files
authored
Merge pull request #1082 from murrayrm/iosys_enhance-07Dec2024
I/O system enhancements
2 parents 21c8f31 + 1061445 commit 93c4c8d

22 files changed

+1134
-581
lines changed

control/bdalg.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,8 @@ def combine_tf(tf_array):
600600
f"row {row_index}."
601601
)
602602
for j_in in range(col.ninputs):
603-
num_row.append(col.num[j_out][j_in])
604-
den_row.append(col.den[j_out][j_in])
603+
num_row.append(col.num_array[j_out, j_in])
604+
den_row.append(col.den_array[j_out, j_in])
605605
num.append(num_row)
606606
den.append(den_row)
607607
for row_index, row in enumerate(num):
@@ -657,8 +657,8 @@ def split_tf(transfer_function):
657657
for i_in in range(transfer_function.ninputs):
658658
row.append(
659659
tf.TransferFunction(
660-
transfer_function.num[i_out][i_in],
661-
transfer_function.den[i_out][i_in],
660+
transfer_function.num_array[i_out, i_in],
661+
transfer_function.den_array[i_out, i_in],
662662
dt=transfer_function.dt,
663663
)
664664
)

control/flatsys/flatsys.py

Lines changed: 33 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,5 @@
11
# flatsys.py - trajectory generation for differentially flat systems
22
# RMM, 10 Nov 2012
3-
#
4-
# This file contains routines for computing trajectories for differentially
5-
# flat nonlinear systems. It is (very) loosely based on the NTG software
6-
# package developed by Mark Milam and Kudah Mushambi, but rewritten from
7-
# scratch in python.
8-
#
9-
# Copyright (c) 2012 by California Institute of Technology
10-
# All rights reserved.
11-
#
12-
# Redistribution and use in source and binary forms, with or without
13-
# modification, are permitted provided that the following conditions
14-
# are met:
15-
#
16-
# 1. Redistributions of source code must retain the above copyright
17-
# notice, this list of conditions and the following disclaimer.
18-
#
19-
# 2. Redistributions in binary form must reproduce the above copyright
20-
# notice, this list of conditions and the following disclaimer in the
21-
# documentation and/or other materials provided with the distribution.
22-
#
23-
# 3. Neither the name of the California Institute of Technology nor
24-
# the names of its contributors may be used to endorse or promote
25-
# products derived from this software without specific prior
26-
# written permission.
27-
#
28-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29-
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30-
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
31-
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CALTECH
32-
# OR THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33-
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34-
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
35-
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36-
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
37-
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
38-
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39-
# SUCH DAMAGE.
403

414
import itertools
425
import numpy as np
@@ -54,8 +17,30 @@ class FlatSystem(NonlinearIOSystem):
5417
"""Base class for representing a differentially flat system.
5518
5619
The FlatSystem class is used as a base class to describe differentially
57-
flat systems for trajectory generation. The output of the system does not
58-
need to be the differentially flat output.
20+
flat systems for trajectory generation. The output of the system does
21+
not need to be the differentially flat output. Flat systems are
22+
usually created with the :func:`~control.flatsys.flatsys` factory
23+
function.
24+
25+
Parameters
26+
----------
27+
forward : callable
28+
A function to compute the flat flag given the states and input.
29+
reverse : callable
30+
A function to compute the states and input given the flat flag.
31+
dt : None, True or float, optional
32+
System timebase.
33+
34+
Attributes
35+
----------
36+
ninputs, noutputs, nstates : int
37+
Number of input, output and state variables.
38+
shape : tuple
39+
2-tuple of I/O system dimension, (noutputs, ninputs).
40+
input_labels, output_labels, state_labels : list of str
41+
Names for the input, output, and state variables.
42+
name : string, optional
43+
System name.
5944
6045
Notes
6146
-----
@@ -234,10 +219,9 @@ def flatsys(*args, updfcn=None, outfcn=None, **kwargs):
234219
Description of the system states. Same format as `inputs`.
235220
236221
dt : None, True or float, optional
237-
System timebase. None (default) indicates continuous
238-
time, True indicates discrete time with undefined sampling
239-
time, positive number is discrete time with specified
240-
sampling time.
222+
System timebase. None (default) indicates continuous time, True
223+
indicates discrete time with undefined sampling time, positive
224+
number is discrete time with specified sampling time.
241225
242226
params : dict, optional
243227
Parameter values for the systems. Passed to the evaluation
@@ -252,6 +236,12 @@ def flatsys(*args, updfcn=None, outfcn=None, **kwargs):
252236
sys: :class:`FlatSystem`
253237
Flat system.
254238
239+
Other Parameters
240+
----------------
241+
input_prefix, output_prefix, state_prefix : string, optional
242+
Set the prefix for input, output, and state signals. Defaults =
243+
'u', 'y', 'x'.
244+
255245
"""
256246
from .linflat import LinearFlatSystem
257247
from ..statesp import StateSpace

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy