Solving for variable inside rational root

97 Views Asked by At

$$ X = \frac{2VA}{J} + \frac{A^3}{J^2} + \frac{D^3}{Q^2} $$ $$ \frac{D^2}{Q} = V + \frac{A^2}{J} $$

I have two equation two unknowns that I ultimately need to solve. The two unknowns are $A$ and $D$, assume all other variables are known. I am looking for a solution that is $A = f(X,V,J,Q)$ or $D = f(X,V,J,Q)$.

To help you get to the solution that I am looking for, I will add more information.

  1. X,V, J, and Q will be user define to help us build a trajectory. Therefore, the solution should be in terms of X,V, J and Q.
  2. Solution is able to execute in one pass. No loop, no recursion.
  3. Numerical approximation is allowed only if the solution is in terms of X,V, J and Q. Approximation should be correct up to at least 5 decimal place. a. Example: A is approximately $120.000000589$ when X,V, J and Q values are plugged in however the correct solution is $120$.

What method are there to solve for variables inside rational root. I tried to solve for $D$, $D = \sqrt{Q(V+\frac{A^2}{J})}$, but then it becomes hard to solve for $A$.

I tried Wolfram and the solution returned the form Root[#1^6 + #1^2 &, 1]. My understanding is that if I plugged 1 into (#1), I can get a possible answer. I tried to plug in all 6 roots and all of them are incorrect with my check case.

My Wolfram code: 1

If it will help, X, V, J, and Q should all be $> 0$. I do not have access to Matlab.

3

There are 3 best solutions below

15
On

i would compute $D$ from the second equation: $$D=\pm\sqrt{VQ+\frac{A^2Q}{J}}$$ and plug this in the first equation.Then we get $$XQ^2-2\frac{VAQ^2}{J}-\frac{A^3Q}{J^2}=\left(VQ+\frac{A^2Q}{J}\right)^{3/2}$$ now you can square this equation and then you will get a polynomial in $A$ Simplifying we get $$-\frac{Q^2 \left(A^6 J Q-A^6+3 A^4 J^2 Q V-4 A^4 J Q V+2 A^3 J^2 Q X+3 A^2 J^3 Q V^2-4 A^2 J^2 Q^2 V^2+4 A J^3 Q^2 V X-J^4 Q^2 X^2+J^4 Q V^3\right)}{J^4}=0$$

0
On

You are correct that a direct approach yields a sixth degree polynomial in $A$, which we cannot generally solve. The usual approach then involves numeric approximation and recursion, which you have not allowed. If it is not impossible, presumably you are worried that it will be too slow. Please give it a try, you might be surprised.

If you can't do successive approximations, you are basically down to interpolating a table. Are all your parameters able to vary over a range, or are some of them chosen from a fixed list? For example, they might be designing a space ship and there are four models to choose from that give the mass. That will reduce the dimension of the interpolation. The narrower the range of your parameters, the better. You will need to calculate $A$ and $D$ over a grid and then interpolate for the actual parameter values. The grid has to be small enough to meet your accuracy requirement. Doing cubic spline interpolation can save you a lot of storage at the price of a little more calculation if your functions are smooth enough. Section 3.6 of Numerical Recipes and many other numerical analysis texts have a discussion.

2
On

Too long for a comment.

The fact that you need to solve a sixth degree polynomial is the key problem and, as already said, an explicit solution would be impossible in most (not to say all) cases. However, there are plenty of available subroutines which would do the job.

Concerning notations, for more efficiency, I think that we could rewrite the equations as $$X=2V \left(\frac A J \right)+J\left(\frac A J \right)^3+ Q\left(\frac D Q \right)^3\tag 1$$ $$Q\left(\frac D Q \right)^2=V+J \left(\frac A J \right)^2\tag 2$$ and define $\alpha=\frac A J$ and $\beta= \frac D Q $ giving $$X=2V\alpha+J \alpha^3+Q \beta^3\tag 3$$ $$Q \beta^2=V+J \alpha^2\tag 4$$ Now, using $(3)$ and $(4)$

$$X=2V\alpha+J \alpha^3+Q \beta^3=2V\alpha+J \alpha^3+(Q \beta^2)\beta=2V\alpha+J \alpha^3+(V+J\alpha^2)\beta\tag 5$$ from which $$\beta=\frac{X-\alpha V}{J\alpha ^2 +V}-\alpha\tag 6$$ Plug in $(4)$, simplify to get $$\sum_{k=0}^6 c_k \,\alpha^k=0$$ where $$c_0=Q X^2-V^3\qquad c_1=-4QVX\qquad c_2=V^2 (4 Q-3 J)\qquad c_3=-2 J Q X$$ $$c_4=J V (4 Q-3 J)\qquad c_5=0\qquad c_6=J^2 (Q-J)$$

I do not know if you can face the case where $Q=J$; in such a situation, the problem reduces to a quartic for which $$\Delta=-16 J^6 \left(J X^2+V^3\right)^3 \left(27 J X^2+25 V^3\right) <0$$ Then, for this specific case, the equation has two distinct real roots (you will need to decide which root to select) and two complex conjugate non-real roots.