Hello!
Given a = ((k-3) \sqrt{v})/s where k and v are known. I need to solve the following equation for s:
q(a,b) = s\sqrt{v}, \qquad (*),
where b = 1.08148a^2+\epsilon and \epsilon>0 a very small number (for instance \epsilon = 10^{-6}). Furthermore, q(a,b) is the greatest real root of the polynomial
(48a^2+16b)x^4 - (40a^3+168ab)x^3 + (-45a^4+225a^2 b+72b^2)x^2 + (27a^3 b - 162 ab^2)x+27b^3.
How can I solve (*) with Mathematica? I know it should be possible theoretically speaking, since I can determine the roots of the quartic in function of a and I know the expression for a. However, I think the expression q(a,b) might be quite ugly. Perhaps, I should use a numerical algorithm? Is this possible with Wolfram Mathematica?
Thanks in advance!
Cheers
The expression for q is not terribly ugly:
q[a_, b_] =
Max[x /. Solve[((48*a^2 + 16*b)*x^4 - (40*a^3 + 168*a*b)*x^3) +
(-45*a^4 + 225*a^2*b + 72*b^2)*
x^2 + (27*a^3*b - 162*a*b^2)*x + 27*b^3 == 0, x,
Reals]]
but it has a condition b - Root[375 a^8 - 3600 a^6 #1 + 8088 a^4 #1^2 - 6912 a^2 #1^3 + 2048 #1^4 &, 1] < 0, which does not seem to be compatible with your b=1.08148a^2+?:
Show[RegionPlot[
b - Root[375 a^8 - 3600 a^6 #1 + 8088 a^4 #1^2 - 6912 a^2 #1^3 +
2048 #1^4 &, 1] < 0, {a, -2, 2}, {b, -2, 2}],
Plot[1.08148 a^2, {a, -2, 2}]]
unless I misunderstood or made a mistake.
Thanks for the answer Gianluca! I copied your code (q[a_,b_] = …) in Mathematica but Mathematica returns (‘no global maxima found’)? Could you perhaps give the complete output?
The error I made is that it should be b = 1.0848a^2 - \epsilon (instead of +\epsilon). I verified that the quartic polynomial has real roots q if 0<b<1.08148a^2 (probably other regions for b are possible as wel but I only need the positive values for b). The 1.08148a^2 comes from the fact that this is the greatest real root of
2048x^4 - 6912 a^2 x^3+8088 a^4 x^2-3600 a^6 x + 375 a^8
(the root object occurring in the condition for b you obtained). The smallest root of the above polynomial is 0.14674a^2. So, it seems that you obtained b<0.14764a^2 as a condition.
If I have an explicit expression for the root q which is not too messy than I can perhaps use it.
With version 10.4 I get this expression for q[a,b]:
ConditionalExpression[
Max[Root[27 b^3 + (27 a^3 b - 162 a b^2) #1 + (-45 a^4 + 225 a^2 b +
72 b^2) #1^2 + (-40 a^3 - 168 a b) #1^3 + (48 a^2 +
16 b) #1^4 &, 1],
Root[27 b^3 + (27 a^3 b - 162 a b^2) #1 + (-45 a^4 + 225 a^2 b +
72 b^2) #1^2 + (-40 a^3 - 168 a b) #1^3 + (48 a^2 +
16 b) #1^4 &, 2],
Root[27 b^3 + (27 a^3 b - 162 a b^2) #1 + (-45 a^4 + 225 a^2 b +
72 b^2) #1^2 + (-40 a^3 - 168 a b) #1^3 + (48 a^2 +
16 b) #1^4 &, 3],
Root[27 b^3 + (27 a^3 b - 162 a b^2) #1 + (-45 a^4 + 225 a^2 b +
72 b^2) #1^2 + (-40 a^3 - 168 a b) #1^3 + (48 a^2 +
16 b) #1^4 &, 4]],
b - Root[375 a^8 - 3600 a^6 #1 + 8088 a^4 #1^2 - 6912 a^2 #1^3 +
2048 #1^4 &, 1] < 0]
Indeed it seems that my condition for real roots can be simplified to
b < 1/32 (27 - 3 Sqrt[6] - Sqrt[111 + 46 Sqrt[6]]) a^2
The coefficient is 0.146741, which is different from what you found. Perhaps we are not working on the same equation.
If you want I will explain a little bit more background. In fact, the original problem was to solve the system of equations
\begin{cases} 16\mu^4 -40 a \mu^3+(15a^2+24b)\mu^2-18ab\mu + 3b^2 = 0 \\ 5a\mu-4\mu^2-b >0 \\ 15a \mu-20 \mu^2 - 3b < 0 \\ 4\mu^3 - 8 c \mu^2 + 5 a c \mu - c b < 0, \end{cases}
where a<0, c<0 and b all real numbers. In fact, I’m not really interested in a solution of the system but I’m interested in the constraints on a,b and c such that the system yields a real solution. Solving with Mathematica and summarizing leads to the following constraints:
a<0, \begin{cases} \qquad 0<b \leq a^2, \quad q_2<c<0 \\ a^2 < b < 1.08148a^2, \quad q_1<c<0 \end{cases}
where q_1 is the smallest real root and q_2 is the greatest real root of the quartic polynomial from my original post. Now, the parameters a,b and c are given by
a = \frac{(k-3) \sqrt{v}}{s}, \qquad b =\frac{v}{s}(w-10s), \qquad c = s \sqrt{v}.
In my calculations I know the values of s<0, k>3, v>0 and w<0 and hence I know a,b, and c. However, this does not necessarily mean that a,b and c satisfy the constraints. Now, most of the time the value for b or c will not satisfy the constraints (a always does). Therefore, if the constraints are not satisfied, how can I modify s and w such that they are satisfied?