Defining signals as vectors #1008
Replies: 3 comments 3 replies
-
Another example of how vector signals would be used, in the outputs naming: forces_moments = ct.interconnect(
(aerodynamics, propulsion, gravity, sum_forces_moments),
name="forces_moments",
connections=[
# input <- output
['sum_forces_moments.u[:6]', 'aerodynamics.y'],
['sum_forces_moments.u[6:12]', 'propulsion.y'],
['sum_forces_moments.u[12:15]', 'gravity.y'],
],
inplist = ['aerodynamics.coef'],
outlist = ['sum_forces_moments.y', 'aerodynamics.y[:3]'],
outputs = ['F_total[3]', 'M_total[3]', 'F_aero[3]']
) |
Beta Was this translation helpful? Give feedback.
-
It would be great to get some additional processing of vector signals. A few notes on the above:
|
Beta Was this translation helpful? Give feedback.
-
Adding a note to also think about the case when one input to an interconnected system needs to be accessed by multiple subsystems. For example, what if each of the aerodynamics, propulsion, and gravity models needs access to the vehicle rigid body state vector? Currently, the state vector would have to be connected to the interconnected system 3 separate times (which could be a list 36+ items long) |
Beta Was this translation helpful? Give feedback.
-
It seems like signals can only be defined by giving an integer count (in which case the signals are named with 'u', 'y', or 'x'), or by naming individual vector components. Is it possible to specify vector signals, like:
airplane = ct.nlsys(updfcn=dynamics, outfcn=None, inputs=('forces[3]', 'moments[3]'), outputs=...
Would it be difficult for me to add this feature?
From the documentation:
inputs (int, list of str or None, optional) – Description of the system inputs. This can be given as an integer count or as a list of strings that name the individual signals. If an integer count is specified, the names of the signal will be of the form s[i] (where s is one of u, y, or x)
Beta Was this translation helpful? Give feedback.
All reactions