Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15234 > unrolled thread

Variable transformations

Started byNicholas Chisholm <nick.g.chisholm@gmail.com>
First post2013-07-23 08:43 +0000
Last post2013-07-23 21:14 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Variable transformations Nicholas Chisholm <nick.g.chisholm@gmail.com> - 2013-07-23 08:43 +0000
    Re: Variable transformations "Kevin J. McCann" <kjm@KevinMcCann.com> - 2013-07-23 21:14 +0000

#15234 — Variable transformations

FromNicholas Chisholm <nick.g.chisholm@gmail.com>
Date2013-07-23 08:43 +0000
SubjectVariable transformations
Message-ID<kslfml$po0$1@smc.vnet.net>
Say I have some differential equation in terms of the independent variable x and dependent variable f(x). Now say I want to do a coordinate/variable transformation where x=x(u) and I want to write my equation in terms of only u and f(u). By pencil & paper, you can do this by applying the chain rule, but I have a complicated equation and I want to check if I've made an algebra slip-up (it involves several dependent and independent variables and up to 4th order derivatives). Is there any way to automate something like this in Mathematica? I've messed around with replacement rules, but I can't get Mathematica to do things quite how I want.

Thanks!

[toc] | [next] | [standalone]


#15237

From"Kevin J. McCann" <kjm@KevinMcCann.com>
Date2013-07-23 21:14 +0000
Message-ID<ksmrn1$4q$1@smc.vnet.net>
In reply to#15234
Here is some code that I think I found, but may have written, a long 
time ago.

First the Function. The key is the Nest, which takes care of the 
derivatives.

Clear[COV, DEQ, \[Psi], x, z, f, n]
COV::usage =
   "COV[DEQ,\[Psi],x,z,f] changes the independent variable in a \
differential equation from x to z where x=f[z]. \[Psi] is the \
dependent variable or
   		function we are solving for.";

COV[DEQ_, \[Psi]_, x_, z_,
   f_] := (DEQ /. {D[\[Psi][x], {x, n_Integer}] :>
      Nest[(D[#, z]/D[f, z]) &, \[Psi][z], n], \[Psi][x] :> \[Psi][z],
     x :> f}
   		)

Here is an example of the usage:

de = -(\[HBar]^2/(2 m)) \!\(
\*SubscriptBox[\(\[PartialD]\), \({x, 2}\)]\(\[Psi][x]\)\) +
   1/2 m \[Omega]^2 x^2 \[Psi][x] - e \[Psi][x]

COV[de, \[Psi], x, z, \[Alpha] z + \[Beta]]

Hope this helps,

Kevin


On 7/23/2013 4:43 AM, Nicholas Chisholm wrote:
> Say I have some differential equation in terms of the independent variable
>
> Thanks!
>

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web