Re: Eliminate works but Solve does not?
- To: mathgroup at smc.vnet.net
- Subject: [mg121536] Re: Eliminate works but Solve does not?
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Sun, 18 Sep 2011 08:27:30 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201109180811.EAA06330@smc.vnet.net>
On 18 Sep 2011, at 10:11, RobertB wrote: > I have a physical problem where I have a system of 9 equations in 10 > unknowns. I am trying to determine the relationship between 2 > unknowns. Here is the system: > > Subscript[y, 3]^2 + Subscript[x, 3]^2 == Subscript[L, 3]^2 && > > Subscript[y, 1]^2 + Subscript[x, 1]^2 == Subscript[L, 1]^2 && > > Subscript[x, 1] + Subscript[x, 3] == 2 && > > Subscript[y, 1] == Subscript[y, 3] - 2 && > > Subscript[y, 4]^2 + Subscript[x, 4]^2 == Subscript[L, 3]^2 && > > Subscript[y, 2]^2 + Subscript[x, 2]^2 == Subscript[L, 1]^2 && > > Subscript[x, 2] + Subscript[x, 4] == 1.6875 && > > Subscript[y, 2] == Subscript[y, 4] - 2 && > > Subscript[y, 4] == Subscript[y, 3] + (0.3125/2) > > Now, when I use Solve[..., {Subscript[L, 1], Subscript[L, 3]}], the > answer is { }. > > However, when I use Eliminate[..., {Subscript[x, 1], Subscript[x, 2], > Subscript[x, 3], Subscript[x, 4], Subscript[y, 1], Subscript[y, 2], > Subscript[y, 3], Subscript[y, 4]}], I get a proper answer, that is, a > function of L_1 and L_3 = another function of L_1 and L_3. > > Even if I add a condition, such as Subscript[L, 1] == 1 to the system, > and Solve (or even NSolve) for Subscript[L, 3], I get { } even though > I know that a solution exists. > > Can anyone explain why Solve/NSolve doesn't seem to do anything? > > Thanks! > First, it is a good idea to use exact numbers when using Solve (if you don't, Solve will in any case rationalise the equations itself and issue a warning): sys=Rationalize[Subscript[y,3]^2+Subscript[x,3]^2==Subscript[L,3]^2&&Subscript[y,1]^2+Subscript[x,1]^2==Subscript[L,1]^2&&Subscript[x,1]+Subscript[x,3]==2&&Subscript[y,1]==Subscript[y,3]-2&&Subscript[y,4]^2+Subscript[x,4]^2==Subscript[L,3]^2&&Subscript[y,2]^2+Subscript[x,2]^2==Subscript[L,1]^2&&Subscript[x,2]+Subscript[x,4]==1.6875&&Subscript[y,2]==Subscript[y,4]-2&&Subscript[y,4]==Subscript[y,3]+(0.3125/2)]; Assuming that you are using Mathematica 8, Solve eliminates variables by means of quantifier elimination - in other words: Solve[Exists[{Subscript[x, 1],Subscript[x, 2],Subscript[x, 3],Subscript[x, 4],Subscript[y, 1],Subscript[y, 2],Subscript[y, 3],Subscript[y, 4]},sys],{Subscript[L,1],Subscript[L,3]}] will return a system without the variables Subscript[x,i] and Subscript[y,i] (provided the system is not self-contradictory). Andrzej Kozlowski
- References:
- Eliminate works but Solve does not?
- From: RobertB <robert.c.baruch@gmail.com>
- Eliminate works but Solve does not?