c4dynamics.states.state.state.X

Contents

c4dynamics.states.state.state.X#

property state.X: ndarray[Any, dtype[Any]]#

Gets and sets the state vector variables.

Parameters:

x (array_like) – Values vector to set the variables of the state.

Returns:

out (numpy.array) – Values vector of the state.

Examples

Getter:

>>> s = c4d.state(x1 = 0, x2 = -1)
>>> s.X   
[0  -1]

Setter:

>>> s = c4d.state(x1 = 0, x2 = -1)
>>> s.X += [0, 1] # equivalent to: s.X = s.X + [0, 1]
>>> s.X   
[0  0]

datapoint getter - setter:

>>> dp = c4d.datapoint()
>>> dp.X   
[0  0  0  0  0  0]
>>> #       x     y    z  vx vy vz
>>> dp.X = [1000, 100, 0, 0, 0, -100]
>>> dp.X   
[1000  100  0  0  0  -100]