Application Center - Maplesoft

Conversion linear partial differential equations with two variables to canonical form

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

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  ,   to canonical form.

Program chvar  reduct equation to canonical form

 >

coeffs

Coefficients of equations :

 > 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;

 >

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;

 >

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;

Remark

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

 > k:=21:

 > eq:=eq||k;

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

 > mcan(eq);

 > chvar(eq,%);

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

 > mcan(eq);

 > chvar(eq,%);

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

 > mcan(eq);

 > chvar(eq,%);

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

Other method with PDEtools[dchange]

 > k:=15;

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

Other method with solve  and PDEtools[dchange]:

 > itr:=%%[1];

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

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

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

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.