When do the solutions of a linear ODE system lie on ellipses? Let $x(t) \in \mathbb{R}^n$ and $A(t)$ be a $n\times n$ matrix. 
When $A(t)$ is a skew-symmmetric matrix, the solutions of the linear system  $\dot{x} = A(t) x$ lie on spheres centered at the origin since
$$
\frac{1}{2} \frac{d}{dt} \lvert x \rvert^2 = \langle \dot{x}, x \rangle = \langle Ax, x \rangle = 0 \implies \lvert x \rvert^2 = \lvert x(0) \rvert^2
$$
Is there a specific class of matrices $A(t)$ for which the solutions lie on ellipses instead?
 A: An $n$-dimensional ellipsoid is defined by an equation of the form
$\displaystyle \sum_1^n a_i x_i^2 = c > 0, \; c \; \text{a constant} \tag 1$
where
$a_i > 0, \; 1 \le i \le n; \tag 2$
if we define the matrix $D$ via
$D = [\delta_{ij} a_i] = \text{diag} (a_1, a_2, \ldots, a_n), \tag 3$
then (1) may be written
$\langle x, Dx \rangle = c, \tag 4$
where $\langle \cdot, \cdot \rangle$ denotes the ordinary Euclidean inner product on $\Bbb R^n$
$\langle x, y \rangle = \displaystyle \sum_1^n x_i y_i.  \tag 5$
Now if $x(t)$ follows a path such that
$\dot x(t) = A(t) x(t) \tag 6$
for some $t$-dependent matrix $A(t)$, then since differentiation of (4) yields
$\langle \dot x(t), Dx \rangle + \langle x(t), D \dot x(t) \rangle = 0, \tag 7$
in accord with (6) we have
$\langle A(t) x(t), Dx(t) \rangle + \langle x(t), D A x(t) \rangle = 0; \tag 8$
we re-arrenge this, thusly, using the symmetry of $\langle \cdot, \cdot \rangle$:
$\langle  Dx(t), A(t) x(t) \rangle + \langle x(t), D A x(t) \rangle = 0,  \tag 9$
and since $D$, being diagonal, is a symmetric matrix, 
$D^T = D, \tag{10}$
$2 \langle x(t), D A(t) x(t) \rangle = \langle x(t), D A(t) x(t) \rangle + \langle x(t), D A x(t) \rangle$
$= \langle x(t), D^T A(t) x(t) \rangle + \langle x(t), DA(t) x(t) \rangle$
$= \langle  D x(t), A(t) x(t) \rangle + \langle x(t), DA(t) x(t) \rangle =  0,  \tag{11}$
i.e., 
$\langle x(t), D A(t) x(t) \rangle = 0; \tag{12}$
by virtue of the fact that we may arbitrarily choose
$x(t) \in \Bbb R^n, \tag{13}$
by if neccessary adjusting $x(0)$ accordingly, we conclude that
$\forall y \in \Bbb R^n, \; \langle y, D A(t) y \rangle = 0, \tag{14}$
which as is well-known forces $DA(t)$ to be skew-symmetric:
$(DA(t))^T = -DA(t); \tag{15}$
this may also be expressed in the form
$A^T(t)D = A^T(t) D^T = (DA(t))^T = -DA(t), \tag{16}$
or
$A^T(t) = -DA(t)D^{-1};  \tag{17}$
we note that for all $t \in \Bbb R$, $A^T(t)$ is similar to $-A(t)$ via conjugation by the matrix $D$.  This condition is seen by the above to be necessary for the motion of $x(t)$ to lie in the ellipsoid (1), (4); however, careful scrutiny of our argument shows that it may be reversed, and thus (17) is also sufficient.
Note Added in Edit, Tuesday 24 December 2019 1:39 PM PST:  Returning to (14)-(15), we show why
$\langle y, Cy \rangle = 0, \; \forall y \in \Bbb R^n \tag{18}$
forces $C$ to be skew-symmetric, that is, 
$C^T = -C; \tag{19}$
for (18) implies
$\langle y + z, C(y +z) \rangle = 0; \tag{20}$
expanding:
$\langle y, Cy \rangle + \langle z, Cy \rangle + \langle y, Cz \rangle + \langle z, Cz \rangle = 0; \tag{21}$
again by virtue of (18),
$\langle z, Cy \rangle + \langle y, Cz \rangle = 0, \tag{22}$
whence
$\langle y, Cz \rangle = -\langle z, Cy \rangle = -\langle C^T z, y \rangle = -\langle y, C^T z \rangle; \tag{23}$
this binds for every $y$, and so also
$Cz = -C^T z \tag{24}$
for every $z$; hence (19)  We may also run this argument in reverse if we observe that (24) yields
$\langle z, Cz \rangle = -\langle z, C^T z \rangle = -\langle Cz, z \rangle = -\langle z, Cz \rangle \Longrightarrow \langle z, C z \rangle = 0. \tag{25}$
End of Note.
