Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Another Mathematica Question about Solve Function

  1. Mar 17, 2009 #1
    Okay, so I have this algebraic expression in terms of P,G,J,K...etc

    I want to solve it for the expression P/G (where I have the "?" below in the code). But Mathematica won't let me do this in the solve function. It says that P/G is not a valid variable name.

    How can I get around this and solve for P/G ?

    Code (Text):
    Solve[((P*L^3)/(3*H*
           J)) - ((5*L^3)/(48*H*J))*((40 L^3 M P)/(384 H J + 5 L^3 M)) -
       G == 0, ?]
     
    Last edited: Mar 17, 2009
  2. jcsd
  3. Mar 17, 2009 #2
    Come on now... I know somebody's got this one :smile:
     
  4. Mar 17, 2009 #3
    Am I reading this right
    [tex] \frac{P L^3}{3 H J}-\left(\frac{5 L^3}{48 H J}right)\left(\frac{40 L^3 M P}{384 H J + 5 L^3 M}\right)-G=0[/tex]
    Can't you just factor out the P?
     
  5. Mar 17, 2009 #4
    Well, yes, of course. I can; but, I want Mathematica to do that for me :smile:
     
  6. Mar 18, 2009 #5
    Add another equation, X = P/G, and solve the system of 2 equations for X? Worth a try.
     
  7. Mar 18, 2009 #6

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    I used to do a lot of Mathematica. Don't anymore. Two g*dd**m expensive. But what does the '?' do in your statement? Can't you specify a variable to solve for in place of that? Like Solve[G+H/P==0,P]. That's what the documentation seems to indicate.
     
  8. Mar 18, 2009 #7
    The ? is what I want to solve for, which is not a single variable...it is an expression = P/G
     
  9. Mar 18, 2009 #8

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    Ohhhhhh. I see. Finally. How about something along the lines of NeoDevin's suggestion. Substitute G*X for P in the expression and then solve for X.
     
  10. Mar 21, 2009 #9
    Yes! Neo's idea worked like a charm. Thanks!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Another Mathematica Question about Solve Function
Loading...