TWSolutions - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim





compute Traveling Wave Solutions for autonomous nonlinear partial differential equations (PDEs) and systems of them


Calling Sequence




Calling Sequence


TWSolutions(PDEsys, vars, function=..., output=ODE, extended, rank_parameters_lower, remove_redundant=..., other_opts)





a set or list with autonomous nonlinear partial differential equations



(optional) the unknown function(s) of the system, could be a ranking (see pdsolve,system)

function = ...


(optional) either a mathematical function name on the rhs, or a set or list of them; these functions are used as basis for a power series solution

output = ODE


(optional) to return the ODE equivalent to the PDE system and the transformation, instead of solving the PDE system



(optional) after transforming the PDE system into an ODE system, instead of computing a power series solution to the ODEs, compute their general solution



(optional) parameters declared as such using the option parameters=... are ranked lower than other solving variables of the problem



any of the optional arguments accepted by casesplit; typically: parameters={p1,p2,...}, singsol=false



single argument, to see what are the functions allowed as basis for constructing power series solutions



The TWSolutions command computes Traveling Wave Solutions (TWS) for autonomous partial differential equations (PDE) that are rational and nonlinear in the unknowns and their derivatives. An autonomous system is one where the independent variables do not appear explicitly, only through the unknown functions and their derivatives.


A TWS is an exact, closed-form solution, expressed as a finite power series of one of a particular set of functions (default is the hyperbolic tangent, tanh) that has a linear combination of the independent variables as arguments. Concretely, given such an autonomous PDE system with i unknown functions fix1,...,xj of j variables, by default TWSolutions computes solutions of the form

f[i](tau) = Sum(A[i,k]*tau^k, k=0..n[i]);



where the ni are finite, the Ai,k are constants with respect to the xj and

tau = tanh(Sum(C[k]*x[k], k=0..j));



where the Ck are constants with respect to the xj.


The first argument given to TWSolutions, PDEsys, is a set or list containing one or more autonomous PDEs. The unknowns of the system can be specified anywhere after the first argument, as a set or list of functions - or function names - or as a ranking (see pdsolve,system). If the unknowns of the problem are not specified, only the differentiated unknown functions found in the PDE system are taken as the unknowns.


The mathematical function used to construct the TWS, when not specified, is tanh. To specify a different function, or a list of them to construct different types of solutions at once, use the functions = ... optional argument, where the right-hand side can be the name of a mathematical function or a set or list of them. The possible mathematical functions are: exp, ln, the trigonometric functions sin, cos, tan, csc, sec, cot, the hyperbolic versions of them, JacobiSN, JacobiCN, JacobiDN, JacobiNS, JacobiNC, JacobiND, the corresponding InverseJacobi functions, and the WeierstrassP function.


It is also possible to choose the identity as the "mathematical function" to be used, in which case, instead of a power series of a function of a linear combination of the independent variables, the TWS is constructed as a power series of the linear combination itself, resulting in a polynomial solution to the PDE system.


In some cases, or to perform further analysis and intermediate manipulations, it is useful to compute not the actual solution to the problem posed but just the ODE system equivalent to the given PDE system and the transformation mapping each other. To obtain this type of output use the optional argument output = ODE.


As explained in the previous paragraphs, once the function with which the solution will be constructed is determined, either by default (tanh) or by choice (using the optional argument function = ...), the "TWS" solution is constructed as a power series in that function. This is done by computing the polynomial solutions to the nonlinear ODE system equivalent to the given PDE system. However, a more interesting solution for the PDE system can sometimes be obtained by computing not just polynomial solutions to the nonlinear ODE system but by computing its general solution. To request TWSolutions to attempt this type of solution use the optional argument extended.


The solving process essentially transforms the given PDE system and related unknowns (functions) and parameters (there may be many, represented by symbol variables, indicated with the optional argument parameters = ...) into an nonlinear algebraic system in these unknowns, parameters, and unknown coefficients of the finite series expansion. To solve that system, an ordering or ranking for these solving variables (unknowns, parameters and coefficients) is chosen. This ordering mixes the three groups of solving variables according to convenience regarding different aspects, resulting into a sequence of solutions organized according to the ranking used. In some cases, however, a sequence of solutions organized according to the different cases for the parameters is preferred - for that purpose use the optional argument rank_parameters_lower; see the examples.


By default, TWSolutions discards constant solutions that are redundant before producing the output. If the optional argument remove_redundant = false is used, no attempt to remove redundant solutions is done. This is of use when any particular solution suffices because it avoids the costly process of removing redundant solutions, which requires running additional differential elimination processes. Alternatively, when the optional argument remove_redundant = true is given, all redundant solutions, even those that are non-constant are removed. Depending on the PDE system, this process may consume from several seconds to minutes.


All the optional arguments accepted by PDEtools,casesplit are accepted by TWSolutions. Of special interest is parameters={p1,p2, ...}, specifying a set of constant parameters that should also be considered solving variables. The solution then splits into cases with respect to these parameters through a differential elimination process (see casesplit, DifferentialAlgebra and DEtools,Rif). All constant parameters present in the system and not specified using this option are considered arbitrary.


Another optional argument of PDEtools,casesplit relevant when using TWSolutions is singsol=false. Its use avoids computing the singular cases with respect to the coefficients Ai,k,Cj when running the differential elimination processes required to solve the problem. Depending on the PDE system, the computation of the singular cases may consume more time than the computation of the general solution. To compute TWS the fastest way (so regardless of receiving redundant constant solutions and ignoring the singular cases), use the combination of optional arguments remove_redundant = false, singsol = false.

The solving process


By default, TWSolutions solves a given system in five steps


1. The autonomous PDE system is transformed into a nonlinear ODE system by introducing τ (see above) as new variable, implying

Diff(f[i],x[j]) = C[j]*(1-tau^2)*Diff(f[i],tau);



for all xj. The resulting ODE system, polynomial in fiτ and its derivatives, has all the coefficients polynomial in τ and the unknowns Cj.


2. To search for solutions fi=k=0niAi,kτk for that ODE system, an upper bound ni for each unknown fi is computed. This is done by substituting fi=τni in the system and assuring that the two terms with the highest powers of τ in each equation have the same degree. That is the so-called balancing of the highest degree terms and leads to a linear system for the ni.


3. The complete finite expansion in τ for each fi, containing the unknowns Ai,k, is introduced in the ODE system obtained in step 1, and, by taking coefficients of different powers of τ, a new algebraic nonlinear system for the expansion coefficients Ai,k,Cj is built.


4. An elimination process splitting into cases is run through PDEtools,casesplit, which in turn uses DEtools,Rif by default, or DifferentialAlgebra if the optional keyword diffalg is present somewhere in the calling sequence. The ranking used leads to solutions for the Ai,k in terms of the Cj plus, perhaps, additional restrictions on the Cj.


5. By default, constant solutions that are redundant are removed.


It is implicit in this itemized description that some of the TWSolutions subroutines can be used to directly compute polynomial solutions for nonlinear ODE systems; that functionality is provided through the DEtools[polysols] command. TWSolutions is also used by pdsolve by default when solving a single PDE, but not by default with PDE systems, in which case it can be used by means of optional arguments - see the HINT option described in pdsolve,system.


Valuable information on each of the steps of the solving process is available at run time through the userinfo mechanism. Setting infolevel[TWSolutions] := 2, or any number from 1 to 5 to display less or more information, it is possible to see the ODE system equivalent to the given PDE system, the upper bounds computed, the solutions obtained for the Ai,k,Cj through differential elimination, and the redundant solutions discarded.


Load TWSolutions and also the DEtools[diff_table] and the PDEtools[declare] facilities to work with simpler input and enhanced display of equations.

with(PDEtools, TWSolutions, declare);



with(DEtools, diff_table);



Use U as the differentiation table for the function ux,t.

U := diff_table(u(x,t)):

Consider the Korteweg-de Vries (KdV) Burgers equation that occurs in various physical systems. (Note the simpler input in jet notation as a result of using the diff_table command.)

sys := { U[t] + U[]*U[x] - p*U[x,x] + q*U[x,x,x] = 0 };



Three traveling wave solutions (TWS) are as follows.




Solutions can be tested as usual using pdetest.

map(pdetest,[TWS_sol], sys);



Let's consider the same problem but taking p,q as parameters, so splitting into cases with respect to them; five TWS result. To illustrate the userinfo mechanism set

infolevel[TWSolutions] := 2;



{TWSolutions(sys, parameters={p,q})};

* Using tau = tanh(t*C[2]+x*C[1]+C[0])
* Equivalent ODE system: {-q*C[1]^3*(tau^2-1)*(tau^4-2*tau^2+1)*diff(diff(diff(u(tau),tau),tau),tau)+(-p*C[1]^2*(tau^2-1)^2-q*C[1]^3*(tau^2-1)*(6*tau^3-6*tau))*diff(diff(u(tau),tau),tau)+(-2*p*C[1]^2*(tau^2-1)*tau-q*C[1]^3*(tau^2-1)*(6*tau^2-2)-u(tau)*C[1]*(tau^2-1)-C[2]*(tau^2-1))*diff(u(tau),tau)}
* Ordering for functions: [u(tau)]
* Cases for the upper bounds: [[n[1] = 2]]
* Power series solution [1]: {u(tau) = tau^2*A[1,2]+tau*A[1,1]+A[1,0]}, splitting into cases with respect to the parameters {p, q}



Among the five solutions above, three were obtained considering the singular cases of the system with respect to the expansion coefficients Ai,k,Cj (see The solving process above). To compute without displaying information, use infolevel[TWSolutions] := 0. To compute more quickly, find only the non-singular solutions using

infolevel[TWSolutions] := 0:

{TWSolutions(sys, parameters={p,q}, singsol=false)};



The TWS can be computed expanding in series of different functions. The functions allowed are

TWSolutions( functions_allowed );



For example, for p=0, this system also admits sec, JacobiSN, and WeierstrassP type solutions

TWSolutions(sys, parameters={p,q}, singsol=false, functions = [sec, JacobiSN, WeierstrassP]);



In the WeierstrassP type solution above, you see the parameter q expressed in terms of the other constants _C entering the solution. To compute a solution where all solving variables are instead expressed as functions of the parameters use the optional argument rank_parameters_lower

TWSolutions(sys, parameters={p,q}, singsol=false, functions = [WeierstrassP], rank_parameters_lower);



To compute just the nonlinear ODE system equivalent to this PDE system and the transformation mapping each other use the optional argument output = ODE. For example, for sec

TWSolutions(sys, parameters={p,q}, singsol=false, function = sec, output=ODE);



You can also indicate the identity as the function to be used; this is the corresponding nonlinear ODE problem to be solved

TWSolutions(sys, parameters={p,q}, singsol=false, function = identity, output=ODE);



A PDE system example: The generalized Hirota-Satsuma coupled KdV equations. To work with simpler input and enhanced mathematical display, use the diff_table and declare commands.

V := diff_table(v(x,t)):

W := diff_table(w(x,t)):


ux,twill now be displayed asu

vx,twill now be displayed asv

wx,twill now be displayed asw


pde[1] := V[t] + 1/2*V[x,x,x] + 3*U[]*V[x]=0;



pde[2] := W[t] + 1/2*W[x,x,x] + 3*U[]*W[x] = 0;



pde[3] := U[t] - 1/4*U[x,x,x] - 3*U[]*U[x] - 3*diff( W[] - V[]^2, x)=0;



sys := {pde[1], pde[2], pde[3]}:

This system was proposed by Satsuma and Hirota, who found its three soliton-type solutions and showed that the well-known Hirota-Satsuma coupled KdV equation is a special case of this system with w=0 and xx12 , tt12 . Eleven non-singular traveling wave solutions are computed as follows.

sol := TWSolutions(sys, singsol=false);



A PDE example with all its terms being nonlinear and for which an extended TWS can be computed (that is, one constructed by computing not just a polynomial but a general solution to the equivalent nonlinear ODE)

pde := U[t]^2 = 2*U[]*U[x]^2-(1+U[]^2)*U[x,x];



TWSolutions(pde, output = ODE);  # this will be the ODE solved


TWSolutions(pde, extended);          # solution more general than a tanh power series solution



A simpler extended solution using the identity as the function used to construct the PDE solution

TWSolutions(pde, function = identity, output = ODE);  # this will be the ODE solved



TWSolutions(pde, function = identity, extended);      # simpler extended solution


See Also