Define vector input for dymos ODE?

66 Views Asked by At

For all dymos examples that I've seen (for example, this brachistochrone), the inputs are defined as follows:

self.add_input('name', val=np.ones(num_nodes), ...)

where num_nodes is number of nodes in the transcription scheme. Instead, can I do something like below?

self.add_input('name', val=np.ones(num_nodes, node), ...)

For example, a use case for this scenario will be I have a displacement variable that has 3 components (x, y, z), and I don't want to repeat myself by calling self.add_input(...) three times.

1

There are 1 best solutions below

1
On

Yes, you can define the state as

self.add_input('name', shape=(num_nodes, state_size), ...)

See this version of the brachistochrone problem