Updates to Differential Equation (DE) Solvers in Maple 14
Summary
Exact Solutions
Numerical Solutions
The theme for exact, symbolic Ordinary Differential Equation solving in Maple 14 is the development of new algorithms for 2nd order nonlinear ODEs whose solution are beyond the scope of previously existing methods. These are, for instance, nonlinear ODE families not admitting point symmetries nor integrating factors depending only two of x,y,y'. A number of these formerly intractable ODE families can now be reduced to a first order ODE using different new approaches so that a solution to the reduced ODE is computable. Similarly, using a new approach to compute particular solutions by exploring integrating factors, the solution for various ODE initial value problems can now be computed even when the general solution to the ODE cannot be computed. These abilities are built in to the standard DE solver (dsolve) in Maple 14, and the techniques are also available separately through the DEtools commands introduced for these purposes in Maple 13.
For Partial Differential Equations, the functionality of the symmetry commands of PDEtools has been expanded in many respects. Two new commands, one of them a unified solver that computes exact, series or numerical solutions for equations that are differential or not, were added, and pdsolve can now compute exact solutions subject to boundary conditions for a restricted (growing) number of PDE types. Also, the internal PDEtools Library, presented in Maple 13 with 45 specialized routines for programming purposes, has 4 new programming routines.
For numerical solutions of ODEs, improvements have been made to event handling and new methods for nonstiff differential and differential algebraic problems were added to dsolve/numeric.
Ordinary Differential Equations (ODEs)
By using new algorithms, the dsolve command can now solve varied 2nd order nonlinear ODE families, out of reach of the previously existing solving methods, as well as compute new solutions for ODE-IVP problems not previously computable. This method is employed in cases where the general solution is not computable with the existing algorithms and the ODE does not have point symmetries (which dsolve could explore in Maple 13 to attempt to solve the ODE-IVP).
New solvable 2nd order nonlinear ODE families
The new approaches can successfully solve a number of different nonlinear classes of equations that have no point symmetries and admit no integrating factor depending only on two of x,y,y'. Different ideas are explored, either mapping the nonlinear 2nd order problem into a 1st order solvable problem of a known type, or into a 2nd order linear ODE whose independent solutions in turn are two integrating factors of the original nonlinear problem, so a double reduction of order, solving the problem is possible.
Examples
PDEtools:-declare(y(x), prime=x);
y⁡x⁢will now be displayed as⁢y
derivatives with respect to⁢x⁢of functions of one variable will now be displayed with '
The following example shows a nonlinear problem solved after reducing it with new algorithms to a 1st order Abel equation that has non-constant invariants--a difficult problem itself.
ode[1] := diff(y(x),x,x) = -(diff(y(x),x)^3*x+y(x)*diff(y(x),x)^2-diff(y(x),x)*y(x)-x*diff(y(x),x)^2)/x/y(x);
ode1≔y''=−y'3⁢x+y⁢y'2−y'⁢y−x⁢y'2x⁢y
sol[1] := dsolve(ode[1]);
sol1≔c__2+−2⁢π⁢erf⁡x−y⁢22⁢c__1⁢y+2⁢ⅇ−x22⁢c__12⁢ⅇx⁢yc__12⁢ⅇ−y22⁢c__12⁢c__1⁢2y=0
Another kind of nonlinear problem, solved by mapping it into a linear ODE whose two independent solutions lead to two independent integrating factors for the nonlinear ODE
ode[2] := diff(y(x),x,x) = x/y(x)^2/(x*y(x)+1)*diff(y(x),x)^3-(1/y(x)-x)/(x*y(x)+1)*diff(y(x),x)^2+y(x)/(x*y(x)+1)*diff(y(x),x);
ode2≔y''=x⁢y'3y2⁢x⁢y+1−1y−x⁢y'2x⁢y+1+y⁢y'x⁢y+1
sol[2] := dsolve(ode[2]);
sol2≔y=ⅇ2⁢LambertW⁡x⁢ⅇ−x22⁢c__1c__1⁢ⅇc__2c__1⁢c__1+x2+2⁢c__22⁢c__1
Both ode1 and ode2 were solved in previous releases only in terms of uncomputed integrals inverted with respect to the integration variable (expressed using nested RootOf composed with Intat).
The following ODE is representative of a family that is polynomial in the unknown and its derivatives, has no parameters, no point symmetries, and no integrating factors depending on only two of x,y,y', and it was not solvable in previous releases.
ode[3] := diff(y(x),x,x) = -diff(y(x),x)*(diff(y(x),x)^2*x^2+diff(y(x),x)*x^2+y(x)-x*diff(y(x),x))/x/y(x);
ode3≔y''=−y'⁢y'2⁢x2+y'⁢x2+y−y'⁢xx⁢y
sol[3] := dsolve(ode[3]);
sol3≔c__2+x⁢KummerM⁡−c__1,1−c__1,y−c__1⁢ⅇyx⁢KummerU⁡−c__1,1−c__1,y=0
To see that ode3 has no point symmetries, compute the determining PDE for the infinitesimals of a symmetry transformation: the only solution for these infinitesimals, _ξ and _η, is zero.
PDEtools:- DeterminingPDE(ode[3]);
_ηy⁡x,y=0,_ξx⁡x,y=0
New ODE-IVP solutions from the ODE integrating factors
For various nonlinear ODE initial value problems (ODE-IVP), the general ODE solution is out of the scope of the existing algorithms. In Maple 13, dsolve automatically explores the ODE symmetries to workaround this situation. New in Maple 14, dsolve also automatically explores the ODE integrating factors that can be computed for the ODE, in that way solving the whole ODE-IVP in many situations, despite that the general ODE solution is out of reach.
Example
The general solution to the following ode4 is not known, but this ODE-IVP problem can now be solved.
ode[4] := y(x)^p*p^2*diff(y(x),x)^2/y(x)^2+y(x)^p*p*diff(y(x),x,x)/y(x)-y(x)^p*p*diff(y(x),x)^2/y(x)^2 = y(x)+x*diff(y(x),x);
ode4≔yp⁢p2⁢y'2y2+yp⁢p⁢y''y−yp⁢p⁢y'2y2=y'⁢x+y
ic[4] := y(0) = 1, D(y)(0) = 0;
ic4≔y⁡0=1,D⁡y⁡0=0
sol[4] := dsolve([ode[4], ic[4]]);
sol4≔y=p⁢x2−x2+2⁢pp1p−121p−1
DEtools[particularsol] using integrating factors
The ODE-IVP solution to ode4,ic4 is derived from a 1-parameter particular solution (the last one in the following result) that can now be computed using new algorithms added to DEtools[particularsol]
particular_sol[4] := DEtools[particularsol](ode[4]);
particular_sol4≔y=ⅇln⁡x2⁢p−12⁢pp−1,y=p⁢x2+2⁢c__1⁢p−x2p1p−121p−1
Along the same lines, DEtools[IVPsol], for specializing general solutions, as well as the related solution option in dsolve (both new in Maple 13) can now take advantage of the new capabilities of DEtools[particularsol].
DEtools[IVPsol]([ic[4]], particular_sol[4][-1]);
Complete sets of first integrals for linear ODEs with DEtools[firint]
The DEtools[firint] command can now compute a complete set of first integrals for linear ODEs, that is, as many as the differential order and all independent from each other.
ode[5] := diff(y(x),x,x) = (-6*x-6)/x/(3*x+2)*diff(y(x),x)+6/x/(3*x+2)*y(x)-6/x/(3*x+2);
ode5≔y''=−6⁢x−6⁢y'x⁢3⁢x+2+6⁢yx⁢3⁢x+2−6x⁢3⁢x+2
DEtools[firint](ode[5], method = formal);
−x3⁢x+1⁢y'−y+13⁢x+2,y'⁢x+2⁢y−23⁢x+2
A textbook example:
PDEtools[declare](g(x));
g⁡x⁢will now be displayed as⁢g
ode[6] := diff(y(x), x,x) = ((diff(g[1](x), x,x))*g[2](x)-g[1](x)*(diff(g[2](x), x,x)))*(diff(y(x), x))/(g[2](x)*(diff(g[1](x), x))-g[1](x)*(diff(g[2](x), x)))+((diff(g[1](x), x))*(diff(g[2](x), x,x))-(diff(g[1](x), x,x))*(diff(g[2](x), x)))*y(x)/(g[2](x)*(diff(g[1](x), x))-g[1](x)*(diff(g[2](x), x)))+((diff(g[0](x), x,x))*(-g[2](x)*(diff(g[1](x), x))+g[1](x)*(diff(g[2](x), x)))+((diff(g[1](x), x))*g[0](x)-g[1](x)*(diff(g[0](x), x)))*(diff(g[2](x), x,x))-((diff(g[2](x), x))*g[0](x)-g[2](x)*(diff(g[0](x), x)))*(diff(g[1](x), x,x)))/(-g[2](x)*(diff(g[1](x), x))+g[1](x)*(diff(g[2](x), x)));
ode6≔y''=g1''⁢g2−g1⁢g2''⁢y'g2⁢g1 '−g1⁢g2 '+g1 '⁢g2''−g1''⁢g2 '⁢yg2⁢g1 '−g1⁢g2 '+g0''⁢−g2⁢g1 '+g1⁢g2 '+g1 '⁢g0−g1⁢g0 '⁢g2''−g2 '⁢g0−g2⁢g0 '⁢g1''−g2⁢g1 '+g1⁢g2 '
This ode6 is the most general 2nd order non-homogeneous linear ODE having for solution basis g1 and g2, for the homogeneous part, and g0 as particular solution of the whole non-homogeneous equation, so the basis of solutions is represented in Maple by
basis_sol[6] := [[g[1](x), g[2](x)], g[0](x)];
basis_sol6≔g1,g2,g0
To verify that basis_sol6 is a complete basis for the solutions of ode6, construct the general solution from basis_sol6. Then test it using odetest.
sol[6] := y(x) = _C1*g[1](x) + _C1*g[2](x) + g[0](x);
sol6≔y=c__1⁢g1+c__1⁢g2+g0
odetest(sol[6], ode[6]);
0
Now compute a complete set of first integrals for ode6.
first_integrals[6] := DEtools[firint](ode[6], y(x), basis = basis_sol[6]);
first_integrals6≔y−g0⁢g2 '−g2⁢y'−g0 '−g2⁢g1 '+g1⁢g2 ',−y+g0⁢g1 '+g1⁢y'−g0 '−g2⁢g1 '+g1⁢g2 '
Verify this result.
map(DEtools[firtest], [first_integrals[6]], ode[6], y(x));
0,0
Partial Differential Equations (PDEs)
A large number of improvements and additions were made to the PDEtools package, setting a new benchmark for the state-of-the-art in symbolic computation and partial differential equation solving.
Exact solutions for PDEs subject to boundary conditions
Taking the lead again in the use of computers for the exact solving of differential equations, in Maple 14 pdsolve computes exact solutions for PDEs subject to boundary conditions (see pdsolve[boundaryconditions]). The routines are experimental, mostly for PDEs having two independent variables, but already handling a (growing) number of standard problems.
sys[1] := [diff(u(x, t), t)+c*(diff(u(x, t), x)) = -lambda*u(x, t), u(x, 0) = phi(x)];
sys1≔ut+c⁢ux=−λ⁢u⁡x,t,u⁡x,0=φ⁡x
pdsolve(sys[1]);
u⁡x,t=φ⁡−t⁢c+x⁢ⅇ−λ⁢t
Verify this result using pdetest
pdetest((24), sys[1]);
The heat equations with periodic boundary conditions at 0 and L
sys[2] := [diff(u(x, t), t) = kappa*(diff(u(x, t), x, x)), u(0, t) = 0, u(L, t) = 0];
sys2≔ut=κ⁢ux,x,u⁡0,t=0,u⁡L,t=0
pdsolve(sys[2]) assuming L > 0;
u⁡x,t=∑n=1∞⁡sin⁡n⁢π⁢xL⁢ⅇ−κ⁢π2⁢n2⁢tL2⁢f__1⁡n
pdetest((27), sys[2]);
0,0,0
A wave equation type of problem
sys[3] := [diff(u(x,t), x, x) - (1/c^2)*diff(u(x,t), t, t) = 0, u(x,0) = f(x), D[2](u)(x, 0) = g(x)];
sys3≔ux,x−ut,tc2=0,u⁡x,0=f⁡x,D2⁡u⁡x,0=g
pdsolve(sys[3]);
u⁡x,t=∫−t⁢c+xt⁢c+xg⁡x1ⅆx12⁢c+f⁡−t⁢c+x2+f⁡t⁢c+x2
pdetest((30), sys[3]);
Series solutions for PDEs systems subject to boundary conditions
Starting in Maple 14, pdsolve computes series solutions for PDEs with initial values (see pdsolve[series]).
The heat equation in two dimensions
pde[1] := diff(u(x, t), t,t) - diff(u(x, t), x) = 0;
pde1≔ut,t−ux=0
Classically, one says that the solutions of the heat equation depend on two arbitrary functions u⁡x,0=f⁡x and ut⁡x,0=g. For illustration purposes our choice for initial values is then f=cos,g=sin
iv[1] := u(x, 0) = cos(x), D[2](u)(x, 0) = sin(x);
iv1≔u⁡x,0=cos⁡x,D2⁡u⁡x,0=sin⁡x
pdsolve([pde[1], iv[1]] , series, order = 3);
u⁡x,t=−x22+−3⁢t2+6⁢t⁢x6+t36+1
To compute these power series solution, pdsolve makes use of the PowerSeriesSolution command of the new DifferentialAlgebra package. However, pdsolve also uses the extension approach to handle non-polynomial differential equations explained in dpolyform, so that unlike PowerSeriesSolution, pdsolve also computes series solutions in the presence of non-polynomial objects. For example, for this equation with initial values given around x=x0
pde[2] := diff(u(x,t),x,x) = BesselJ(nu, sin(x))*diff(u(x,t), t);
pde2≔ux,x=BesselJ⁡ν,sin⁡x⁢ut
iv[2] := u(x0, t) = f(t), D[1](u)(x0, t0)=1, D[2](u)(x0, t0) = 2;
iv2≔u⁡x0,t=f⁡t,D1⁡u⁡x0,t0=1,D2⁡u⁡x0,t0=2
pdsolve({pde[2], iv[2]}, u(x,t), series, order = 3);
u⁡x,t=f⁡t0+2⁢t−2⁢t0+x−x0+BesselJ⁡ν,sin⁡x0⁢x−x02+−BesselJ⁡ν+1,sin⁡x0+ν⁢BesselJ⁡ν,sin⁡x0sin⁡x0⁢cos⁡x0⁢x−x033
New commands in PDEtools: Solve and InvariantEquation
Two new commands were added to PDEtools.
Solve is an unified command to compute exact, series or numerical solutions, possibly independent of indicated variables, for systems of algebraic or differential equations, possibly including inequations, initial values or boundary conditions. In this sense Solve provides the functionality of solve, fsolve, dsolve, pdsolve and more, through a single command that understands which command is to be called according to your input. Second, Solve has the ability to compute these solutions independent of specified variables, generalizing the functionality provided by solve[identity] to exact, series or numerical solutions, to systems of non-polynomial algebraic and/or differential equations, and allowing for an arbitrary number of identity variables. This unification together with its new solving capability make concretely simpler the interactive study of the solutions of an algebraic or differential equation system.
InvariantEquation to compute the invariant equation that admits a given symmetry group
Four new PDEtools:-Library commands were added to the library of tools to manipulate PDE systems and facilitate programming with them. These are: JetNumbersToJetVariables, JetVariablesToJetNumbers, NormalizeBoundaryConditions and ToSameVariables.
with(PDEtools):
A non-differential equation
eq[1] := a*x^2 + b*x + c;
eq1≔a⁢x2+b⁢x+c
Solve(eq[1], x);
x=−b+−4⁢a⁢c+b22⁢a,x=−b+−4⁢a⁢c+b22⁢a
An ODE problem and its series solution
eq[2] := diff(y(x),x) = y(x);
eq2≔y'=y
Solve(eq[2], series);
y=y⁡0+y⁡0⁢x+12⁢y⁡0⁢x2+16⁢y⁡0⁢x3+124⁢y⁡0⁢x4+1120⁢y⁡0⁢x5+O⁡x6
A PDE problem with boundary conditions
eq[3] := [diff(u(x, t), t)+c*(diff(u(x, t), x)) = -lambda*u(x, t), u(x, 0) = phi(x)];
eq3≔ut+c⁢ux=−λ⁢u⁡x,t,u⁡x,0=φ⁡x
Solve(eq[3]);
Numerical solution for a PDE with boundary conditions
eq[4] := [diff(u(x,t),t) = -diff(u(x,t),x), u(x,0) = sin(2*Pi*x), u(0,t) = -sin(2*Pi*t)];
eq4≔ut=−ux,u⁡x,0=sin⁡2⁢π⁢x,u⁡0,t=−sin⁡2⁢π⁢t
sol[4] := PDEtools:-Solve(eq[4], numeric, time=t, range=0..1);
sol4:=moduleexportplot,plot3d,animate,value,settings;...end module
sol[4]:-plot(t=0, numpoints=50);
In the examples above the advantage with regards to calling solve, dsolve or pdsolve is in using a single command and having a unified format for the input and output. Solve however also provides additional functionality: it can compute solutions independent of indicated variables. The system being solved using independentof can also contain inequations
eq[5] := [k*a*c*(a+b)*exp(k*d*t)-2*a*exp(k*t)*k+Q*(-c+a)*x, a <> 0];
eq5≔k⁢a⁢c⁢a+b⁢ⅇk⁢d⁢t−2⁢a⁢ⅇk⁢t⁢k+Q⁢−c+a⁢x,a≠0
Solve(eq[5], {a, b, c, d}, independentof = {t, x});
a=a,b=−a2−2a,c=a,d=1
Solutions that are independent of the specified variables can be computed as well for differential equations or systems of them;
eq[6] := diff(f(x,y),x)*diff(g(x,y),x) + diff(f(x,y),y)*diff(g(x,y),y) + g(x,y)*(diff(f(x,y), x,x) + diff(f(x,y), y,y)) = -1;
eq6≔fx⁢gx+fy⁢gy+g⁡x,y⁢fx,x+fy,y=−1
Here are solutions for this PDE that are independent of x and independent of y
Solve(eq[6], independentof = x);
f⁡x,y=f__1⁡y,g⁡x,y=c__1−yf__1y
Solve(eq[6], independentof = y);
f⁡x,y=f__1⁡x,g⁡x,y=c__1−x_F1'
The new InvariantEquations command computes equations that are invariant under given symmetries. Consider the list of infinitesimals of this 1-dimensional symmetry group
S := [x, 1, u];
S≔x,1,u
The 1st order partial differential equation invariant under the symmetry transformation underlying these infinitesimals is
PDE := InvariantEquation(S, u(x, t), name = Lambda);
* Partial match of 'name' against keyword 'arbitraryfunctionname'
PDE≔Λ⁡−ln⁡x+t,u⁡x,tx,ux,utx
The third order PDE invariant under S is
PDE := InvariantEquation(S, u(x, t), order = 3);
PDE≔f__1⁡−ln⁡x+t,u⁡x,tx,ux,utx,ut,x,ux,x⁢x,ut,tx,ut,t,x,ux,x,x⁢x2,ut,x,x⁢x,ut,t,tx
When the arbitraryfunctionname is not indicated, as in this input above, the name used is of the form _Fn with n integer. The invariance of this PDE can be verified in various ways, the simplest of which is perhaps to use SymmetryTest, that verifies that S is a symmetry of PDE
SymmetryTest(S, PDE);
With InvariantEquations you can also compute the equation invariant under n-dimensional symmetry groups; consider for instance the following list of 5 symmetries of a problem that involves two dependent variables u⁡x,t,v⁡x,t
G := [[_xi[x] = 0, _xi[t] = 1, _eta[u] = 0, _eta[v] = 0], [_xi[x] = 0, _xi[t] = 0, _eta[u] = 1, _eta[v] = 0], [_xi[x] = 1, _xi[t] = 0, _eta[u] = 2*t, _eta[v] = 0], [_xi[x] = t, _xi[t] = 0, _eta[u] = t^2+x, _eta[v] = 0], [_xi[x] = 1/2*x+3/2*t^2, _xi[t] = t, _eta[u] = t^3+3*t*x, _eta[v] = -v]];
G≔_ξx=0,_ξt=1,_ηu=0,_ηv=0,_ξx=0,_ξt=0,_ηu=1,_ηv=0,_ξx=1,_ξt=0,_ηu=2⁢t,_ηv=0,_ξx=t,_ξt=0,_ηu=t2+x,_ηv=0,_ξx=x2+3⁢t22,_ξt=t,_ηu=t3+3⁢x⁢t,_ηv=−v
The related 1st order invariant PDE family is:
PDE := InvariantEquation(G, [u, v](x, t), arbitraryfunctionname = Lambda);
PDE≔Λ⁡vxv⁡x,t32,ux22−2⁢x+utv⁡x,t,ux⁢vx+vtv⁡x,t2
map(SymmetryTest, G, PDE, [u, v](x, t));
0,0,0,0,0
Maple now has an additional numerical solution method for ODE initial value problems, the Cash-Karp pair, available for use as the ck45 method. This pair is useful for solving nonstiff ODE problems and an extension of this method, called ck45_dae, has been added to handle Differential Algebraic Equation problems. In addition, the ck45 method tends to have slightly better performance than rkf45 for mildly stiff problems.
The default nonstiff ODE method is rkf45, but the ck45 method (and its DAE extension ck45_dae) can be invoked with the method option setting:
dsys1 := {diff(x(t),t)=y(t), diff(y(t),t)=x(t)+y(t),x(0)=2, y(0)=1};
dsys1≔xt=y⁡t,yt=x⁡t+y⁡t,x⁡0=2,y⁡0=1
dsn := dsolve(dsys1, numeric, method=ck45);
dsn:=procx_ck45...end proc
dsn(2);
t=2.,x⁡t=25.7240237105037,y⁡t=40.9727125531702
For more information, see dsolve/ck45.
See Also
Index of New Maple 14 Features
Download Help Document