Separation of Variables
M.M. Yovanovich
SEPVARDIF1.MWS
Separation of variables method applied to the one-dimensional diffusion equation. The diffusion equation in cartesian cordinates which is will be separated into three sets of independent first and second-order ordinary differential equations by the substitution where and are independent space and time functions.
> restart:
Diffusion equation in cartesian coordinates.
> PDE:= diff(U(x,t), x,x) - diff(U(x,t),t)/alpha = 0;
> U(x,t):= X(x)*tau(t);
> PDE:= PDE/U(x,t);
> ODE:= expand(PDE);
The two separated terms are functions of and only for all values of and . We can obtain three sets of independent first and second-order ordinary differential equations by setting the two terms to i) 0, ii) , and iii) . The three choices will be used.
Choice 1: ODEs and their Solutions.
> ode11:= X(x)*op(1, lhs(ODE)) = 0;
> ode12:= (alpha*tau(t))*op(2, lhs(ODE)) = 0;
> sol11:= subs(_C1 = A, _C2 = B, dsolve(ode11, X(x)));
> sol12:= subs(_C1 = C, dsolve(ode12, tau(t)));
One Solution of the Diffusion Equation.
> sol1Diffusion:= rhs(sol11)*rhs(sol12);
This solution is independent of time. It is the steady-state part.
Choice2: ODEs and their Solutions.
> ode21:= expand(X(x)*(op(1, lhs(ODE)) - lambda^2)) = 0;
> ode22:= - expand((alpha*t)*(op(2, lhs(ODE)) + lambda^2)) = 0;
> sol21:= subs(_C1 = A, _C2 = B, dsolve(ode21, X(x)));
> sol22:= subs(_C1 = C, dsolve(ode22, tau(t)));
A Second Solution of the Diffusion Equation.
> sol2Diffusion:= rhs(sol21)*rhs(sol22);
The second solution of the one-dimensional diffusion equation consist of the product of a periodic space function and an exponential time function which increases with increasing time. This solution is not acceptable for thermal equilibrium problems.
Choice 3: ODEs and their Solutions.
> ode31:= expand(X(x)*(op(1, lhs(ODE)) + lambda^2)) = 0;
> ode32:= - expand((alpha*tau(t))*(op(2, lhs(ODE)) - lambda^2)) = 0;
> sol31:= subs(_C1 = A, _C2 = B, dsolve(ode31, X(x)));
> sol32:= subs(_C1 = C, dsolve(ode32, tau(t)));
A Third Solution of the Diffusion Equation.
> sol3Diffusion:= rhs(sol31)*rhs(sol32);
The third solution of the one-dimensional diffusion equation consist of the product of an exponential space function and an exponential time function which decreases with increasing time. The third solution is acceptable for thermal equilibrium problems.
Summary of the three solutions of the one-dimensional diffusion equation.
> sol_Diffusion1:= subs(C = 1, sol1Diffusion);
> sol_Diffusion2:= subs(C = 1, sol2Diffusion);
Alernative form of the second solution.
> sol_Diffusion22:= (A*cosh(lambda*x) + B*sinh(lambda*x))*exp(lambda^2*alpha*t);
> sol_Diffusion3:= subs(C = 1, sol3Diffusion);
>
The constants of integration and and the separation constant will be determined by means of the homogeneous boundary conditions of the first, second and third kinds, respectively.