Up | Next | Prev | PrevTail | Tail |
Author: G. Üçoluk.
The operator changevar does a variable transformation in a set of differential equations. Syntax:
changevar(\(\langle \)depvars\(\rangle \), \(\langle \)newvars\(\rangle \), \(\langle \)eqlist\(\rangle \), \(\langle \)diffeq\(\rangle \)) |
\(\langle \)diffeq\(\rangle \) is either a single differential equation or a list of differential equations, \(\langle \)depvars\(\rangle \) are the dependent variables to be substituted, \(\langle \)newvars\(\rangle \) are the new depend variables, and \(\langle \)eqlist\(\rangle \) is a list of equations of the form \(\langle \)depvar\(\rangle \) =\(\langle \)expression\(\rangle \) where \(\langle \)expression\(\rangle \) is some function in the new dependent variables.
The three lists \(\langle \)depvars\(\rangle \), \(\langle \)newvars\(\rangle \), and \(\langle \)eqlist\(\rangle \) must be of the same length. If there is only one variable to be substituted, then it can be given instead of the list. The same applies to the list of differential equations, i.e., the following two commands are equivalent
changevar(u,y,x=e^y,df(u(x),x) - log(x)); changevar({u},{y},{x=e^y},{df(u(x),x) - log(x)});
except for one difference: the first command returns the transformed differential equation, the second one a list with a single element.
The switch dispjacobian governs the display the entries of the inverse Jacobian, it is off per default.
The mathematics behind the change of independent variable(s) in differential equations is quite straightforward. It is basically the application of the chain rule. If the dependent variable of the differential equation is \(F\), the independent variables are \(x_{i}\) and the new independent variables are \(u_{i}\) (where \(\scriptstyle i=1\ldots n\)) then the first derivatives are:
The first derivative is nothing but the \((j,k)\) th entry of the Jacobian matrix.
So if we speak in matrix language
The 2-dimensional Laplace equation in cartesian coordinates is:
changevar({u},{r,theta},{x=r*cos theta,y=r*sin theta}, {df(u(x,y),x,2)+df(u(x,y),y,2)} );
Here we could omit the curly braces in the first and last arguments (because those lists have only one member) and the curly braces in the third argument (because they are optional), but you cannot leave off the curly braces in the second argument. So one could equivalently write
changevar(u,{r,theta},x=r*cos theta,y=r*sin theta, df(u(x,y),x,2)+df(u(x,y),y,2) );
If you have tried out the above example, you will notice that the denominator contains a \(\cos ^{2} \theta + \sin ^{2} \theta \) which is actually equal to \(1\). This has of course nothing to do with changevar. One has to be overcome these pattern matching problems by the conventional methods REDUCE provides (a rule, for example, will fix it).
Secondly you will notice that your u(x,y) operator has changed to u(r,theta) in the result. Nothing magical about this. That is just what we do with pencil and paper. u(r,theta) represents the the transformed dependent variable.
Consider a differential equation which is of Euler type, for instance:
changevar(y, u, x=e**u, x**3*df(y(x),x,3)- 3*x**2*df(y(x),x,2)+6*x*df(y(x),x)-6*y(x));
and returns the result
df(y(u),u,3) - 6*df(y(u),u,2) + 11*df(y(u),u) - 6*y(u)
Up | Next | Prev | PrevTail | Front |