Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changing variables within a differential equation

667 views
Skip to first unread message

riccardo benini

unread,
Nov 17, 2009, 5:18:50 AM11/17/09
to
Dear all,

I've been looking for a while on the web for the solution of the following
problem:

given a (partial) differential equation F(y''[x], y'[x], y[x], x)==0 (where
y and x may be though as multidimensional),
how can I correctly set up a change of variables y -> y[g], x -> x[t],
and get an equation in g[t]: F2(g''[t], g'[t], g[t], t)==0?


I think that this is an old problem for the Mathematica community (and
probably settled down),
but I can't figure out how to solve it and write a procedure able to do it.

Thanks in advance,
Riccardo Benini


dh

unread,
Nov 19, 2009, 5:24:30 AM11/19/09
to

riccardo benini wrote:

> Dear all,

>

> problem:

>

>

>

> probably settled down),

>

> Thanks in advance,

> Riccardo Benini

>

>

Hi Riccardo,

if I understand you correctly, you want to change:

y'',y',y,x ==> g'',g',g,t

where:

let us denote:

y[x]: y'=dy/dx,y''=d^2y/dx^2

g[t]: g'=dg/dt,g''=d^2d/dt^2

and the transformations: y= G[g], x=T[t], with G'=dG/dg, T'=dT/dt

With this we have:

y'= dy/dx= (G' g' dt)/(T' dt) = G' g' / T'

y''= d(G' g' / T')/dx= (G'' g'^2/T' + G' g''/T' - G'g'T''/T'^2)/T'

= G'' g'^2/T'^2 + G' g''/T'^2 - G'g'T''/T'^3

If you replace y,y,'y'' in F by the above expressions, you get F2:

F2(g''[t], g'[t], g[t], t) = F(G'' g'^2/T'^2 + G' g''/T'^2 -

G'g'T''/T'^3, G' g' / T', G, T)

Daniel

schochet123

unread,
Nov 25, 2009, 2:30:17 AM11/25/09
to
On Nov 17, 12:18 pm, riccardo benini <riccardo.ben...@gmail.com>
wrote:

> given a (partial) differential equation F(y''[x], y'[x], y[x], x)==0 (where
> y and x may be though as multidimensional),
> how can I correctly set up achangeofvariablesy -> y[g], x -> x[t],

> and get an equation in g[t]: F2(g''[t], g'[t], g[t], t)==0?

The first step is to express first derivatives of new variables with
respect to old ones
in terms of first derivatives of old variables with respect to new
ones. To do this define

dsub[oldvars_List,
newvars_List] := (dsub[oldvars, newvars] =
With[{newofold = Through[newvars[Sequence @@ oldvars]],
oldofnew = Through[oldvars[Sequence @@ newvars]]},
First[Solve[
Flatten[Table[
0 == D[(newofold /. Thread[oldvars -> oldofnew]) - newvars,
var], {var, newvars}] /. Thread[oldofnew -> oldvars]],
Flatten[Table[D[newofold, var], {var, oldvars}]]]]]) /;
Length[newvars] == Length[oldvars]

The second step is to express the first derivative of an arbitrary
function with respect to an old variable
in terms of derivatives with respect to new variables, which can be
done by

transD[f_, oldvars_List, newvars_List, oldvar_] :=
With[{newofold = Through[newvars[Sequence @@ oldvars]],
tmpvars = Table[Unique[], {Length[oldvars]}]},
D[f /. Thread[oldvars -> tmpvars] /. Thread[newvars -> newofold],
oldvar] /. Thread[tmpvars -> oldvars] /.
Thread[newofold -> newvars] /. dsub[oldvars, newvars]] /;
Length[oldvars] == Length[newvars]

Now define your partial differential equation using transD. For
example, the Laplacian is

laplacian[f_, oldvars_, newvars_] :=
Plus @@ Table[
transD[transD[f, oldvars, newvars, var], oldvars, newvars,
var], {var, oldvars}]

To check, calculate

Expand[FullSimplify[
laplacian[
f[r, theta, phi], {x, y, z}, {r, theta,
phi}] /. {x -> (#1 Cos[#2] Sin[#3] &),
y -> (#1 Sin[#2] Sin[#3] &), z -> (#1 Cos[#3] &)}]]

and compare to the known formula for the Laplacian in spherical
coordinates, which may be found at
http://mathworld.wolfram.com/SphericalCoordinates.html

Steve

0 new messages