1
$\begingroup$

I am solving a problem using Reduce, and having a difficulty with understanding the answers I obtained. I was solving Reduce[abcd[q] = 0, q] where

abcd[q_]=-0.003 + (800 a^3)/(3 q^3) - (400 a^2 Sqrt[(a^2 + k q)/q^2])/(
 3 q^2) - (100 k (k/q^2 - (2 (a^2 + k q))/q^3))/(
 3 Sqrt[(a^2 + k q)/q^2]) + (200 a^2 (k/q^2 - (2 (a^2 + k q))/q^3))/(
 3 q Sqrt[(a^2 + k q)/q^2])

It gave me back with 4 solutions - two real, two imaginary numbers. I put $a=1/4$, $k=1/10$ in the solutions, and obtained following numbers:

-26.8555 - 43.5291i
-26.8555 + 43.5291i
  4.8813
 48.2047

I put these numerical solutions back into abcd[q] with $a=1/4$, $k=1/10$, and obtained the following values:

-0.00593796 + 5.4479*10^-6 i
-0.00593796 - 5.4479*10^-6 i
 0.0656495
-1.30104*10^-18

Here is my first problem:

  1. While the fourth solution looks sufficiently close to $0$, others do not really seem so. What's happening? Aren't they supposed to be solutions?

Perplexed, I tried to obtain using different approach: first, I put $a=1/4$, $k=1/10$ in abcd[q] and then tried Reduce[abcd[q] = 0, q]. This gave me back a unique solution that coincides with the fourth solution, $48.2047$.

To double check, I plotted abcd[q] with parameters $a=1/4$, $k=1/10$ and domain $[0, 100]$. It displayed a monotone decreasing function that intersects zero at $q=48.2047$. At $q=4.8813$, abcd[q] was in fact strictly positive, perhaps $0.0656495$ as calculated above. In sum, it strongly seems that $q=48.2047$ is the right answer.

Here comes my second question:

  1. It seems that $q=48.2047$ is the right answer. Why did I get the other three answers from Reduce?
$\endgroup$
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – Michael E2 Nov 8 '15 at 15:10
  • $\begingroup$ You can format inline code and code blocks by selecting the code and clicking the {} button above the edit window. The edit window help button ? is also useful for learning how to format your questions and answers. You may also find this this meta Q&A helpful $\endgroup$ – Michael E2 Nov 8 '15 at 15:10
0
$\begingroup$

The solutions you obtained from Reduce are not valid for all combinations of values of your parameters $a$ and $k$.

Since you seem to be interested in real solutions, I will directly introduce that restriction to Reduce. It may then be informative to take a look at the results of Reduce that include conditions on the values of $a$ and $k$ for which the solutions returned are valid (the following was hand-formatted for legibility):

realsolutions = Reduce[abcd[q] == 0, q, Reals, Quartics -> False, Cubics -> False];
Shallow[realsolutions, 8]

(
 k < 0 && (
         (Root[<<1>>&,1]<a<Root[<<1>>&,1] && q==Root[<<1>>&,2])
         ||
         (Root[<<1>>&,1]<=a<=0&&q==Root[<<1>>&,1])
         ||
         (0<a<Root[<<1>>&,1]&&(q==Root[<<2>>]||q==Root[<<2>>]))
         ||
         (a==Root[<<1>>&,1]&&q==Root[<<1>>&,1])
        )
)
||
(
 k > 0 && (
         (a==Root[<<1>>&,2]&&q==Root[<<1>>&,1])
         ||
         (Root[<<1>>&,2]<a<0&&(q==Root[<<2>>]||q==Root[<<2>>]))
         ||
         (0<=a<Root[<<1>>&,2]&&q==Root[<<1>>&,2])
         ||
         (Root[<<1>>&,2]<=a<Root[<<1>>&,1]&&q==Root[<<1>>&,1])
        )
)

As you can see, there are no general expressions for the solutions that are independent of the values of the parameters $a,k$; Reduce returns a set of logical conditions for the solutions depending on the values of $k$ and $a$.

If you are interested in specific solutions for certain values of the parameters, you can use e.g. Refine together with any constraints on the parameter values to obtain the valid solution only.

For instance, in the case of $a=1/4$, $k=1/10$:

specificsolution = Refine[realsolutions, a == 1/4 && k == 1/10]
N@specificsolution

(* Out: 
   q == Root[398875000 - 81800000 #1 + 405 #1^3 + 648 #1^4 &, 2]
   q == 48.2047
*)
$\endgroup$
  • $\begingroup$ Thank you very much!!! It was very helpful. To restate your words: "all the four solutions are correct on some regions, but not on all regions" Is this right? Also, could you tell me about the notations such as <<1>>& and <<2>> ? I'm playing with the solution with myself, but I am not really getting what those symbols mean. $\endgroup$ – ChangHwa Lee Nov 10 '15 at 15:04
  • $\begingroup$ @ChangHwaLee Yes, that is what I mean. The <<1>> notation is called Skeleton notation; it is just shorthand for omitted parts of a complex expression. See its documentation here. $\endgroup$ – MarcoB Nov 10 '15 at 16:04
  • $\begingroup$ Thank you, MarcoB! You saved my life, and paper! Thank you! $\endgroup$ – ChangHwa Lee Nov 10 '15 at 17:28
  • $\begingroup$ @ChangHwaLee I'm very glad it helped. If you think that my post answers your question, I'd appreciate it if you would consider accepting it formally by clicking the grey checkmark button next to it. $\endgroup$ – MarcoB Nov 10 '15 at 17:30
  • $\begingroup$ Sorry for being late. I wasn't aware of how this system works. Thank you for your answer and for telling me how to accept an answer. Wish this helps you! Thank you, again :) $\endgroup$ – ChangHwa Lee Nov 11 '15 at 17:15

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.