# How can conditional expressions be used in calculations?

I have a fairly simple system whose solution involves conditional expressions. The system is

A = {{3, 1}, {2, 3}, {1, 5}};
qVec = Array[q, 3];
needs = (qVec^2).A;
k = {2, 3};
Solve[Flatten[{needs == k, Thread[qVec >= 0]}], qVec]


and I get the following output

{{q -> ConditionalExpression[Sqrt[1 - 2 q^2], 0 < q < 1/Sqrt],
q -> ConditionalExpression[Sqrt[3 - q^2 - 3 (1 - 2 q^2)]/
Sqrt, 0 < q < 1/Sqrt]}, {q -> 0, q -> 1,
q -> 0}, {q -> 1/Sqrt, q -> 0, q -> 1/Sqrt}}


I have two questions:

• Why do I get three solutions when inequality signs in the first would include the last two?
• How can I use the ConditionalExpression to obtain a Table of the points solving these equations? I want to do this automatically as A or k change.
• Reduce[{needs == k, qVec >= 0}, qVec] – cvgmt Oct 28 at 9:43

ContourPlot3D shows one solution (intersection of the two surfaces)

ContourPlot3D[Evaluate[needs - k]  ,  {q, 0, 2}, {q, 0, 1}, {q, 0, 2},AxesLabel -> Automatic] The condition for the intersection follows to

cond = Reduce[Flatten[{needs - k == 0, Thread[qVec >= 0]}] , { q}]
(*(0 <= q < 1 && q == Sqrt[1 - q^2]/Sqrt &&q == Sqrt[3 - q^2 - 3 q^2]/Sqrt)
|| (q == 1 &&q == 0 && q == 0)*)