Selecting roots found by Solve[]

  • Thread starter Thread starter mt-squared
  • Start date Start date
  • Tags Tags
    Roots
AI Thread Summary
To find only the positive roots of the equations f(x,y) = 0 and g(x,y) = 0 using Solve in Mathematica, users can set assumptions for x and y to be non-negative. By utilizing the $Assumptions variable with conditions x >= 0 and y >= 0, the results can be refined or simplified to ensure only positive roots are considered. The commands Refine and FullSimplify can be employed to apply these assumptions effectively. Additionally, users can assert the positivity of x and y directly in the Solve function. This approach streamlines the process of identifying the desired positive roots from the solutions.
mt-squared
Messages
1
Reaction score
0
Hi All,

I am using Solve[{f(x,y)==0,g(x,y)==0},{x,y}] to find "x,y" roots of "f" and "g" functions. I am only interested in positive "x" and "y" roots, ignoring all the other. Is there a way to use "Select" command to find all positive roots?

Thanks.
 
Physics news on Phys.org
Yes, just substitute x and y back into f and g and see which are positive.
 
if this is mathematica 6 or above, try

$Assumptions= x>=0&&y>=0;
Refine[Solve[{f(x,y)==0,g(x,y)==0},{x,y}] ]
or
FullSimplify[Solve[{f(x,y)==0,g(x,y)==0},{x,y}] ]

Those two should apply the assumptions. Or maybe:

$Assumptions= x>=0&&y>=0;
Solve[{FullSimplify[f(x,y)==0],FullSimplify[g(x,y)==0]},{x,y}]

so that it asserts x,y>0
 

Similar threads

Replies
1
Views
2K
Replies
1
Views
2K
Replies
4
Views
1K
Replies
2
Views
1K
Replies
13
Views
2K
Replies
1
Views
2K
Replies
2
Views
3K
Back
Top