2
$\begingroup$

I have a beautiful equation, where I am trying to compute for R2. I am using Mathematica. So far every single time that I have tried to use Solve[] or Reduce [] the computation takes forever. I hope You can help me what to do with this beauty in order to get a solution. Thank you! Below is my equation.

eq1 = (R2 + ((((p2x - R2*(vac2y + voby)) - (k1x + 
              vox ((vobx ((p2y + R2*(vac2x + vobx)) - k1y) + 
                   voby (k1x - (p2x - R2*(vac2y + voby))))/(-voby*
                    vox + vobx*voy))))^2 + ((p2y + 
              R2*(vac2x + vobx)) - ((p2y + R2*(vac2x + vobx)) - 
              voby ((vox (k1y - (p2y + R2*(vac2x + vobx))) + 
                   voy ((p2x - R2*(vac2y + voby)) - k1x))/(-voby*vox +
                    vobx*voy))))^2)^0.5))/
   v2 == (R1 + (((k1x - (k1x + 
              vox ((vobx ((p2y + R2*(vac2x + vobx)) - k1y) + 
                   voby (k1x - (p2x - R2*(vac2y + voby))))/(-voby*
                    vox + vobx*voy))))^2 + (k1y - ((p2y + 
                R2*(vac2x + vobx)) - 
              voby ((vox (k1y - (p2y + R2*(vac2x + vobx))) + 
                   voy ((p2x - R2*(vac2y + voby)) - k1x))/(-voby*vox +
                    vobx*voy))))^2)^0.5))/v1

edit:

The original system of equations is the following, I simply went on and substituted the variables in the first equation.

eg1 = (R2 + k2c)/v2 == (R1 + k1c)/v1
eg2 = ((k2x - x0)^2 + (k2y - y0)^2))^0.5 == k2c
eg3 = ((k1x - x0)^2 + (k1y - y0)^2))^0.5 == k1c
eg4 = p2x - R2*(vac2y + voby) == k2x
eg5 = p2y + R2*(vac2x + vobx) == k2y
eg6 = k2y - 
   voby ((vox (k1y - k2y) + voy (k2x - k1x))/(-voby*vox + 
        vobx*voy)) == y0
eg7 = k1x + 
   vox ((vobx (k2y - k1y) + voby (k1x - k2x))/(-voby*vox + 
        vobx*voy)) == x0
$\endgroup$
  • $\begingroup$ 1) Have you ever actually obtained an answer from Solve or Reduce? In that case you could calculate once, save the answer, and never have to do it again. 2) Do you necessarily need an analytical solution? or could you give numerical values to the parameters first, and then calculate the solution numerically? I'm sure the latter would be much faster. $\endgroup$ – MarcoB Nov 13 '15 at 17:44
  • $\begingroup$ 1, Yes, if I am using precalculated values for the coefficients I am getting the valid solution. 2, I do need an analytical solution, the values of p2x,p2y,R2,v1,v2 I don't know in advance. $\endgroup$ – jgulacsy Nov 13 '15 at 18:03
  • $\begingroup$ 1) Then there is probably no very simple way to get the result faster (or at all!) in the fully symbolic format. 2) I understand that you don't know those values in advance, but possibly you might know them when you want to use the solution. Perhaps you could explain what you want to do with the analytical solution, and we might come up with an alternative. $\endgroup$ – MarcoB Nov 13 '15 at 18:17
  • $\begingroup$ Do you know that the quantities inside the square roots are positive? $\endgroup$ – march Nov 13 '15 at 18:33
  • $\begingroup$ This is a Analytic geometry problem, where the expressions starting with v (vox,voy) are unit vectors, p2x, and p2y are coordinates for points, R2 is the radius of a circle, v1 and v2 stands for velocity. It is a 4D trajectory planning problem where two objects have to collide, given their initial position,speed and some geometric restrictions. The only parameter that should be modified is R2 the rest is given at the start. The problem is that I need this calculation carried out on a microcontroller, that's why I'm thriving for an analytical solution. $\endgroup$ – jgulacsy Nov 13 '15 at 18:47

Your Answer

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

Browse other questions tagged or ask your own question.