Another Mathematica Question about Solve Function

In summary, Mathematica won't let me solve for P/G because it thinks the variable name is not valid. Neo's suggestion of substituting G*X for P worked.
  • #1
Saladsamurai
3,020
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
  • #2
Come on now... I know somebody's got this one :smile:
 
  • #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?
 
  • #4
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:
 
  • #5
Add another equation, X = P/G, and solve the system of 2 equations for X? Worth a try.
 
  • #6
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.
 
  • #7
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
 
  • #8
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.
 
  • #9
Yes! Neo's idea worked like a charm. Thanks!
 

1. What is the syntax for using the Solve function in Mathematica?

The syntax for the Solve function in Mathematica is as follows: Solve[equation, variables]. The equation should be written in the form of "expression = 0", and the variables should be listed within curly braces {}.

2. How does the Solve function work?

The Solve function in Mathematica uses a combination of algebraic and numerical methods to find exact or numeric solutions to a given equation. It essentially tries to isolate the variables in the equation and solve for their values.

3. Can the Solve function handle complex equations?

Yes, the Solve function in Mathematica can handle complex equations, as long as they are written in a valid syntax and the variables are specified correctly.

4. Are there any options that can be used with the Solve function?

Yes, there are several options that can be used with the Solve function in Mathematica, such as specifying the domain or assuming certain conditions for the variables. These options can be added as a third argument in the syntax.

5. How accurate are the solutions provided by the Solve function?

The accuracy of the solutions provided by the Solve function depends on the complexity of the equation and the specified options. In general, it is recommended to check the solutions for accuracy and to use numerical methods for more precise results.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
120
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
248
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
Back
Top