I have a pair of positive semi-definite matrices $\mathbf{A}_1$ and $\mathbf{A}_2$ and would like to compute a diagonal matrix $\mathbf{S}$ such that $\mathbf{x}^T \mathbf{S} \mathbf{x} \geq \mathbf{x}^T \mathbf{A}_1 \mathbf{x}$ and $\mathbf{x}^T \mathbf{S} \mathbf{x} \geq \mathbf{x}^T \mathbf{A}_2 \mathbf{x}$ for all $\mathbf{x}$. $\mathbf{A}_1$ and $\mathbf{A}_2$ are already close to being diagonal matrices themselves but not quite.
This problem can be visualized as a pair of ellipsoidal scalar fields that are close to being aligned to the coordinate axes and need to be bounded by an ellipsoidal scalar field that is aligned to the coordinate axes. Since the matrices are positive semi-definite the scalar fields could be planar or cylindrical as well.
Any help appreciated.
Edit #1: I need the smallest $\mathbf{S}$ that bounds the two matrices. Allow me to simplify the problem. It suffices to solve this for a single matrix. So what I'm looking for is the smallest diagonal matrix $\mathbf{D}$ that bounds a positive semi-definite matrix $\mathbf{A}$. Thus, $\mathbf{x}^T \mathbf{D} \mathbf{x} \geq \mathbf{x}^T \mathbf{A} \mathbf{x}$ for all $\mathbf{x}$. Then, for $\mathbf{D}_1$, $\mathbf{D}_2$, bounding resp. $\mathbf{A}_1$, $\mathbf{A}_2$, I can simply take the component-wise maximum of $\mathbf{D}_1$ and $\mathbf{D}_2$ as $\mathbf{S}$.
Edit #2: I forgot to mention that I'm looking for a solution for 3x3 matrices. In order for $\mathbf{D}$ to be the smallest bounding diagonal matrix that bounds $\mathbf{A}$, we need to impose that $\mathbf{D} - \mathbf{A}$ be the smallest possible positive semi-definite matrix. This would mean that $\mathbf{M} = \mathbf{D} - \mathbf{A}$ would have $P(\lambda) = \lambda^3$ as characteristic polynomial, since that would result in having only zero as eigenvalue, correct? If we are able to solve $\mathbf{D}$ s.t. $Tr(\mathbf{M}) = 0$, $Tr(\mathbf{M}^2) - Tr(\mathbf{M})^2 = Tr(\mathbf{M}^2) = 0$, and $det(\mathbf{M}) = 0$, then we get the minimal characteristic polynomial. We have a linear, a quadratic, and a cubic equation and three unknown variables, so this should be solvable.
Edit #3: Actually, it could very well be that solving for characteristic polynomial $P(\lambda) = \lambda^3$ only has a solution if $\mathbf{A}$ is itself a diagonal matrix, which is not exactly what I'm shooting for.
Edit #4: If I'm able to do a spectral decomposition on $\mathbf{D} - \mathbf{A} = \mathbf{U} \mathbf{\Lambda} \mathbf{U}^T$, then I would simply be able to solve for a $\mathbf{D}$ that minimizes $\mathbf{\Lambda}$ s.t. $\mathbf{\Lambda} \geq 0$.
It's a very special and simple case of semidefinite programming.
With the MATLAB Toolbox YALMIP and a semidefinite programming solver (Mosek, sdpt3, sedumi etc), you would solve it by
Not too unlikely that there is an explicit analytical solution through some eigenvalue tricks etc (and there are most likely good approximations or even explicit solutions in the book Ellipsoidal calculus for estimation and control by Kurzhanski