Another Mathematica Question about Solve Function

  • Context: Mathematica 
  • Thread starter Thread starter Saladsamurai
  • Start date Start date
  • Tags Tags
    Function Mathematica
Click For Summary

Discussion Overview

The discussion revolves around using the Solve function in Mathematica to manipulate an algebraic expression involving variables such as P, G, J, K, and others. The specific goal is to solve for the expression P/G, which participants find challenging due to Mathematica's restrictions on variable naming.

Discussion Character

  • Technical explanation, Debate/contested, Mathematical reasoning

Main Points Raised

  • One participant expresses difficulty in solving for P/G in Mathematica, noting that it does not accept P/G as a valid variable name.
  • Another participant suggests factoring out P from the equation as a potential solution.
  • A different approach is proposed to add another equation, X = P/G, and solve the system of equations for X.
  • Concerns are raised about the use of the '?' in the Solve function, with a participant questioning its purpose and suggesting that a specific variable could be used instead.
  • A later reply proposes substituting G*X for P in the expression as a workaround to solve for X.
  • One participant confirms that the substitution method worked successfully for their problem.

Areas of Agreement / Disagreement

Participants explore multiple approaches to the problem, with no consensus on a single method being the best. Various suggestions are made, and some participants express uncertainty about the functionality of Mathematica.

Contextual Notes

Participants discuss the limitations of Mathematica regarding variable naming and the specific syntax required for solving equations. There is an emphasis on the need for clarity in defining expressions within the Solve function.

Who May Find This Useful

Users of Mathematica, particularly those dealing with algebraic expressions and seeking to understand variable manipulation within the software.

Saladsamurai
Messages
3,009
Reaction score
7
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:
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:
Physics news on Phys.org
Come on now... I know somebody's got this one :smile:
 
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?
 
Winzer said:
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?

Well, yes, of course. I can; but, I want Mathematica to do that for me :smile:
 
Add another equation, X = P/G, and solve the system of 2 equations for X? Worth a try.
 
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.
 
Dick said:
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.

The ? is what I want to solve for, which is not a single variable...it is an expression = P/G
 
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.
 
Yes! Neo's idea worked like a charm. Thanks!
 

Similar threads

  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K