BVPs with Piecewise CoefficientsThe differential equations that arise in modern applications often have discontinuous coefficients. DSolve can handle a wide variety of such ODEs with piecewise coefficients. Some of the functions used in these equations are UnitStep, Max, Min, Sign, Abs, and Clip. These functions and combinations of them can be converted into Piecewise objects. This converts the given expression into a Piecewise expression. In[408]:=  |
Out[408]=
|
Here is the general solution to a first-order ODE that contains UnitStep. In[409]:=  |
Out[409]=
|
Here is the solution to the same ODE with an initial condition. In[410]:=  |
In[411]:=  |
Out[411]=
|
The solution can be plotted in the usual way. Note that the solution is continuous but not differentiable at . In[412]:=  |
This verifies the solution. In[413]:=  |
Out[413]=
|
Here is a piecewise ODE that has Max in its coefficients. In[414]:=  |
Out[414]=
|
In[415]:=  |
A piecewise ODE can be thought of as a collection of ODEs over disjoint intervals such that the expressions for the coefficients and the boundary conditions change from one interval to another. Thus, different intervals have different solutions, and the final solution for the ODE is obtained by patching together the solutions over the different intervals. For this piecewise ODE, the expression for FinalSol is obtained by patching together SolFromMinusInfinityToTwo and SolFromTwoToInfinity. The boundary condition for the interval (-Infinity, 2] is simply , while the initial condition for the interval [2, Infinity) is (given by the final value for the solution over the first interval). In[416]:=  |
Out[416]=
|
In[417]:=  |
Out[417]=
|
In[418]:=  |
Out[418]=
|
If there are a large number of discontinuities in a problem, it is convenient to use Piecewise directly in the formulation of the problem. This second-order ODE contains a Piecewise term. In[419]:=  |
In[420]:=  |
Out[420]=
|
This ODE contains the Clip function. The solutions are given in terms of Airy functions. In[421]:=  |
In[422]:=  |
Out[422]=
|
This concludes the discussion of different types of boundary value problems and their solutions. The next section will provide a basic working guide for using DSolve in an effective manner.
|