Why cvx cannot solve the following problem:

```
cvx_solver sdpt3
cvx_begin quiet
variable S(m,m) symmetric;
S == semidefinite(m);
minimize (trace(S)+trace_inv(square(S)));
cvx_end
```

After running this I get the following error:

```
??? Error using ==> cvx.trace_inv at 9
Input must be affine.
```

Actually the function f(S)=\mathrm{trace}(S)+\mathrm{trace}(S^{-2}) where S\in \mathcal{M}_{m,m} symmetric positive definite is convex because

\frac{\partial^2 f}{\partial S^2}=6S^{-4} is symmetric positive definite.

So I wonder why the input of trace_inv should be affine.

I even tried to solve the problem in different manner as follow:

```
cvx_solver sdpt3
cvx_begin quiet
variable Q(m,m) symmetric;
Q == semidefinite(m);
minimize (trace_sqrtm(Q) + trace_inv(Q));
cvx_end
S=sqrtm(Q);
```

but I got the following error:

```
??? Undefined function or method 'schur' for input arguments of type 'cvx'.
Error in ==> sqrtm at 33
[Q, T] = schur(A,'complex'); % T is complex Schur form.
```

This means that the principal square root matrix of Q, i.e. sqrtm(Q), has some complex entries which is impossible since Q is Symmetric Positive Definite matrix whose eigenvalues have nonnegative real part.