Application Center - Maplesoft

App Preview:

Conversion linear partial differential equations with two variables to canonical form

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

pdetocan2.mws

Conversion linear partial differential equations
with two variables  to canonical form

by Aleksas Domarkas

Vilnius University, Faculty of Mathematics and Informatics,

Naugarduko 24, Vilnius, Lithuania

aleksas@ieva.mif.vu.lt

NOTE: In this session we find change of variables which reduct linear second-order partial differential equation with two variables to canonical form.

Introduction

>    restart;with(linalg):

Warning, the protected names norm and trace have been redefined and unprotected

Program mcan  find change of variables which reduct linear second-order partial differential equation

 with two variables x  , y   to canonical form.

Program chvar  reduct equation to canonical form

>   

coeffs

Coefficients of equations a*u[xx]+b*u[xy]+c*u[yy]+d*u[x]+e*u[y] = 0 :

>    K||1 := 1,-2,-3,0,1:

>    K||2 := 1,-6,10,1,-3:

>    K||3 := 4,4,1,0,-2:

>    K||4 := 1,0,-x,0,0:

>    K||5 := 1,0,-y,0,0:

>    K||6 := x,0,-y,0,0:

>    K||7 := y,0,-x,0,0:

>    K||8 := x^2,0,y^2,0,0:

>    K||9 := y^2,0,x^2,0,0:

>    K||10 := y^2,0,-x^2,0,0:

>    K||11 := 1+x^2,0,1+y^2,0,y:

>    K||12 := 4*y^2,0,-exp(2*x),-4*y^2,0:

>    K||13 := 1,-2*sin(x),2-cos(x)^2,0,0:

>    K||14 := y^2,2*y,1,0,0:

>    K||15 := x^2,-2*x,1,0,0:

>    K||16 := x,2*x,x-1,0,0: #[bic] 90.

>    K||17 := 1,-2*sin(x),-cos(x)^2,0,-cos(x):

>    K||18 := (1+x^2)^2,0,1,2*x*(1+x^2),0:

>    K||19 := exp(2*x),2*exp(x+y),exp(2*y),0,0:

>    K||20 := sin(x)^2,-2*y*sin(x),y^2,0,0:

>    K||21:=1,0,x*y,0,0:

>    K||22:=sin(x)^2,0,y^2,0,0:

>    K||23:=sin(x)^2,0,cos(y)^4,0,0:

mcan

>    mcan := proc(equ)
option `Copyright Aleksas Domarkas, 2000`;
local A, itr, t, i, mu, eq;
    eq := lhs(equ) - rhs(equ);
    A := linalg[matrix](2, 2, [
        coeff(eq, diff(u(x, y), x, x)),
        1/2*coeff(eq, diff(u(x, y), x, y)),
        1/2*coeff(eq, diff(u(x, y), x, y)),
        coeff(eq, diff(u(x, y), y, y))]);
    simplify({solve(A[1, 1]*z^2 - 2*A[1, 2]*z + A[2, 2], z)});
    simplify(%, power);
    simplify(%, power, symbolic);
    subs(y = y(x), %);
    if type(%[1], `*`) and has(%[1], y) and has(%[1], I) then
        mu := 1/select(has, %[1], y);
        {seq(
            int(expand((diff(y(x), x) + %%[i])*mu), x) = _C1,
            i = 1 .. nops(%%))}
    else {seq(dsolve(diff(y(x), x) = %[i], y(x)),
        i = 1 .. nops(%))}
    end if;
    subs(y(x) = y, %);
    {seq(solve(%[i], _C1), i = 1 .. nops(%))};
    if nops(%) = 1 and not hastype(%, nonreal) then
        itr := {eta = y, xi = %[1]}; t := parabolic
    elif not hastype(%, nonreal) then
        itr := {xi = 1/2*%[1] + 1/2*%[2],
            eta = 1/2*%[2] - 1/2*%[1]};
        t := hiperbolic
    else
        itr := {eta = %[1] - I*coeff(%[1], I),
            xi = coeff(%[1], I)};
        t := elliptic
    end if;
    itr := simplify(itr);
    RETURN(itr, t)
end proc;

mcan := proc (equ) local A, itr, t, i, mu, eq; option `Copyright Aleksas Domarkas, 2000`; eq := lhs(equ)-rhs(equ); A := linalg[matrix](2,2,[coeff(eq,diff(u(x,y),x,x)), 1/2*coeff(eq,diff(u(x,y),x,y)), 1...

>   

chvar

>    chvar := proc(equ, itr, t)
option `Copyright Aleksas Domarkas, 2000`;
local k, A, it, L, J, eq_n, eq_can, r, tr, An, nl, eq;
    eq := lhs(equ) - rhs(equ);
    indets(itr);
    select(has, %, [x, y]);
    k := solve(itr, %);
    A := linalg[matrix](2, 2, [
        coeff(eq, diff(u(x, y), x, x)),
        1/2*coeff(eq, diff(u(x, y), x, y)),
        1/2*coeff(eq, diff(u(x, y), x, y)),
        coeff(eq, diff(u(x, y), y, y))]);
    it := convert(itr, list);
    if has(%[1], eta) then it := [%[2], %[1]] end if;
    L := f -> simplify(subs(u(x, y) = f, eq));
    J := jacobian([rhs(it[1]), rhs(it[2])], [x, y]);
    An :=
        map(simplify, evalm(`&*`(`&*`(J, A), transpose(J))));
    An[1, 1]*Diff(u, xi, xi) + 2*An[1, 2]*Diff(u, xi, eta)
         + An[2, 2]*Diff(u, eta, eta)
         + L(rhs(it[1]))*Diff(u, xi)
         + L(rhs(it[2]))*Diff(u, eta);
    eq_n := %;
    nl := expand(eq_n);
    k union map(x -> 1/lhs(x) = 1/rhs(x), k);
    subs(%, nl);
    if t = parabolic then
        simplify(solve(%, Diff(u, eta, eta)));
        r := simplify(subs(k, numer(%))/subs(k, denom(%)));
        if has(%, [x, y]) then
            tr := solve(itr, {x, y});
            if has(%, RootOf) then tr := allvalues(%)[1]
            end if;
            simplify(expand(subs(tr, r)))
        end if;
        eq_can := Diff(u, eta, eta) - % = 0
    end if;
    if t = hiperbolic then
        simplify(solve(eq_n, Diff(u, eta, eta)));
        r := simplify(subs(k, numer(%))/subs(k, denom(%)));
        if has(%, [x, y]) then
            tr := solve(itr, {x, y});
            if has(%, RootOf) then tr := allvalues(%)[1]
            end if;
            simplify(expand(subs(tr, r)))
        end if;
        eq_can := Diff(u, eta, eta) - Diff(u, xi, xi)
             - simplify(% - Diff(u, xi, xi)) = 0
    end if;
    if t = elliptic then
        simplify(solve(%, Diff(u, xi, xi)));
        r := simplify(subs(k, numer(%))/subs(k, denom(%)));
        if has(%, [x, y]) then
            tr := solve(itr, {x, y});
            if has(%, RootOf) then tr := allvalues(%)[1]
            end if;
            map(simplify, subs(tr, r), trig, power, symbolic)
        end if;
        eq_can := Diff(u, eta, eta) + Diff(u, xi, xi)
             - simplify(% + Diff(u, eta, eta)) = 0
    end if;
    RETURN(value(subs(u = u(eta, xi), eq_can)))
end proc;

>   

chvar := proc (equ, itr, t) local k, A, it, L, J, eq_n, eq_can, r, tr, An, nl, eq; option `Copyright Aleksas Domarkas, 2000`; eq := lhs(equ)-rhs(equ); indets(itr); select(has,%,[x, y]); k := solve(itr,...

Examples

>    for i to 23 do
cat(`EXAMPLE `,i);
eq||i:=K||i[1]*diff(u(x,y),x,x)+K||i[2]*diff(u(x,y),x,y)+
K||i[3]*diff(u(x,y),y,y)+K||i[4]*diff(u(x,y),x)+K||i[5]*diff(u(x,y),y)=0:
mcan(eq||i):

>    eq||i||_can:=chvar(eq||i,%);
end do;

`EXAMPLE 1`

eq1 := diff(u(x,y),`$`(x,2))-2*diff(u(x,y),x,y)-3*diff(u(x,y),`$`(y,2))+diff(u(x,y),y) = 0

{eta = 2*x, xi = x+y}, hiperbolic

eq1_can := diff(u(eta,xi),`$`(eta,2))-diff(u(eta,xi),`$`(xi,2))+1/4*diff(u(eta,xi),xi) = 0

`EXAMPLE 2`

eq2 := diff(u(x,y),`$`(x,2))-6*diff(u(x,y),x,y)+10*diff(u(x,y),`$`(y,2))+diff(u(x,y),x)-3*diff(u(x,y),y) = 0

{xi = x, eta = y+3*x}, elliptic

eq2_can := diff(u(eta,xi),`$`(xi,2))+diff(u(eta,xi),`$`(eta,2))+diff(u(eta,xi),xi) = 0

`EXAMPLE 3`

eq3 := 4*diff(u(x,y),`$`(x,2))+4*diff(u(x,y),x,y)+diff(u(x,y),`$`(y,2))-2*diff(u(x,y),y) = 0

{eta = y, xi = y-1/2*x}, parabolic

eq3_can := diff(u(eta,xi),`$`(eta,2))-2*diff(u(eta,xi),xi)-2*diff(u(eta,xi),eta) = 0

`EXAMPLE 4`

eq4 := diff(u(x,y),`$`(x,2))-x*diff(u(x,y),`$`(y,2)) = 0

{xi = y, eta = -2/3*x^(3/2)}, hiperbolic

eq4_can := diff(u(eta,xi),`$`(eta,2))-diff(u(eta,xi),`$`(xi,2))+1/3*diff(u(eta,xi),eta)/eta = 0

`EXAMPLE 5`

eq5 := diff(u(x,y),`$`(x,2))-y*diff(u(x,y),`$`(y,2)) = 0

{xi = sqrt(y), eta = -1/2*x}, hiperbolic

eq5_can := diff(u(eta,xi),`$`(eta,2))-diff(u(eta,xi),`$`(xi,2))+1/xi*diff(u(eta,xi),xi) = 0

`EXAMPLE 6`

eq6 := x*diff(u(x,y),`$`(x,2))-y*diff(u(x,y),`$`(y,2)) = 0

{xi = sqrt(y), eta = -sqrt(x)}, hiperbolic

eq6_can := diff(u(eta,xi),`$`(eta,2))-diff(u(eta,xi),`$`(xi,2))+(diff(u(eta,xi),xi)*eta-diff(u(eta,xi),eta)*xi)/xi/eta = 0

`EXAMPLE 7`

eq7 := y*diff(u(x,y),`$`(x,2))-x*diff(u(x,y),`$`(y,2)) = 0

{xi = y^(3/2), eta = x^(3/2)}, hiperbolic

eq7_can := diff(u(eta,xi),`$`(eta,2))-diff(u(eta,xi),`$`(xi,2))+1/3*(-diff(u(eta,xi),xi)*eta+diff(u(eta,xi),eta)*xi)/eta/xi = 0

`EXAMPLE 8`

eq8 := x^2*diff(u(x,y),`$`(x,2))+y^2*diff(u(x,y),`$`(y,2)) = 0

{xi = ln(x), eta = ln(y)}, elliptic

eq8_can := diff(u(eta,xi),`$`(xi,2))+diff(u(eta,xi),`$`(eta,2))-diff(u(eta,xi),xi)-diff(u(eta,xi),eta) = 0

`EXAMPLE 9`

eq9 := y^2*diff(u(x,y),`$`(x,2))+x^2*diff(u(x,y),`$`(y,2)) = 0

{xi = -1/2*x^2, eta = 1/2*y^2}, elliptic

eq9_can := diff(u(eta,xi),`$`(eta,2))+diff(u(eta,xi),`$`(xi,2))+1/2*(diff(u(eta,xi),xi)*eta+diff(u(eta,xi),eta)*xi)/xi/eta = 0

`EXAMPLE 10`

eq10 := y^2*diff(u(x,y),`$`(x,2))-x^2*diff(u(x,y),`$`(y,2)) = 0

{xi = y^2, eta = -x^2}, hiperbolic

eq10_can := diff(u(eta,xi),`$`(eta,2))-diff(u(eta,xi),`$`(xi,2))-1/2*(diff(u(eta,xi),xi)*eta-diff(u(eta,xi),eta)*xi)/xi/eta = 0

`EXAMPLE 11`

eq11 := (1+x^2)*diff(u(x,y),`$`(x,2))+(1+y^2)*diff(u(x,y),`$`(y,2))+y*diff(u(x,y),y) = 0

{eta = arcsinh(y), xi = -arcsinh(x)}, elliptic

eq11_can := diff(u(eta,xi),`$`(eta,2))+diff(u(eta,xi),`$`(xi,2))-sinh(xi)*diff(u(eta,xi),xi)/cosh(xi) = 0

`EXAMPLE 12`

eq12 := 4*y^2*diff(u(x,y),`$`(x,2))-exp(2*x)*diff(u(x,y),`$`(y,2))-4*y^2*diff(u(x,y),x) = 0

{xi = y^2, eta = exp(x)}, hiperbolic

eq12_can := diff(u(eta,xi),`$`(eta,2))-diff(u(eta,xi),`$`(xi,2))-1/2*1/xi*diff(u(eta,xi),xi) = 0

`EXAMPLE 13`

eq13 := diff(u(x,y),`$`(x,2))-2*sin(x)*diff(u(x,y),x,y)+(2-cos(x)^2)*diff(u(x,y),`$`(y,2)) = 0

{xi = x, eta = y-cos(x)}, elliptic

eq13_can := diff(u(eta,xi),`$`(eta,2))+diff(u(eta,xi),`$`(xi,2))+cos(xi)*diff(u(eta,xi),eta) = 0

`EXAMPLE 14`

eq14 := y^2*diff(u(x,y),`$`(x,2))+2*y*diff(u(x,y),x,y)+diff(u(x,y),`$`(y,2)) = 0

{eta = y, xi = -2*x+y^2}, parabolic

eq14_can := diff(u(eta,xi),`$`(eta,2))+2*diff(u(eta,xi),xi) = 0

`EXAMPLE 15`

eq15 := x^2*diff(u(x,y),`$`(x,2))-2*x*diff(u(x,y),x,y)+diff(u(x,y),`$`(y,2)) = 0

{eta = y, xi = y+ln(x)}, parabolic

eq15_can := diff(u(eta,xi),`$`(eta,2))-diff(u(eta,xi),xi) = 0

`EXAMPLE 16`

eq16 := x*diff(u(x,y),`$`(x,2))+2*x*diff(u(x,y),x,y)+(x-1)*diff(u(x,y),`$`(y,2)) = 0

{eta = -2*sqrt(x), xi = y-x}, hiperbolic

eq16_can := -diff(u(eta,xi),`$`(xi,2))+diff(u(eta,xi),`$`(eta,2))-diff(u(eta,xi),eta)/eta = 0

`EXAMPLE 17`

eq17 := diff(u(x,y),`$`(x,2))-2*sin(x)*diff(u(x,y),x,y)-cos(x)^2*diff(u(x,y),`$`(y,2))-cos(x)*diff(u(x,y),y) = 0

{xi = y-cos(x), eta = -x}, hiperbolic

eq17_can := -diff(u(eta,xi),`$`(xi,2))+diff(u(eta,xi),`$`(eta,2)) = 0

`EXAMPLE 18`

eq18 := (1+x^2)^2*diff(u(x,y),`$`(x,2))+diff(u(x,y),`$`(y,2))+2*x*(1+x^2)*diff(u(x,y),x) = 0

{eta = y, xi = arctan(x)}, elliptic

eq18_can := diff(u(eta,xi),`$`(xi,2))+diff(u(eta,xi),`$`(eta,2)) = 0

`EXAMPLE 19`

eq19 := exp(2*x)*diff(u(x,y),`$`(x,2))+2*exp(x+y)*diff(u(x,y),x,y)+exp(2*y)*diff(u(x,y),`$`(y,2)) = 0

{eta = y, xi = -(exp(x-y)-1)*exp(-x)}, parabolic

eq19_can := diff(u(eta,xi),`$`(eta,2))-diff(u(eta,xi),xi)*xi/(xi*exp(eta)+1) = 0

`EXAMPLE 20`

eq20 := sin(x)^2*diff(u(x,y),`$`(x,2))-2*y*sin(x)*diff(u(x,y),x,y)+y^2*diff(u(x,y),`$`(y,2)) = 0

{eta = y, xi = y*sin(x)/(cos(x)+1)}, parabolic

eq20_can := diff(u(eta,xi),`$`(eta,2))-2*xi/(xi^2+eta^2)*diff(u(eta,xi),xi) = 0

`EXAMPLE 21`

eq21 := diff(u(x,y),`$`(x,2))+x*y*diff(u(x,y),`$`(y,2)) = 0

{eta = 2*sqrt(y), xi = -2/3*x^(3/2)}, elliptic

eq21_can := diff(u(eta,xi),`$`(eta,2))+diff(u(eta,xi),`$`(xi,2))-1/3*(-diff(u(eta,xi),xi)*eta+3*diff(u(eta,xi),eta)*xi)/xi/eta = 0

`EXAMPLE 22`

eq22 := sin(x)^2*diff(u(x,y),`$`(x,2))+y^2*diff(u(x,y),`$`(y,2)) = 0

{eta = ln(y), xi = ln(sin(x)/(cos(x)+1))}, elliptic

eq22_can := diff(u(eta,xi),`$`(eta,2))+diff(u(eta,xi),`$`(xi,2))+(-diff(u(eta,xi),xi)+diff(u(eta,xi),xi)*exp(2*xi)-diff(u(eta,xi),eta)-diff(u(eta,xi),eta)*exp(2*xi))/(1+exp(2*xi)) = 0
eq22_can := diff(u(eta,xi),`$`(eta,2))+diff(u(eta,xi),`$`(xi,2))+(-diff(u(eta,xi),xi)+diff(u(eta,xi),xi)*exp(2*xi)-diff(u(eta,xi),eta)-diff(u(eta,xi),eta)*exp(2*xi))/(1+exp(2*xi)) = 0
eq22_can := diff(u(eta,xi),`$`(eta,2))+diff(u(eta,xi),`$`(xi,2))+(-diff(u(eta,xi),xi)+diff(u(eta,xi),xi)*exp(2*xi)-diff(u(eta,xi),eta)-diff(u(eta,xi),eta)*exp(2*xi))/(1+exp(2*xi)) = 0

`EXAMPLE 23`

eq23 := sin(x)^2*diff(u(x,y),`$`(x,2))+cos(y)^4*diff(u(x,y),`$`(y,2)) = 0

{xi = ln(sin(x)/(cos(x)+1)), eta = 1/cos(y)*sin(y)}, elliptic

eq23_can := diff(u(eta,xi),`$`(eta,2))+diff(u(eta,xi),`$`(xi,2))+(-diff(u(eta,xi),xi)*eta^2-diff(u(eta,xi),xi)+diff(u(eta,xi),xi)*exp(2*xi)*eta^2+diff(u(eta,xi),xi)*exp(2*xi)+2*eta*diff(u(eta,xi),eta)+...
eq23_can := diff(u(eta,xi),`$`(eta,2))+diff(u(eta,xi),`$`(xi,2))+(-diff(u(eta,xi),xi)*eta^2-diff(u(eta,xi),xi)+diff(u(eta,xi),xi)*exp(2*xi)*eta^2+diff(u(eta,xi),xi)*exp(2*xi)+2*eta*diff(u(eta,xi),eta)+...

Remark

In examples 4-7,  21 you can make assumptions about signum of x,y

>    k:=21:

>    eq:=eq||k;

eq := diff(u(x,y),`$`(x,2))+x*y*diff(u(x,y),`$`(y,2)) = 0

>    assume(x<0,y>0);

>    mcan(eq);

{xi = sqrt(y), eta = 1/3*x*sqrt(-x)}, hiperbolic

>    chvar(eq,%);

diff(u(eta,xi),`$`(eta,2))-diff(u(eta,xi),`$`(xi,2))+1/3*(3*diff(u(eta,xi),xi)*eta+diff(u(eta,xi),eta)*xi)/xi/eta = 0

>    assume(x<0,y<0);

>    mcan(eq);

{xi = -2/3*x*sqrt(-x), eta = -2*sqrt(-y)}, elliptic

>    chvar(eq,%);

diff(u(eta,xi),`$`(eta,2))+diff(u(eta,xi),`$`(xi,2))-1/3*(-diff(u(eta,xi),xi)*eta+3*diff(u(eta,xi),eta)*xi)/xi/eta = 0

>    assume(x>0,y<0);

>    mcan(eq);

{xi = -2/3*x^(3/2), eta = -2*sqrt(-y)}, hiperbolic

>    chvar(eq,%);

diff(u(eta,xi),`$`(eta,2))-diff(u(eta,xi),`$`(xi,2))-1/3*(diff(u(eta,xi),xi)*eta+3*diff(u(eta,xi),eta)*xi)/xi/eta = 0

>    x:='x':y:='y':

Other method with PDEtools[dchange]

>    k:=15;

k := 15

>    eq:=eq||k;mcan(eq);eq_can:=chvar(eq,%);

eq := x^2*diff(u(x,y),`$`(x,2))-2*x*diff(u(x,y),x,y)+diff(u(x,y),`$`(y,2)) = 0

{eta = y, xi = y+ln(x)}, parabolic

eq_can := diff(u(eta,xi),`$`(eta,2))-diff(u(eta,xi),xi) = 0

Other method with solve  and PDEtools[dchange]:

>    itr:=%%[1];

itr := {eta = y, xi = y+ln(x)}

>    tr:=solve(itr,{x,y});

tr := {y = eta, x = exp(xi-eta)}

>    if has([%],RootOf) then tr:=allvalues(%)[1] else tr:=% fi;

tr := {y = eta, x = exp(xi-eta)}

>    PDEtools[dchange](tr,eq,itr,[eta,xi],simplify);

diff(u(eta,xi),`$`(eta,2))-diff(u(eta,xi),xi) = 0

Note: this method have problems in 11 and 21 examples.

>   

While every effort has been made to validate the solutions in this worksheet, Waterloo Maple Inc. and the contributors are not responsible for any errors contained and are not liable for any damages resulting from the use of this material.

Back to contents