4
$\begingroup$

I have the following equations:

x == 10*Sin[i/10] + j + 0.008*j*j - 30
y == h/2 + j/2*Sin[j/50 - t/50 - i/118] + (i*0.9)*Cos[j/25 - (i + t)/65]

i, h, and t are constant factors.

I'm trying to get y in terms of x and no j in the resulting equation.

Eliminate[{%1, %2}, j]

Gives me a huge set of equations that still has j in them.

What am I doing wrong?

$\endgroup$
5
  • 1
    $\begingroup$ looks strange. Maybe it started with the second equation to solve for j instead of the first one? Manually, you can do it as follows eq1 = x == 10*Sin[i/10] + j + 8/1000*j*j - 30; eq2 = y == h/2 + j/2*Sin[j/50 - t/50 - i/118] + (i*9/10)* Cos[j/25 - (i + t)/65]; solJ = Solve[eq1, j]; eq2 /. solJ which eliminates j. Screen shot !Mathematica graphics $\endgroup$
    – Nasser
    Feb 6 at 11:07
  • 1
    $\begingroup$ You didn't say that you get the warning : "Eliminate::ifun ". The documentations does say "Eliminate works primarily with linear and polynomial equations." not the case here, however, we all have experience using eliminate with non-polynomial expressions. $\endgroup$
    – rhermans
    Feb 6 at 11:12
  • 1
    $\begingroup$ That is good point by rhermans, it explains why it did not do it. It must have started by the second equation which is non-linear. Eliminate is not supposed to be used with non-linear equations. $\endgroup$
    – Nasser
    Feb 6 at 11:33
  • $\begingroup$ Right, sorry I missed that. I'm very new to Mathematica. I didn't quite understand the warning. $\endgroup$ Feb 6 at 12:23
  • 1
    $\begingroup$ @PointlessOne it's OK to not understand things, but it's also important to share ALL you have observed so we can pick up the problem with all the information available. Next time share minimal account of your diligence, test and observations. $\endgroup$
    – rhermans
    Feb 6 at 12:45

1 Answer 1

5
$\begingroup$

Limited scope of Eliminate

The only thing you are doing wrong is to have expectations beyond the capability of Eliminate.

You get the warning

Eliminate::ifun: Inverse functions are being used by Eliminate, so some solutions may not be found; use Reduce for complete solution information.

The documentation reads :

Eliminate works primarily with linear and polynomial equations.

enter image description here

Sometimes Eliminate will work with complicated expressions, but it's only supposed to work with polynomial equations. Other tools like Solve and Reduce sometimes will not find solutions either.

Workaround.

Borrowing from @Nasser in the comments, you can solve for j on one equation and replace on the other. Notice there are two solutions, so I Apply (@@) Or to keep this as a single logical expression.

Reduce[
   Or@@ReplaceAll[
      y ==  h/2 + j/2*Sin[j/50 - t/50 - i/118] + (i*9/10)* Cos[j/25 - (i + t)/65]
      , Echo[Solve[ x == 10*Sin[i/10] + j + 8/1000*j*j - 30, j], "Solutions:", Length]
   ]
   ,{x,y}
]

enter image description here

$\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.