We demonstrate below how to solve and simulate for a nonlinear BVP. For example, the following Maple code computes and simulates Example 4.3.
Set all parameters as default values
For drawing approximation graphics, we must type the following line
A user has to specify with (linalg) for linear algebra operations in Maple
A user can define the grid point size N for sinc-Galerkin approximation
The boundary conditions are given as Eq. (4.3).
P, Q and R are the variable coefficients of Eq. (1.1). In Maple for Eq. (4.3) they are defined as follows:
F is right side of Eq. (4.3)
We can write a nonlinear part of Eq. (1.1) as follows. User can define any form of nonlinearity in this section.
The main form of Eq. (1.1)
If the user needs, the main equation can be written in the latex format
In order to compare our method with the Newton interpolation (for nonlinear ODE) method, we first solve Eq. (4
.3) numerically as follows:
Prepare the plot of the Newton solution
To define , and matrices given in Eqs. (3.13)-(3.15), we use piecewise functions in Maple in the following way:
The parameters for sinc-approximation given 
The evenly spaced nodes given (2.9) and Table 1 are defined as follows:
The conformal map in Table 1 for sinc-Galerkin method and its derivatives is computed as follows:
The weight function and its derivatives are computed for using an inner product to discretization Eq. (4.3)
By using sinc-discretization in (3.16), the matrix system with
dimensions defined in (3.17) is obtained by the following iteration:
If we want to obtain solutions of linear BVPs, we can use the following lines. They can reduce time complexity. Here, the linear solution is given as a comment (“#”).
> #for Linear system
In this paper, we want to solve nonlinear problems. Then we use fsolve function given by Maple to find unknown coefficients (3.17)-(3.18) from nonlinear matrix systems. This function can solve any nonlinear systems by using the Newton method (for nonlinear equation systems).
Finally, we have unknown
coefficients for the approximate sinc-Galerkin solution (3.18)
We define plot of Eq. (4.3) obtained by the sinc-Galerkin solution
Simulation: Figure 5
, Figure 6
, and Figure 7
are obtained as
Enter the number of digits here
> Digits := 15:
, and 4
are obtained by the following code: