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