I am trying witout success to make a change of variables in a partial derivative of a function of 2 variables (for example the time coordinate “t” and the lenght coordinate “z”), like
fu:= f[t,z]
dfu:= D[fu,{{t,z}}]
Then I want to rescale the t and z coordinates (something that is useful for example to simplify equations in fluid mechanics), defining the new variables: z0=z/L; t0= t*u/L
Unfortunately, this substitution does not work because I am actually differentiating with respect to functions of the original t and z variables, so the program send and error message like: “z/L is not a valid variable”
After some reading of calculus textbooks, I found that I need to apply the chain rule. The problem with this is twofold:
The formulae are a bit messy, like these in the Wilfred Kaplan (2002) textbook:
Those formulae have either explicit sums or products of Jacobian matrices, and while constructing Jacobians from substitution rules (like the reascaling ones above) is rather easy, I still don’t undestand how to implement the full formulae in Mathematica.
I would greatly appreciate you help.
Nota bene: maybe someone else posted something similar before (my apologies if it is the case) , I just don’t know yet how to seach by keywords in the forum.
Tim Laska suggestion works very fine for rescaling transformations, but I’m not sure if it is enough for “mixed variables” transformations like:
t0 = t - x/u ( t0, t = time, x = lenght, u = velocity)
As the new time coordinate (useful for example to simplify some wave equations) mixes the “original” x and t coordinates.
The function DChange of Kuba Podkalicki looks just like what I was looking for, but I’m afraid of some software compatibility issues if I download the package. Could it cause some problems/damage to the original Mathematica language, specially for newer versions like Mathematica 12 (not to mention future versions in coming years)?
This package (“MoreCalculus`”) is a very simple one, it only introduces DChange function and there is not built-in DChange symbol so you don’t need to worry about it.
Will there ever be a built-in DChange symbol? Who knows, maybe, maybe not, I suppose WRI will pick a better name for such a function.