0
$\begingroup$

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[2] -> ConditionalExpression[Sqrt[1 - 2 q[1]^2], 0 < q[1] < 1/Sqrt[2]], 
q[3] -> ConditionalExpression[Sqrt[3 - q[1]^2 - 3 (1 - 2 q[1]^2)]/
Sqrt[5], 0 < q[1] < 1/Sqrt[2]]}, {q[1] -> 0, q[2] -> 1, 
q[3] -> 0}, {q[1] -> 1/Sqrt[2], q[2] -> 0, q[3] -> 1/Sqrt[2]}}

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.
$\endgroup$
  • $\begingroup$ Reduce[{needs == k, qVec >= 0}, qVec] $\endgroup$ – cvgmt Oct 28 at 9:43
0
$\begingroup$

ContourPlot3D shows one solution (intersection of the two surfaces)

ContourPlot3D[Evaluate[needs - k]  ,  {q[1], 0, 2}, {q[2], 0, 1}, {q[3], 0, 2},AxesLabel -> Automatic]

enter image description here

The condition for the intersection follows to

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.