Professional Documents
Culture Documents
sksen.lias@gvpce.ac.in
4 Department of Mathematics, Texas A&M University-Kingsville, 700 University Blvd., MSC
172, Kingsville, Texas 78363-8202
Ravi.Agarwal@tamuk.edu
Abstract A fast converging iterative Matlab-based method to solve 3 distinct singular 2point boundary value problems occurring in circular membranes is presented. The
method uses mathematically derived lower and upper bounds of the solution. It converts
each of the BVPs into an initial value problem (IVP) iteratively through the linear
interpolation and the IVP is then solved directly through step-by-step integration. The
concerned Matlab program is automatic in the sense that it asks for the requisite data for
the desired one of the 3 problems. Having supplied the data, it executes the program and
takes care of the Matlab produced integration tolerance problem. Consequently it
produces the desired result without aborting the execution whenever the tolerance
problem is encountered. It is assumed that real-world data, instead of unrealistic ones, are
input to the program. The results are correct up to 4 decimal/significant digits usually
enough for engineering implementation. The computational complexity viz. the cost of
computation is not an issue for membrane problems considered here.
Keywords: automated Matlab solver; circular membranes; integration
tolerance problem; significant digits; singular nonlinear BVPs.
1. Introduction
We consider the following 3 nonlinear singular boundary value problems (BVPs)
associated with an ordinary differential equation (ODE).
Problems P1, P2, and P3 The second order ODE that models the radial stress in a circular
membrane under normal uniform pressure may be written as [1-7]
D 2 y (3 / x) Dy k / y 2 0, 0 x 1
(1)
2
2
2
where D d / dx, D d / dx , k 0 is a constant, x is the radial coordinate and y (x)
the radial stress. At the center (for symmetry), i.e., at, x = 0
Dy (0) 0
( 2)
y (1) 0
(3)
where is a constant which represents radial stress at the boundary viz. at x 1 , or the
condition
Dy (1) (1 v ) y (1) 0,
1 v 0
(4)
D 2 y (1/ t ) Dy (k / t 4 )(1/ y 2 ) 0, 1 t
(5)
as an infinite interval boundary value problem (BVP), where y (1) 0 and the value
of Dy (1) is such that y (t ) remains bounded. Or, more precisely, Dy () 0 .
We focus on the numerical solution of the following singular nonlinear boundary
value problems using known analytically derived lower and upper solutions [3], where
v1 1 v and v3 3 v :
(i)
2
2
Problem P1 ODE (1) with BCs (1), (3), and y ( x) [ , ( k /(8 ))(1 x ) ]
,
where is thelower solution and (k / (8 ))(1 x ) is the upper solution for P1.
2
(ii)
(iii)
the 1st and the 2nd functions within the square brackets correspond to lower and upper
solutions of the respective problems P1, P2, and P3. Note that the lower solution of P1
and P3 is a constant function y(x)=.
Problems P1 and P3 are essentially the same except that P3 is derived by the
nonlinear transformation x 1 / t from P1. This transformation has both advantages and
disadvantages in numerical implementation. However, we discuss to which extent the
transformation helps to enable us to select one of P1 and P3 for computer
implementation. The knowledge of lower and upper solutions, though not essential, is
helpful specifically when the problem is computationally sensitive [8].
3
The computational procedures to solve the problems P1, P2, and P3 that include a
simple linear interpolation method for quick convergence of these singular 2-point
nonlinear BVPs in just a few iterations are described in Sec. 2. Sec. 3 consists of the
concerned Matlab programs along with the numerical solutions and the corresponding
graphical representations while conclusions are included in Sec. 4.
2. The procedure
The numerical solution procedures for a general 2-point BVP associated with an ODE
linear or nonlinear, coupled or not have already been discussed [9-11]. In the procedure
to solve anyone of the nonlinear BVPs P1, P2, and P3 we have chosen arbitrarily a
numerical value for the dependent variable y at x=0 (0 + in an engineering application
since x=0 is a singular point) and computed the true initial conditions which corresponds
to the concerned boundary conditions. As a matter of fact we convert the BVP into an
initial value problem (IVP) and the nonlinear BVP is then solved iteratively using
successive linear interpolation. The iteration uses the mathematical lower and upper
solution bounds within which the true numerical solution is present. If the bounds bracket
a reasonably narrow interval, then we do not normally encounter any integration
tolerance (dominant/unacceptable error) problem and the SLIP (successive linear
interpolation procedure described in Sec. 2.1 below) can be implemented without
modification of the lower or upper bound to obtain the solution of the BVP. If, on the
other hand, the interval is wider, the integration tolerance problem could crop up. This
indicates one of the lower and upper bounds that were used in converting the 2-point
BVP into an IVP is far away from the original initial condition and needs to be modified.
If lower bound is away from the original intial condition then we modify the lower bound
else the upper bound and implement the SLIP in the shrunk (new) interval. We continue
this process successively till we get a sufficiently accurate solution of the problem. In
order to achieve shrinking we divide the most recent interval into a number of
subintervals and discard that subinterval which does not contain the original initial
condition.
We have implememnted the foregoing procedure using Matlab programs. Here we
have not only generalized and automated the Matlab programs given in [1, 2] but also
have simplified them by omitting unwanted loops. It is now convenient for the reader to
directly change the numerical values of the parameters k, , and and carry out
numerical experiments to get deeper insight into the physical problem. In addition, the
programs permit manipulating (increasing or decreasing) the number of intervals of the
independent variable x in the specified region to get the desired accuracy. In the earlier
Matlab programs [1, 2], the integration tolerance problem, whenever encountered,
aborted the execution of the programs. We then had to manually insert more appropriate
data and reexecute them. In the present paper the program is automated in such a way
that the progam itself obviates the tolerance problem and produces the required solution.
2.1 Successive linear interpolation procedure (SLIP) The SLIP is explained using
problem P2 and is equally valid for problems P1 and P3. The ODE (1) with BCs (2) and
4
(4) viz. problem P2 can be rewritten as, permitting the symbol to denote representing1
and for notational convenience,
D 2 y ADy By C ,
(6)
BCs : at x a 0.0001 ( 0 ), Dy 0 while at x b 0.9991 ( 1 ), v1 y Dy 0
3
where v1 = 1 v, A 3 / x, B k / y , C 0 are, in general, functions of x and y.
Suppose k=0.1 and v = 0.5. Let at x a 0.0001 , y = ya = 1 (some arbitrary numerical
value chosen here as the lower solution y = 1 = 0.3969). Also, at x a 0.0001 , y = ya
= 2 (another arbitrary numerical value chosen here as the upper solution y = 2 =
0.4605).
There are two ways by which we can scan the whole region (interval), viz., upper
solution lower solution = 2 1. The implementation of these ways is achieved
through a Matlab program as shown later.
For the sake of explaining the SLIP procedure, we consider, without introducing
any confusion, the whole interval 2 1 as one subinterval. Let
v1 yb Dyb F1 at x b 1 with y a 1 ,
(7)
v1 yb Dyb F2 at x b 1 with y a 2
(8)
r 1 [(1 2 ) F1 / ( F1 F2 )].
(9)
v1 yb Dyb Fr at x b 1 with ya r ,
(10)
We then take F1, 1 from equation (7) or F2, 2 from equation (8) based on their proximity
to the second boundary condition (zero) and Fr, r from equation (10) to continue this
procedure iteratively till we get the desired accuracy subject to the precision of the
computer/program used [12]. Having known the sufficiently accurate , the BVP
becomes/gets converted to an IVP which is then directly numerically solved.
1 Although the symbol denotes is essentially equal to [11, 13], we use this symbol to
denote representing. This usage does not have the significant potential to mislead a
reader since a symbol 1 represents anyone of infinite possible values sufficiently close
(in the given context) to 1 and strictly less than 1.
5
If either 1 or 2 are relatively away from the original value of y at x=a (original initial
condition), then we encounter an integration tolerance problem. To overcome this
difficulty we modify the interval 2 1. If 1 i.e., lower bound is relatively farther away
1 1 [( 2 1 ) / p] Otherwise we modify as
then we modify 1 as
2
2 2 [( 2 1 ) / p] and use SLIP. Here p = number of subintervals choosen suitably.
If there is no integration tolerance problem then there is no need to divide the interval
2 1 into p subintervals. However, whenever this tolerance problem occurs p which is
initially taken as 7 (Here by numerical experiment we have found that p=7 is an optimal
value. This value of p may be increased in case of an extreme ill-conditioned problem)
will be incremented by 7 till the problem is obviated.
We continue the process of modification as before till the tolerance problem
persists. Having obviated the tolerance problem we now implement the SLIP in the single
(final) shrunk interval (as depicted in the Matlab program) and obtain the required IVP
that corresponds to the given BVP. This procedure implemented in Matlab is not only
more general than the Matlab programs presented in [1] but also automatic and knows no
failure for real-world problems.
3. Matlab Programs with Results
We present Matlab programs and the numerical results along with graphs for a reader to
readily visualize and appreciate the computational importance of the membrane problem
under consideration. These programs can be readily copied, pasted, and modified, if
necessary. This will enable a reader to carry out numerical experiments, see for
herself/himself the utility of the programs in many similar possible problems and get
herself/himself enlightened.
It can be seen that these Matlab programs have been automated as well as made
fail-proof unlike the ones presented in [1, 2].
Main Program
function[c]=membrn_bvp(r)
if r==1
disp('Problem 1 data')
k1=input('k value =');
lmda=input('lmda value =');
a=0.0001; %('starting value of x');
b=0.9995; %('final value of x');
n=30; %('no. of intervals');
feval(@p1f1,k1,lmda,a,b,n)
else if r==2
disp('Problem 2 data')
k1=input('k value =');
v=input('nu value =');
a=0.0001; %('starting value of x');
b=0.9995; %('final value of x');
6
n=30; %input('no. of intervals');
feval(@p2f1,k1,v,a,b,n)
else if r==3
disp('Problem 3 data')
k1=input('k value =');
lmda=input('lmda value =');
a=0.0333; %('starting value of x');
b=0.9995; %('final value of x');
n=30; % ('no. of intervals');
feval(@p3f1,k1,lmda,a,b,n)
else
disp('invalid number assigned to r')
end;
end;
end;
Problem P1 Consider the Problem P1: y + k/y2 + (3/x)y = 0, 0 < x < 1 with boundary
conditions y(0) = 0, y(1) = > 0, where y(x) (k/82)(1x2)+ . Observe that
Problem P1 is free from parameter v but depends on The Matlab program for this
problem, is as follows.
% The main program uses the following program to solve Problem P1
function [] =p1f1(k1,lmda,a,b,n)
global k;
k=k1;h=(b-a)/n;
x = a : h : b;m=size(x);s=m(1,2);
fprintf('\n The solution bounds when k = %f and lmda=%f\n', k, lmda)
%The values of k, lamda can be changed at the input as and when it is required.
fprintf('\n \tx\t lowerbound\t upperbound \n')
for j = 1:s
xx = x(j);
alpha=lmda; beta = (k/(8*lmda^2))*(1-x(j)^2)+lmda;
lbs = alpha; lb(j)=lbs; ubs = beta; ub(j)=ubs;
fprintf('%7.4f\t %7.4f\t %7.4f \n', xx, lb(j), ub(j))
end
fprintf('\n Lower soln at x=0+ Upper soln at x=0+ \n')
fprintf('%7.4f
%7.4f \n', lb(1), ub(1)),
[Y]=p1f2(lmda,a,b,h,lb(1), ub(1));
%The program uses the subprograms p1f2 which in turn uses another subprogram
%ydash1 to compute successive iterative solns
fprintf('\n Col 1: x, Cols 2, 3, .., last but one: successive iterated sols y(x), Col last:
true sol y(x) \n')
Y1=[x' Y],
s=size(Y); Yf = s(:, 2); ts = Y(:, Yf);
plot(x', lb, 'r+', x', ub, 'bx', x', ts, 'ko', x', Y);
xlabel('x'); ylabel('Solution y(x) for ODE D^2y + k/y + 3Dy/x=0');
7
title('Convergence of solns y(x) between lower and upper solns');
legend('Lower soln','Upper soln', 'True soln', 'Iterated solns');
%SECOND FILE
%subprogram to solve the ode iteratively
function[Y]=p1f2(lmda,a,b,h,lb,ub)
xspan=a:h:b;
sz=size(xspan); lx=sz(1, 2); p=0;
% lx denotes the no of values of x at which we are calculating the solution
flag=1; j=1
while(flag)
I=ub-lb;
if I<=3,
%In the specified context, if the interval of upper and lower solutions
%is too large then such an interval may not be of much use. In the
%current membrane problem, the length of the interval between lower and upper
%bounds, should be preferably at most 3.
step=I;
%step denotes the length of the interval between lower and upper bounds of the
% solution y(x). step needs to be appropriately divided into subintervals
%whenever the tolerance problem crops up. We have taken the
%number of subintervals as 7 and this has worked well for most of the problems
%considered. When this number fails to obviate the tolerance problem by
%indicating an error message we increase suitably this no. of subintervals.
[xlb,ylb]=ode15s('ydash1', xspan, [lb,0]);
[xub,yub]=ode15s('ydash1', xspan, [ub,0]);
% The following part of the program determines which of the bounds
%(lower/upper) causes the integration tolerance problem and accordingly modify
%the interval. If the problem occurs at the lower bound then we increase the
%lower bound by an amount step/7 else we decrease the upper bound by step/7.
nxlb=size(xlb'); mxlb=nxlb(1,2);
nxub=size(xub'); mxub=nxub(1,2);
if (mxlb==lx && mxub==lx)||(mxlb~=lx && mxub~=lx)
flb=ylb(lx,1)-lmda; fub=yub(lx,1)-lmda;
newy0=lb-(flb*((ub-lb)/(fub-flb)));
y0=[newy0,0];
[xr,y]=ode15s('ydash1',xspan,y0);
sizexr=size(xr);szr=sizexr(1,1);
if (szr==lx)||j>101
flag=0;
else
p=p+10;
lb=lb-(step/p);
ub=ub-(step/p);
end
8
j=j+1
else
p=p+7;
if mxlb~=lx
lb=lb+(step/p);
else ub=ub-(step/p);
% Here (1/p)th part of the interval (lb, ub) is deleted from consideration.
% p value is being modified (incremented by 7) each time the integration
% tolerance problem is encounterd. We can change this depending on the context
% and sensitiveness of the solution. We have not come across the condition
% (mxlb~=lx && mxub~=lx) in our extensive numerical experiments, it is
% possible to encounter this case though.
end
end
else
disp('no solution found')
break;
end
end;
p,
j=1; flag=1; p=0
while (flag=1)
newy0=lb-(flb*(ub-lb)/(fub-flb));
y0=[newy0,0];
[xr,y]=ode15s('ydash1',xspan,y0);
soln=[xr, y];
sizexr=size(xr);szr=sizexr(1,1);
if (szr~=lx)
p=p+30;
lb=lb+(step/p);
ub=ub-(step/p);
[xlb,ylb]=ode15s('ydash2', xspan, [lb,0]);
[xub,yub]=ode15s('ydash2', xspan, [ub,0]);
%[xlb,ylb]=ode23tb('ydash2', xspan, [lb,0]);
%[xub,yub]=ode23tb('ydash2', xspan, [ub,0]);
flb=ylb(lx,1)-lmda, fub=yub(lx,1)-lmda,
else
if (szr==lx)||j>20
fr=y(lx,1)-lmda;Z=soln(:,2);
Y(:,j)=Z;
% the columns of Y contains the successive iterative solutions,
%where the last column of Y should be the true soln. y(x).
j=j+1;
if abs(fr)<=0.5*10^-4
%For ill-conditioned problems replace '10^-4' '10^-3',
% since for almost all problems 3-digit accuracy is good.
9
rs=[xr, y];
fprintf('\n fr denotes accuracy of final soln \n')
fr, flag=0;
% abs(fr) denotes the (decimal digit) accuracy of the solution
end;
if abs(flb)<abs(fub)
ub=newy0;fub=y(lx,1)-lmda;
else
lb=newy0;flb=y(lx,1)-lmda;
end;
end;
end;
end;
ts=rs(:,2);
% ts represents the true or, equivalently, the final iterated numerical solution.
%THIRD FILE ydash1
%subsubprogram ydash1
function ydash1=f(x, y);
global k
%Keep this function subprogram in a DIFFERENT file named "ydash1".
%k is a global variable whose value can be modified at the input level in the name of
k1.
ydash1=[y(2); -k/y(1)^2 - 3*y(2)/x];
Numerical results The foregoing programs provide the solution of problem P1 as
follows. Here the value of two input parameters k and , are asked for in the Matlab
program and then will be supplied by the user. The following abreviations viz. lb and ub
denote lower bound and the upper bound of the solution y(x).
Example 1
>> membrn_bvp(1)
Problem 1 data
k value =0.3
lmda value =0.6
lb
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
ub
0.7042
0.7041
0.7037
0.7031
0.7023
0.7013
0.2000
0.2333
0.2666
0.2999
0.3332
0.3665
0.3999
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.7000
0.6985
0.6968
0.6948
0.6926
0.6902
0.6875
10
0.4332
0.6000
0.6846
0.7330
0.6000
0.4665
0.6000
0.6815
0.7663
0.6000
0.4998
0.6000
0.6781
0.7996
0.6000
0.5331
0.6000
0.6746
0.8329
0.6000
0.5664
0.6000
0.6707
0.8662
0.6000
0.5997
0.6000
0.6667
0.8996
0.6000
0.6331
0.6000
0.6624
0.9329
0.6000
0.6664
0.6000
0.6579
0.9662
0.6000
0.6997
0.6000
0.6532
0.9995
0.6000
Lower soln at x=0+ Upper soln at x=0+
0.6000
0.7042
fr = -2.3584e-008
abs(fr) denotes the (decimal digit) accuracy of the final/true solution.
0.6482
0.6430
0.6376
0.6319
0.6260
0.6199
0.6135
0.6069
0.6001
In Y1, Col 1 represents the x-values while Cols 2, 3, ..., last but one represent successive
iterated sols y(x) and the last column denotes true sol y(x) or, equivalently, required
numerical solution y(x).
Y1 =
0.0001 0.6883 0.6888 0.6889
0.0334 0.6882 0.6887 0.6888
0.0667 0.6878 0.6883 0.6883
0.1000 0.6871 0.6876 0.6876
0.1334 0.6864 0.6869 0.6869
0.1667 0.6854 0.6859 0.6859
0.2000 0.6842 0.6847 0.6847
0.2333 0.6830 0.6835 0.6835
0.2666 0.6815 0.6820 0.6820
0.2999 0.6797 0.6802 0.6803
0.3332 0.6780 0.6785 0.6786
0.3665 0.6761 0.6766 0.6767
0.3999 0.6740 0.6745 0.6746
0.4332 0.6718 0.6723 0.6723
0.4665 0.6694 0.6699 0.6700
0.4998 0.6668 0.6673 0.6673
0.5331
0.5664
0.5997
0.6331
0.6664
0.6997
0.7330
0.7663
0.7996
0.8329
0.8662
0.8996
0.9329
0.9662
0.9995
11
The following graph (Fig.1) for k=0.3 and lmda=0.6 gives the lower, the upper, the true,
and the iterated solutions.
Example 2
>> membrn_bvp(1)
Problem 1 data
k value =0.7
lmda value =0.6
The solution bounds when k = 0.7 and lmda=0.6 are as follows. Here we have omitted
intermediate numerical values (produced by Matlab) to conserve space.
x
0.0001
0.0334
0.0667
lb
0.6000
0.6000
0.6000
ub
0.8431
0.8428
0.8420
0.9329
0.9662
0.9995
0.6000
0.6000
0.6000
0.6315
0.6162
0.6002
12
0.0001 0.7916 0.7690 0.7719 0.7720
0.0334 0.7914 0.7688 0.7717 0.7718
0.0667 0.7909 0.7681 0.7711 0.7711
Example 3
>> membrn_bvp(1)
Problem 1 data
k value =0.8
lmda value =0.5
0.0001
0.5000
0.9000
0.9329
0.0334
0.5000
0.8996
0.9662
0.0667
0.5000
0.8982
0.9995
0.5000
0.5000
0.5000
0.5519
0.5266
0.5004
13
reducing the step size below the smallest value allowed (1.776357e015) at time t.
> In ode15s at 819
In tp1f2 at 9
In p1f1 at 17
In membrn_bvp at 9
Warning: Failure at t=9.030818e-001.
Unable to meet integration
tolerances without
reducing the step size below the smallest value allowed (1.776357e015) at time t.
> In ode15s at 819
In tp1f2 at 9
In p1f1 at 17
In membrn_bvp at 9
Warning: Failure at t=9.627215e-001.
Unable to meet integration
tolerances without
reducing the step size below the smallest value allowed (1.776357e015) at time t.
> In ode15s at 819
In tp1f2 at 9
In p1f1 at 17
In membrn_bvp at 9
The above mentioned warnings were produced by Matlab. Accordingly the Matlab
program automatically went on modifying (shrinking) the original interval for each
warning successively. Thus we overcome the tolerance or, equivalently, the unacceptable
error problem.
fr = 2.6986e-005
abs(fr) denotes the (decimal digit) accuracy of the final/true solution.
In Y1, Col 1 represents the x-values while Cols 2, 3, ..., last but one represent successive
iterated sols y(x) and the last column denotes true sol y(x) or, equivalently, required
numerical solution y(x).
Y1 =
Columns 1 through 5
0.0001 0.7934 0.7211 0.7336 0.7325
0.0334 0.7932 0.7208 0.7333 0.7322
0.0667 0.7924 0.7201 0.7326 0.7315
14
15
16
Fig. 7 k=1 and =1.25 for Problem P1
(solutionfound only in two iterations)
If we take k=2 and vary , similar patterns are observed (as in the case for k=1). That is,
if is increased progressively, the lower and upper solutions come increasingly closer
(Figs. 10, 11, and 12). If, on the other hand, is decreased then the integration tolerance
problem crops up (Fig. 13).
17
18
fprintf('\n Col 1: x, Cols 2, 3, .., last but one: successive iterated sols y(x), Col
last: true sol y(x) \n')
Y1=[x' Y],
%fprintf('%7.4f %7.4f %7.4f %7.4f %7.4f %7.4f %7.4f \n', x', Y)
s=size(Y); Yf = s(:, 2); ts = Y(:, Yf);
plot(x', lb, 'r+', x', ub, 'bx', x', ts, 'ko', x', Y);
xlabel('x'); ylabel('Solution y(x) for ODE D^2y + k/y + 3Dy/x=0');
title('Convergence of solns y(x) between lower and upper solns');
legend('Lower soln','Upper soln', 'True soln', 'Iterated solns');
%SECOND FILE
%subprogram p2f2
function[Y]=p2f2(v, a,b,h, lb, ub)
xspan=a:h:b;
sz=size(xspan); lx=sz(1, 2); p=0;
flag=1; j=1
while (flag)
I=ub-lb;
if I<=3,
%In the specified context, if the interval of upper and lower solutions
%is too large then such an interval may not be of much use. In the
%current membrane problem, the length of the interval between lower and upper
%bounds, should be preferably at most 3.
step=I;
%step denotes the length of the interval between lower and upper bounds of the
% solution y(x). step needs to be appropriately divided into subintervals
%whenever the tolerance problem crops up. We have taken the
%number of subintervals as 5 and this has worked well for most of the problems
%considered. When this number fails to obviate the tolerance problem by
%indicating an error message we increase suitably this no. of subintervals.
[xlb,ylb]=ode15s(' ydash2', xspan, [lb,0]);
[xub,yub]=ode15s(' ydash2', xspan, [ub,0]);
% The following part of the program determines which of the bounds
%(lower/upper) causes the integration tolerance problem and accordingly modify
% the interval. If the problem occurs at the lower bound then we increase the
% lower bound by an amount step/7 else we decrease the upper bound by step/7.
nxlb=size(xlb'); mxlb=nxlb(1,2);
nxub=size(xub'); mxub=nxub(1,2);
if (mxlb==lx && mxub==lx)||(mxlb~=lx && mxub~=lx)
flb=(1-v)*ylb(lx,1)+ylb(lx,2);
fub=(1-v)*yub(lx,1)+yub(lx,2);
newy0=lb-(flb*((ub-lb)/(fub-flb)));
y0=[newy0,0];
[xr,y]=ode15s('ydash1',xspan,y0);
19
soln=[xr, y];
sizexr=size(xr);szr=sizexr(1,1);
if (szr==lx)||j>100
flag=0;
else
p=p+10;
lb=lb-(step/p);
ub=ub-(step/p);
end
j=j+1
else
p=p+7;
if mxlb~=lx
lb=lb+(step/p);
else ub=ub-(step/p);
end;
% Here (1/p)th part of the interval (lb, ub) is deleted from consideration.
% p value is being modified (incremented by 7) each time the integration
% tolerance problem is encounterd.
% We can change this depending on the context and sensitiveness of the solution.
% We have not come across the condition (mxlb~=lx && mxub~=lx) in our
% extensive numerical experiments, it is possible to encounter this case though.
end
else
disp('no solution found')
break;
end
end;
j=1; flag=1; p=0;
while (flag=1)
newy0=lb-(flb*(ub-lb)/(fub-flb));
y0=[newy0,0];
[xr,y]=ode15s ('ydash2',xspan,y0);
soln=[xr, y];
sizexr=size(xr); szr=sizexr(1,1);
if (szr~=lx)
p=p+30;
lb=lb+(step/p),
ub=ub-(step/p),
[xlb,ylb]=ode15s('ydash2', xspan, [lb,0]);
[xub,yub]=ode15s('ydash2', xspan, [ub,0]);
flb=(1-v)*ylb(lx,1)+ylb(lx,2);
fub=(1-v)*yub(lx,1)+yub(lx,2);
else
20
if (szr==lx)||j>20
fr=(1-v)*y(lx,1)+y(lx,2);Z=soln(:,2);
Y(:,j)=Z;
% the columns of Y contains the successive iterative solutions
%where the last column of Y should be the true soln. y(x).
j=j+1;
if (abs(fr)<=0.5*10^-4)||(j>30)
fprintf('\n fr denotes accuracy of final soln \n')
%For ill-conditioned problems replace '10^-4' '10^-3',
% since for almost all problems 3-digit accuracy is good.
rs=[xr, y]; fr,
fprintf('\n fr denotes accuracy of final soln \n')
flag=0;
% abs(fr) denotes the (decimal digit) accuracy of the solution
end;
if abs(flb)< abs(fub)
ub=newy0;fub=(1-v)*y(lx,1)+y(lx,2);
else
lb=newy0;flb=(1-v)*y(lx,1)+y(lx,2);
end;
end;
end;
end
ts=rs(:,2);
% ts represents the true or, equivalently, the final iterated numerical solution.
THIRD FILE
%subsubprogram ydash2
function ydash2=f(x, y);
global k;
%Keep this function subprogram in a DIFFERENT file named "ydash2".
% k is a global variable whose value can be modified at the input level
% in the name of k1.
ydash2=[y(2); -k/y(1)^2 - 3*y(2)/x];
Numerical results The foregoing programs provide the solution of problem P2 as
follows. Here the value of two input parameters k and , are asked for in the Matlab
program and then will be supplied by the user. The following abreviations viz. lb and ub
denote lower bound and the upper bound of the solution y(x).
Example 4
>> membrn_bvp(2)
Problem 1 data
k value =0.75
nu value =0.1
21
The solution bounds when k = 0.75 and =0.1
x
lb
ub
0.1000
0.0001
0.6710
0.8596
0.1000
0.0334
0.6707
0.8593
0.1000
0.0667
0.6701
0.8584
0.1000
0.1000
0.6689
0.8569
0.1000
0.1334
0.6673
0.8548
0.1000
0.1667
0.6652
0.8522
0.1000
0.2000
0.6627
0.8489
0.1000
0.2333
0.6596
0.8451
0.1000
0.2666
0.6562
0.8406
0.1000
0.2999
0.6522
0.8356
0.1000
0.3332
0.6479
0.8300
0.1000
0.3665
0.6430
0.8237
0.1000
0.3999
0.6377
0.8169
0.1000
0.4332
0.6319
0.8095
0.1000
0.4665
0.6257
0.8015
lb
0.1000
0.7929
0.1000
0.7838
0.1000
0.7740
0.1000
0.7636
0.1000
0.7527
0.1000
0.7411
0.1000
0.7290
0.1000
0.7163
0.1000
0.7029
0.1000
0.6890
0.1000
0.6745
0.1000
0.6594
0.1000
0.6437
0.1000
0.6274
0.1000
0.6106
0.1000
0.5931
0.4998
0.6190
0.5331
0.6118
0.5664
0.6042
0.5997
0.5961
0.6331
0.5875
0.6664
0.5785
0.6997
0.5690
0.7330
0.5591
0.7663
0.5487
0.7996
0.5378
0.8329
0.5265
0.8662
0.5147
0.8996
0.5025
0.9329
0.4898
0.9662
0.4766
0.9995
0.4630
ub
22
Y1 =
Columns 1 through 5
0.0001
0.7523
0.0334
0.7521
0.0667
0.7512
0.1000
0.7501
0.1334
0.7485
0.1667
0.7467
0.2000
0.7444
0.2333
0.7418
0.2666
0.7390
0.2999
0.7358
0.3332
0.7318
0.3665
0.7277
0.3999
0.7231
0.4332
0.7181
0.4665
0.7127
0.4998
0.7068
0.5331
0.7005
0.5664
0.6937
0.5997
0.6865
0.6331
0.6787
Columns 6 through 8
0.7786
0.7440
0.7502
0.7785
0.7437
0.7499
0.7777
0.7430
0.7493
0.7766
0.7420
0.7479
0.7752
0.7406
0.7465
0.7734
0.7389
0.7445
0.7713
0.7368
0.7422
0.7688
0.7343
0.7395
0.7662
0.7315
0.7365
0.7632
0.7282
0.7333
0.7596
0.7245
0.7298
0.7557
0.7204
0.7253
0.7514
0.7159
0.7208
0.7467
0.7109
0.7158
0.7417
0.7055
0.7102
0.7362
0.6995
0.7042
0.7304
0.6932
0.6979
0.7241
0.6863
0.6911
0.7174
0.6789
0.6838
0.7103
0.6710
0.6759
23
0.6852
0.6774
0.6691
0.6602
0.6507
0.6406
0.6297
0.6853
0.6776
0.6692
0.6603
0.6508
0.6407
0.6299
0.6854
0.6776
0.6693
0.6604
0.6509
0.6408
0.6299
0.6182
0.6060
0.5928
0.5789
0.5640
0.5481
0.6184
0.6061
0.5930
0.5791
0.5642
0.5483
0.6184
0.6062
0.5931
0.5791
0.5642
0.5484
24
25
26
Problem P3 Observe that Problems P1 and P3 are independent of . They depend on
and k only. The Matlab program for problem P3 is as follows.
% The main program uses the following program to solve Problem P3
function [] = p3f1(k1,lmda,a,b,n)
global k, k=k1;h=(b-a)/n;
x = a:h:b; t=1./x; m=size(t); s=m(1,2);
fprintf('\n The solution bounds when k = %f and lmda=%f\n', k, lmda)
fprintf('\n t
lowerbound upperbound \n')
for j = 1:s
tt = t(j); alpha=lmda; beta = (k/(8*lmda^2))*(1-(1/t(j)^2))+lmda;
lbs = alpha; lb(j)=lbs; ubs = beta; ub(j)=ubs;
fprintf('%7.4f
%7.4f
%7.4f \n', tt, lb(j), ub(j))
end
fprintf('\n Lower soln at t=inf Upper soln at t=inf \n')
fprintf('%7.4f
%7.4f \n', lb(1), ub(1)),
[Y]=p3f2(lmda,a,b,h,lb(1), ub(1));
%The program uses the subprograms p3f2 which in turn uses another subprogram
%ydash3 to compute successive iterative solns
fprintf('\n Col 1: t, Cols 2, 3, .., last but one: successive iterated sols y(t), Col last:
true sol y(t) \n')
Y1=[t' Y],
s=size(Y); Yf = s(:, 2); ts = Y(:, Yf);
plot(t', lb, 'r+', t', ub, 'bx', t', ts, 'ko', t', Y);
xlabel('t'); ylabel('Solution y(t) for ODE D^2y + (k/t^4)(1/y^2) - Dy/t=0');
title('Convergence of solns y(t) between lower and upper solns');
legend('Lower soln','Upper soln', 'True soln', 'Iterated solns');
%SECOND FILE
%subprogram p3f2
function[Y]=p3f2(lmda,a,b,h,lb, ub);
xspan=a:h:b;
tspan=1./xspan;
sz=size(tspan); lt=sz(1, 2); p=0;
flag=1;
while(flag)
I=ub-lb;
if I<=3,
%In the specified context, if the interval of upper and lower solutions
%is too large then such an interval may not be of much use. In the
%current membrane problem, the length of the interval between lower and upper
%bounds, should be preferably at most 3.
step=I;
27
%step denotes the length of the interval between lower and upper bounds of the
% solution y(x). step needs to be appropriately divided into subintervals
%whenever the tolerance problem crops up. We have taken the
%number of subintervals as 5 and this has worked well for most of the problems
%considered. When this number fails to obviate the tolerance problem by
%indicating an error message we increase suitably this no. of subintervals.
[tlb,ylb]=ode15s('ydash3', tspan, [lb,0]);
[tub,yub]=ode15s('ydash3', tspan, [ub,0]);
% the following part of the program determines which of the bounds (lower/upper)
% causes the integration tolerance problem and accordingly modify the interval.
% If the problem occurs at the lower bound then we increase the lower bound by
% an amount step/12 else we decrease the upper bound by step/12.
ntlb=size(tlb'); mtlb=ntlb(1,2);
ntub=size(tub'); mtub=ntub(1,2);
if (mtlb==lt && mtub==lt)||(mtlb~=lt && mtub~=lt)
flb=ylb(lt,1)-lmda; fub=yub(lt,1)-lmda;
newt0=lb-(flb*(ub-lb)/(fub-flb));
t0=[newt0,0];
[tr,y]=ode15s('ydash3',tspan,t0);
%[tr,y]=ode23tb('ydash3',tspan,t0);
soln=[tr, y];
sizetr=size(tr);szr=sizetr(1,1);
n=1
if (szr==lt)||(n>10)
flag=0;
else
p=p+30;
lb=lb-(step/p),
ub=ub-(step/p),
end;
n=n+1
else
p=p+7,
if mtlb~=lt
lb=lb+(step/p);
else ub=ub-(step/p);
end
% Here (1/p)th part of the interval (lb, ub) is deleted from consideration.
% p value is being modified (incremented by 7) each time the integration
% tolerance problem is encounterd.
% We can change this depending on the context and sensitiveness of the solution.
% We have not come across the condition (mxlb~=lx && mxub~=lx) in our
% extensive numerical experiments, it is possible to encounter this case though.
end
28
else
disp('no solution found')
break;
end
end;
j=1;
flag=1; p=0;
while (flag)
newt0=lb-(flb*(ub-lb)/(fub-flb));
t0=[newt0,0];
[tr,y]=ode15s('ydash3',tspan,t0);
soln=[tr, y];
fr=y(lt,1)-lmda;Z=soln(:,2);
Y(:,j)=Z;
% the columns of Y contains the successive iterative solutions
%where the last column of Y should be the true soln. y(x).
j=j+1;
if (abs(fr)<=0.5*10^-4)||(j>30)
%For ill-conditioned problems replace '10^-4' '10^-3',
% since for almost all problems 3-digit accuracy is good.
rs=[tr, y]; fr,
fprintf('\n fr denotes accuracy of final soln \n')
flag=0;
% abs(fr) denotes the (decimal digit) accuracy of the solution
end;
if abs(flb)< abs(fub)
ub=newt0;fub=y(lt,1)-lmda;
else
lb=newt0;flb=y(lt,1)-lmda;
end;
end;
ts=rs(:,2);
% ts represents the true or, equivalently, the final iterated numerical solution.
%THIRD FILE ydash3
%subsubprogram ydash3
function ydash3=f(t, y);
global k
%Keep this function subprogram in a DIFFERENT file named " ydash3".
% k is a global variable whose value can be modified at the input level
% in the name of k1
ydash3=[y(2); -(k/t^4)*(1/y(1)^2)+y(2)/t];
Numerical results for Problem P3
29
Example 5
>> membrn_bvp(3)
Problem 3 data
k value =0.5
lmda value =0.6
lb
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
ub
0.7734
0.7729
0.7720
0.7707
0.7690
0.7671
0.7647
0.7620
0.7589
0.7555
0.7517
0.7475
0.7430
0.7381
0.7329
1.9365
1.8228
1.7217
1.6313
1.5498
1.4762
1.4092
1.3480
1.2919
1.2403
1.1927
1.1485
1.1076
1.0694
1.0338
1.0005
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.6000
0.7273
0.7214
0.7150
0.7084
0.7013
0.6939
0.6862
0.6781
0.6696
0.6608
0.6516
0.6420
0.6321
0.6218
0.6112
0.6002
0.1734
0.7324
0.7320
0.7314
0.7305
0.7294
0.7280
0.7264
0.7245
3.4370
3.0944
2.8140
2.5802
2.3822
2.2125
2.0653
1.9365
0.7286
0.7263
0.7237
0.7208
0.7177
0.7144
0.7107
0.7068
0.7223 0.7224
0.7199 0.7201
0.7173 0.7174
0.7144 0.7145
0.7112 0.7114
0.7078 0.7079
0.7040 0.7042
0.7001 0.7002
30
1.8228
1.7217
1.6313
1.5498
1.4762
1.4092
1.3480
1.2919
1.2403
0.7026
0.6981
0.6933
0.6882
0.6827
0.6770
0.6709
0.6645
0.6577
0.6958 0.6959
0.6912 0.6913
0.6863 0.6865
0.6811 0.6813
0.6755 0.6757
0.6697 0.6699
0.6635 0.6637
0.6569 0.6571
0.6500 0.6502
1.1927
1.1485
1.1076
1.0694
1.0338
1.0005
0.6505
0.6430
0.6350
0.6267
0.6178
0.6086
0.6427
0.6350
0.6268
0.6183
0.6093
0.5998
0.6429
0.6352
0.6270
0.6185
0.6095
0.6000
31
32
4. CONCLUSIONS
Need for lower and upper solutions In the successive linear interpolation procedure to
solve the nonlinear singular BVPs we have made use of mathematically derived upper
and lower solution bounds. These bounds are not essential to solve the singular BVPs.
However, the knowledge of the reasonably narrow bounds imposed by the lower and
upper solutions is useful particularly, in sensitive problems, i.e., the problems where the
solution is violently fluctuating [8]. Interestingly we, through our numerical experiments,
discovered that such bounds are indeed useful for solving ODEs similar to problems P1,
P2, and P3. In fact, if we do not make use of the bounds, we might end up searching vast
real region without hitting at the true initial value(s) of the given BVP. This is particularly
so when the singular nonlinear ODE is ill-posed. Searching for a solution in a reasonably
narrow interval bounded by lower and upper solutions not only minimizes the computing
time but also obviates the failure in obtaining the solution.
Presented Matlab programs versus the ones in [1] The Matlab programs here are more
general than given in [1] on two counts. First, we have used only symbolic parameters as
input arguments of the program instead of their actual numerical values as used in [1].
For instance, in [1], an explicit numerical value is used instead of symbolic parameter k
in the subprogram ydash. This is avoided by declaring k as global variable in both the
main program and the concerned subprogram.
Evidently, this makes the programs more general. Also the programs avoid
undesired modifications in their command structure whenever input numerical data are
changed.
Second, and most importantly, the integration tolerance problem is obviated for
almost all real-world problems. The programs along with the appropriate comments
inserted are simple and easily readable without practically requiring formal programming
knowledge. Morever, they are also flexible to take care of wider variety of problems. If a
problem which does not come under this variety can still be tackled by a simple
modification of a command or two in the program.
Scope of the Matlab programs among other programming languages The Matlab
programs are very high-level, and easily readable without needing practically any
knowledge of a formal programming language. This is quite unlike other lower level
programming languages such as C, C++, and Fortran. Appropriate comments embedded in
the Matlab programs are helpful to the reader and permit easy modification for solving
other BVPs associated with a system of ODEs, linear or nonlinear, coupled or not [ 8, 9,
10].
Why linear interpolation and not nonlinear one or bisection For a sensitive function
y(x) a nonlinear interpolation also becomes sensitive and may produce a value which may
cross the region of convergence and hence may fail. Bisection, on the other hand, may
not fail but would take more iterations as it does not use the available knowledge of
function values except, of course their signs. Linear interpolation, particularly a
nonextrapolatory one, is much less sensitive and makes use of the already known
function values to derive the benefit of nonlinear interpolation and that of bisection.
Why four significant digits in the independent variable x No measuring device can
produce an accuracy more than 0.005%. For any engineering application, four significant
digit in the final result (to be used) is enough [12].
Stress concentration factor k and the corresponding range of radial stress at the
boundary for the membrane problem 1 In our numerical experiment we find the
approximate range of corresponding to a given value of k for which the membrane
problems have produced expected solutions are given in Table 1. Most of the real world
problems have these ranges of for a k value between 0.5 and 3. Outside the ranges of
given in Table 1, we will fail to get the solution since it goes beyond the mathematical
lower and upper bounds of the solution. In fact, practically for almost all real world
problems, we have these ranges.
Table 1 approximate range of corresponding to a value of k
k value
0.5
1
1.5
2
2.5
3
Corresponding range of
0.2-1.5
0.25-2
0.25-2.1
0.3-2.5
0.4-2.4
0.4-2.6
The range of Poissions ratio and corresponding accuracy for membrane problem 2
For all values of the stress concentration factor k considered here, the range of for
which we have desired accuracy viz. 4 decimal/significant digits is [-0.5, 0.5]. However
if we choose outside this range, the accuracy of the solution may drops down to 2 or 3
digits. Here too for most actual membrane problems this range is realistic.
Stress concentration factor k and the corresponding range of radial stress at the
boundary for the membrane problem 3 In our numerical experiment we find the
approximate range of corresponding to a given value of k for which the membrane
problems have produced expected solutions are given in Table 2. Most of the real world
problems have these ranges of for a k value between 0.5 and 3.
Table 2 Approximate range of corresponding to a value of k
k value
0.5
1
1.5
2
2.5
3
Corresponding range of
0.15-2.3
0.22-2.7
0.25-3
0.3-3.5
0.35-3.9
0.38-4.2
Use of an appropriate method with efficient computer implementation There are many
methods such as a shooting method and the 4th order Runge-Kutta (Gill-Runge-Kutta
method to minimize rounding errors) in literature to solve ODEs associated with
IVPs/BVPs.While more than one method may be used independently to solve the
problem, we always should choose the one that is a most appropriate one for the specified
problem in terms of accuracy and also cost of computation.
Accuracy of the numerical computations depends on factors such as (i) the method
used, (ii) its computer implementation (iii) the degree of smoothness of the curve(s)
produced by the solution of the ODEs, and (iv) whether a curve is rapidly oscillating or
violently fluctuating. Even the accuracy may/will not be the same throughout the curve.
From the required minimum accuracy point of view, an appropriate numerical method is
chosen such that the accuracy does not fall below actual minimum accuracy deisired.
Matlab has developed several methods/routines such as ODE15S (for stiff differential
equations and DAEs (differential-algebraic equations), variable order method) and ODE
23TB (for stiff differential equations, low order method.). We choose the one that
produces accuracy no less than the required minimum accuracy and with computational
complexity (cost of computation) a minimum.
The complexity factor in current computational environment may not be an issue in
most real world problems while the accuracy (relative error) factor is always an important
issue.
While Matlab often tells user the numerical method employed for each of its routines,
it does not divulge the details of computer implementation of the routine(s). It is often
found out that the implementation of a Matlab routine (program) is good/excellent.
However, if the user has enough time and desires to choose a most appropriate
method and write the program sufficiently intelligently with subsequent modifications
based on numerical experiments, he could produce a Matlab routine as good as or even
better than the available (existing) routine in Matlab repertoire.
Deciding the best method It is desirable to compare our computational results (numerical
solutions) in 2 or more most appropriately chosen methods such as the Matlab routines
ODE15S and ODE23TB. This will help the reader/researcher in terms of deeper insight
and the best choice of the method for his problem. For all the 3 problems that we have
dealt with, we have found one method viz. the one based on the routine ODE15S is
apparently the best for the membrane problem under consideration. No 3 distinct routines
are required for each of the problems here.
Matlab ODE15S versus OE23TB We have compared ODE15S and closely related
ODE23TB through the numerical experiment on foregoing problems, some of which are
extreme ones. We have found that, for some fixed number of subintervals, ODE15S fails
unless we increase the number of subintervals. In such a situation, ODE23TB has been
found to work with, however, less aacuracy. Consequently, we recommend ODE15S for
membrane problems dealt with here.
Decimal digit versus significant digit accuracy In this paper we have talked about
decimal digit accuracy. When we say that the result is correct up to 4 decimal digits, it
implies that log10|1/absolute error| 4. In numerical computation, the absolute error is not
usually useful. Consequently, decimal digit accuracy is not much useful. We cannot get
the relative importance of the accuracy in decimal digits.
On the other hand, when we say that the result is correct up to 4 significant digits,
it implies that log10|1/relative error| 4. The relative error is one that is most useful since
we get to know the relative importance of the result. Is 5 million dollar a large quantity or
a small quantity? Evidently, with respect to the salary of an average American, it is large
while compared with the annual budget of the federal government of United States, it is a
numerical zero.
In our context, the numerical solutions that we get have both relative and absolute
errors are of comparable magnitudes. Hence here the decimal digit accuracy as well as
significant digit accuracy are practically the same.
Integration tolerance problem and automation Integration tolerance problem crops up if
we do not take appropriate number of subintervals between lower and upper bounds of
the solution [2]. Here we have obviated this problem by taking requisite number of
subintervals with automation of the Matlab program. This automation helps us nonstop
execution of the program. No manual intervention in terms of changing the data and
rerunning the program is required.
References
1. S K Sen, H Agarwal, and T Samanta, Interpolation for Nonlinear BVP in
Circular Membrane with Known Upper and Lower Solutions, Computers and
Mathematics with Applications, 51 (2006), 1021-1046.
2. N Ch N Suresh, S K Sen, and J V Devi, Nonlinear Singular BVP in Circular
Membrane: Interpolation-based Fail-proof Matlab Solver, Proc. 60 th Congress of
ISTAM, 60-istam-fp-156, 2015.
3. R.P. Agarwal and D. ORegan, Singular problems arising in circular membrane
4.
5.
6.
7.
8.
9. E.V. Krishnamurthy and S.K. Sen, Programming in MATLAB, Affiliated EastWest Press, New Delhi (2003).
10. S.K. Sen and M. Chanda (1972): A general scheme for solving ordinary
differential equations under two-point boundary conditions, J. Ind. Inst. Sci., 54
(1972), 139 145.
11. E.V. Krishnamurthy and S.K. Sen, Numerical Algorithms: Computations in
Science and Engineering, Affiliated East-West Press, New Delhi (2001).
12. V. Lakshmikantham and S.K. Sen, Computational Error and Complexity in
Science and Engineering, Elsevier, Amsterdam (2005).
13. D.E. Knuth, The Art of Computer Programming, 2, 2nd. Ed., Addison- Wesley,
Reading, Massachusetts (1981).