0

I have the following equation -- which is all in terms of d:

{{{{acc == {(d + d (-1 + 1/fpr) (-1 + 1/precision))/(
  d + d (-1 + 1/precision) + d (-1 + 1/fpr) (-1 + 1/precision) + 
   d (-1 + 1/tpr))}}}}}

and I want it to now express this in terms of d. I thought I could use

 Solve[acc, {d}, MaxExtraConditions -> Automatic ]

but I get an error message. Now I could do this by hand, but I'm new to Mathematica. I have read the documentation, but I am unsure what I have missed or got wrong.

m_goldberg
  • 107,779
  • 16
  • 103
  • 257

2 Answers2

2

First off: you have a lot of unnecessary bracket pairs. Your equation should be written

acc == 
  (d + d (-1 + 1/fpr) (-1 + 1/precision))/
    (d + d (-1 + 1/precision) + d (-1 + 1/fpr) (-1 + 1/precision) + 
      d (-1 + 1/tpr))

Second, since d can be eliminated from your equation, you can't get a solution in terms of d.

Eliminate[
 acc == 
   (d + d (-1 + 1/fpr) (-1 + 1/precision))/
     (d + d (-1 + 1/precision) + d (-1 + 1/fpr) (-1 + 1/precision) + 
       d (-1 + 1/tpr)),
   d] // Simplify
fpr precision + tpr - precision tpr != 0 && 
acc == ((1 - fpr - precision + 2 fpr precision) tpr)/
         (fpr precision + tpr - precision tpr)
m_goldberg
  • 107,779
  • 16
  • 103
  • 257
  • Hello! Thanks for help. The unnecessary bracket pairs are what are generated by Mathematica and I have no idea why it does this... so that Solve[tpr == d/(c + d), c generates {{c -> (d - d tpr)/tpr}} - it's not me putting them in! How do I stop these being generated? When I use Eliminate(acc,d) I get an error saying "acc is not a well-formed equation" but if I manually delete all the {{{}}} then the elimination works as @m_goldberg have suggested. – Nick Ryman-Tubb Mar 23 '15 at 16:40
  • @NickRyman-Tubb This explanation should be helpful. – Karsten7 Mar 23 '15 at 17:22
0

First, you use a wrong syntax for Solve. It should be something like

eq = acc == whatever the right hand side is;
Solve[eq, d]

Second, as m_goldberg has pointed out, your equation just can't be solved in terms of d! You must have done something wrong in your hand calculation.

Taiki
  • 5,259
  • 26
  • 34
  • Hello - yes I seem to have eliminated d! Still I cannot work out why my solve seems to generate lots of {{}}! I've only be a user for 15 mins! – Nick Ryman-Tubb Mar 23 '15 at 16:55