MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Solve vs Reduce

  • To: mathgroup at smc.vnet.net
  • Subject: [mg94698] Re: [mg94627] Solve vs Reduce
  • From: "Jaccard Florian" <Florian.Jaccard at he-arc.ch>
  • Date: Sat, 20 Dec 2008 06:23:47 -0500 (EST)
  • References: <200812181220.HAA00318@smc.vnet.net> <1EF82055-5EB8-4070-9684-56583245EAB2@mimuw.edu.pl> <EEDC4D88C587AB4F96F5E092A0514BE5075E40CA@01-orion.intra.eiaj.ch> <4A1767FA-065E-42D3-AE0D-16981982A54A@mimuw.edu.pl>

Thanks once more.
Let us hope that the programmers of Reduce and Solve will take the time 
to post something about this!

Best regards

F.Jaccard

-----Message d'origine-----
De : Andrzej Kozlowski [mailto:akoz at mimuw.edu.pl]
Envoy=E9 : vendredi, 19. d=E9cembre 2008 12:18
=C0 : Jaccard Florian
Cc : mathgroup at smc.vnet.net
Objet : Re: [mg94627] Solve vs Reduce

Dear Jaccard,

I think what Reduce and Solve do in such cases is to try to eliminate 
variables, much like one does at school although by somewhat different 
means (GroebnerBasis etc). Sometimes as a result of substitution that 
is performed during elimination a derivative is evaluated. In such a 
case you may end up with an inconsistent set of (algebraic) equations 
and then both Solve and Reduce will notice that the equations are 
inconsistent. Sometimes, however, the equations are brought to a final 
("reduced") form without any differentiation taking place. In that 
case, even if the equations are inconsistent "as differential 
equations", this will not be visible to Reduce or Solve because they 
are only aware of algebraic inconsistency.
Whether the system is reduced to an algebraically inconsistent form or 
not depends on the order in which the various eliminations are 
performed and the final form that is considered by Solve and Reduce as 
not requiring any further transformations. In both cases (Solve and 
Reduce) which variables you explicit state as the variables to be 
solved (or reduced) for affects both the order of elimination and the 
final form that is returned, but Reduce and Solve use different 
conventions. I am not sure if this is deliberate or just a side effect 
of the fact that Reduce and Solve have been largely programmed by two 
different persons (both well known to the regular readers of the 
MathGroup). Any more detailed information on this matter would have to 
come form one of them ;-)

With best regards

Andrzej Kozlowski


On 19 Dec 2008, at 16:45, Jaccard Florian wrote:

> Dear Andrzej,
>
> Thank you very much for your answer, and the time you take to help me.
> I'm still surprised with the way Reduce works...
> In fact, looking at your answer, I understand better why 
> Mathematica's Output is consistent in this case :
>
> In[1]:= equations = {5/(x + y) == 2/y,Dt[5/(x + y) == 2/y, =
t],Dt[x, 
> t] == 1, x == 5};
> In[2] := Reduce[equations, Dt[y, t]]
>
> Out[2]= False
>
> But why do I obtain the expected answer if I specify more variables 
> to be solved for?
>
> In[3]:= Reduce[equations, {Dt[y, t],Dt[x, t], x, y}]
>
> Out[3]= Dt[y, t] == 2/3 && Dt[x, t] == 1 && x == 5 && y =
== 10/3
>
> Here, Mathematica won't express one of the derivatives in terms of 
> the other and y in terms of x...
> Isn't it strange that Reduce sees a contradiction in In[2], but not 
> in In[3] ?
>
> Also funny :
>
> If I use Solve in the configuration where Reduce sees a 
> contradiction, Solve doesn't see one:
>
> In[4]:= Solve[equations, Dt[y, t]]
>
> Out[4]= {{Dt[y, t] -> 2/3}}
>
> But if I use Solve where Reduce doesn't see a contradiction, Solve 
> sees one:
>
> In[5]:= Solve[equations, {Dt[y, t],Dt[x, t], x, y}]
>
> Out[5]= {}
>
> Even after a long time using Mathematica, I'm surprised!
>
> Best Regards, and Merry Christmas!
>
> Florian Jaccard
>
>
> -----Message d'origine-----
> De : Andrzej Kozlowski [mailto:akoz at mimuw.edu.pl]
> Envoy=E9 : vendredi, 19. d=E9cembre 2008 02:04
> =C0 : Jaccard Florian
> Cc : mathgroup at smc.vnet.net
> Objet : Re: [mg94627] Solve vs Reduce
>
>
> On 18 Dec 2008, at 21:20, Jaccard Florian wrote:
>
>> Hello!
>>
>> I have the following system :
>>
>> In[1]:= equations = {5/(x + y) == 2/y, Dt[5/(x + y) == =
2/y, =
>> t], Dt[x, t]
>> == 1, x == 5}
>>
>> As you can see, Solve manages very well to find Dt[y,t] :
>>
>> In[2]:= Solve[equations, Dt[y, t]]
>>
>> Out[2]= {{Dt[y, t] -> 2/3}}
>>
>> Why isn't Reduce able to find the solution?
>>
>> In[3]:= Reduce[equations, Dt[y, t]]
>>
>> Out[3]= False
>>
>> Regards, and thanks to all who will answer!
>>
>> Florian Jaccard
>>
>>
>
>
> The reason is (I am speculating here a bit) that Reduce attempts to
> solve all kind of equations, not essentially algebraic ones, so it
> does treat the derivatives in your equations as such rather than as
> mere names of variables occurring in the equations. Taking this into
> account your two equations
>
> In[42]:= Reduce[{Dt[x, t] == 1, x == 5}]
> Out[42]= False
>
> appear to be inconsistent, since the derivative of a constant can't be
> one.
>
> If you remove the equation Dt[x, t] == 1,the system will be =
solved:
>
>  Reduce[{5/(x + y) == 2/y,
>      -((5*(Dt[x, t] + Dt[y, t]))/(x + y)^2) ==
>        -((2*Dt[y, t])/y^2), x == 5}, {y, x, Dt[y, t]}]
>  y == 10/3 && x == 5 && Dt[y, t] == 0
>
> Note that this is a consistent solution (y is a constant and hence
> Dt[y,t]==0). If you include both Dt[x,t] and Dt[y,t] in the list =
of
> variables you will get a different looking solution:
>
>  Reduce[{5/(x + y) == 2/y, -((5*(Dt[x, t] + Dt[y, t]))/(x + y)^2) =
==
>        -((2*Dt[y, t])/y^2), x == 5}, {y, x, Dt[y, t], Dt[x, t]}]
>  y == 10/3 && x == 5 && Dt[x, t] == (3*Dt[y, t])/2
>
> Note that this is also consistent (even though both Dt[x, t] and Dt[y,
> t] must actually be zero).
>
> Also, note that if you removed from the system the equation x==5
> instead of Dt[x,t]==1 you will not get a solution:
>
>  Reduce[{5/(x + y) == 2/y, -((5*(Dt[x, t] + Dt[y, t]))/(x + y)^2) =
==
>     -((2*Dt[y, t])/y^2), Dt[x, t] == 1}, Dt[y, t]]
> During evaluation of In[39]:= Reduce::nsmet:This system cannot be
> solved with the methods available to Reduce. >>
>  Reduce[{5/(x + y) == 2/y,
>    -((5*(Dt[x, t] + Dt[y, t]))/(x + y)^2) ==
>     -((2*Dt[y, t])/y^2), Dt[x, t] == 1}, Dt[y, t]]
>
> This is not surprising since in order to compute Dt[y,t], you would
> need to solve a differential equation, which it does not do. However,
> if you include both Dt[y,t] and Dt[x,t] among the variables to be
> solved for the system will be solved, since Reduce will now express
> one of the derivatives in terms of the other and y in terms of x (so
> it does not have to express them in terms of t)
>
> Reduce[{5/(x + y) == 2/y,
>      -((5*(Dt[x, t] + Dt[y, t]))/(x + y)^2) ==
>        -((2*Dt[y, t])/y^2), Dt[x, t] == 1},
>    {Dt[y, t], Dt[x, t], x, y}]
>  Dt[y, t] == 2/3 && Dt[x, t] == 1 && y == (2*x)/3 &&
>    x != 0
>
> Finally, instead of the differential equation Dt[x, t] == 1 you =
use
> one of its solutions, for example, x==t, you will get:
>
> Reduce[{5/(x + y) == 2/y, -((5*(Dt[x, t] + Dt[y, t]))/(x + y)^2) =
==
>        -((2*Dt[y, t])/y^2), x == t}, {Dt[y, t], x, y}, Reals]
>
> (t < 0 || t > 0) && Dt[y, t] == 2/3 && x == t &&
>    y == (2*x)/3
>
> or
>
> Reduce[{5/(x + y) == 2/y, -((5*(Dt[x, t] + Dt[y, t]))/(x + y)^2) =
==
>        -((2*Dt[y, t])/y^2), x == t}, {Dt[y, t], Dt[x, t], x, y}, 
> Reals]
>
> (t < 0 || t > 0) && Dt[x, t] == (3*Dt[y, t])/2 &&
>    x == t && y == (2*x)/3
>
> All of these look to me like valid and useful answers, demonstrating
> that Reduce can be used even in contexts in which I would not have
> tried to use it before I saw your post ;-)
>
> Andrzej Kozlowski
>
>
>



  • References:
  • Prev by Date: Re: Need Help
  • Next by Date: Re: Solve vs Reduce
  • Previous by thread: Re: Solve vs Reduce
  • Next by thread: Re: Solve vs Reduce