MathGroup Archive 1992

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

Search the Archive

Re: Question about changing variables in PDEs

  • To: mathgroup <mathgroup at yoda.physics.unc.edu>
  • Subject: Re: Question about changing variables in PDEs
  • From: amrhein <amrhein at math.ethz.ch>
  • Date: Wed, 28 Oct 1992 09:22:07 +0100

-----------------
> I have a system of PDE's in in three dependent and two independent
>        variables.  For example:


>        { Dt[f,x] + f Dt[g,t] - f g,
          Dt[f,x,t] - Dt[h,x]^2,
          Dt[g,x] + Dt[h,t]}

> In[1]:= d = Dt[f,x] + Dt[g,x]

> Out[1]= Dt[f, x] + Dt[g, x]

> In[2]:= d /. Dt[y_,x] -> Dt[y,r]

> Out[2]= Dt[f, x] + Dt[g, x]
---------------------------

The reason why this rule doesn't work is, that the expressions have totaly
different FullForms.

e.g.

 FullForm[ Dt[f,x]]

 //FullForm= Dt[f, x]

 FullForm[ Dt[f,x_]]

 //FullForm= Dt[f, Pattern[x, Blank[]]]

 FullForm[ Dt[f_,x_]]
Times[Dt[x, y], Derivative[1, 0][Pattern][x, Blank[]]]

FullForm[ Dt[f,x_]]

//FullForm= 
 
>   Times[Dt[f, Pattern[x, Blank[]]], Derivative[1, 0][Pattern][f, Blank[]]]


One possible way to make Mathematica match the pattern, is the following:


Dt[f,x] + Dt[g, x]  /.  g_[u_,x] :> T[u,x] //. T[u_,x] :> T[u,r] //.
                          T[u_,v_] :> Dt[u,v]

After having changed the heads of the expresstions, Mathematica doesn't
evaluate Dt[f_,x].


In[1]:= { Dt[f,x] + f Dt[g,t] - f g,
          Dt[f,x] - Dt[h,x]^2,
          Dt[g,x] + Dt[h,x]};                

In[2]:=  % /.  g_[u_,x] :> T[u,x] //. T[u_,x] :> T[u,r] //.
                          T[u_,v_] :> Dt[u,v]        
                                                            2
Out[2]= {-(f g) + Dt[f, r] + f Dt[g, t], Dt[f, r] - Dt[h, r] , 
 
>    Dt[g, r] + Dt[h, r]}






  • Prev by Date: Re: Elliptic integral problems in mma
  • Next by Date: Listable vs. Thread
  • Previous by thread: Question about changing variables in PDEs
  • Next by thread: Re: Question about changing variables in PDEs