Example 3.2.4  Nonlinear Heat Transfer 

Consider a modification of the heat transfer discussed in example 3.1.1 with a nonlinear source term.  The governing equation isTypesetting:-mrow(Typesetting:-mo( 

 

 

Typesetting:-mrow(Typesetting:-mo(y                                     (3.2.7) 

 

with the boundary conditions: 

 

Typesetting:-mrow(Typesetting:-mo( 

 

and 

Typesetting:-mrow(Typesetting:-mo( 

 

The initial condition, y(0) is taken as 

 

Typesetting:-mrow(Typesetting:-mo(                                         (3.2.10) 

 

An initial value for α is guessed and the governing equation (3.2.7) is solved as an initial value problem.  Then, a new value of α is obtained using the following relation.[6] [21] 

 

αnew= αoldTypesetting:-mrow(Typesetting:-mi( 

 

=  αoldTypesetting:-mrow(Typesetting:-mo( 

                                                                                                          (3.2.11) 

 

= αoldTypesetting:-mrow(Typesetting:-mo( 

 

 

In equation (3.2.11),  the Jacobian  Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-mo( is often calculated numerically.  However, the Jacobian can be predicted exactly by differentiating the governing equation (3.2.7) with respect to alpha as 

 

Typesetting:-mrow(Typesetting:-mo( Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-mo(                   (3.2.12) 

 

Next, the Jacobian is treated as a variable y2. 

 

Typesetting:-mrow(Typesetting:-mo(y  +  Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mn(             (3.2.13) 

 

The initial conditions for y2 are obtained by differentiating equations (3.2.10) and (3.2.8) with respect to α: 

 

                                                    Typesetting:-mrow(Typesetting:-mi(                                    (3.2.14) 

 

and 

                                                  Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-mo( 

 

This boundary value problem is solved in Maple below: 

> restart:
 

> with(plots):
 

Enter the governing equation: 

> eq:=diff(y(x),x$2)-(1+0.1*y(x))*y(x);
 

`+`(diff(diff(y(x), x), x), `-`(`*`(`+`(1, `*`(.1, `*`(y(x)))), `*`(y(x))))) (1)
 

The sensitivity equation is developed by treating y as a function of x and α: 

> eqalpha:=subs(y(x)=Y(x,alpha),eq);
 

`+`(diff(diff(Y(x, alpha), x), x), `-`(`*`(`+`(1, `*`(.1, `*`(Y(x, alpha)))), `*`(Y(x, alpha))))) (2)
 

The governing equation for the Jacobian Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-mo(is obtained by differentiating the governing equation with respect to α: 

> eqalpha:=diff(eqalpha,alpha);
 

`+`(diff(diff(diff(Y(x, alpha), alpha), x), x), `-`(`*`(.1, `*`(diff(Y(x, alpha), alpha), `*`(Y(x, alpha))))), `-`(`*`(`+`(1, `*`(.1, `*`(Y(x, alpha)))), `*`(diff(Y(x, alpha), alpha))))) (3)
 

A new variable, y2(x) is used to present the Jacobian Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-mo( 

> eqalpha:=subs(diff(Y(x,alpha),alpha)=y2(x),eqalpha);
 

`+`(diff(diff(y2(x), x), x), `-`(`*`(.1, `*`(y2(x), `*`(Y(x, alpha))))), `-`(`*`(`+`(1, `*`(.1, `*`(Y(x, alpha)))), `*`(y2(x))))) (4)
 

> eqalpha:=subs(Y(x,alpha)=y(x),eqalpha);
 

`+`(diff(diff(y2(x), x), x), `-`(`*`(.1, `*`(y2(x), `*`(y(x))))), `-`(`*`(`+`(1, `*`(.1, `*`(y(x)))), `*`(y2(x))))) (5)
 

The variables are stored in vars: 

> vars:=(y(x),y2(x));
 

y(x), y2(x) (6)
 

The original governing equation and the sensitivity equation are stored in eqs: 

> eqs:=(eq,eqalpha);
 

`+`(diff(diff(y(x), x), x), `-`(`*`(`+`(1, `*`(.1, `*`(y(x)))), `*`(y(x))))), `+`(diff(diff(y2(x), x), x), `-`(`*`(.1, `*`(y2(x), `*`(y(x))))), `-`(`*`(`+`(1, `*`(.1, `*`(y(x)))), `*`(y2(x))))) (7)
 

The initial value for α is given here: 

> alpha0:=0.5;
 

.5 (8)
 

The initial conditions are stored in ICs: 

> ICs:=(y(0)=alpha0,D(y)(0)=0,y2(0)=1,D(y2)(0)=0);
 

y(0) = .5, (D(y))(0) = 0, y2(0) = 1, (D(y2))(0) = 0 (9)
 

Next the numerical solution is obtained and stored in sol: 

> sol:=dsolve({eqs,ICs},{vars},type=numeric);
 

proc (x_rkf45) local res, data, vars, solnproc, outpoint, ndsol, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; `:=`(_EnvDSNumericSaveDigits, Digits); `:=`(Digits, 14); if... (10)
 

The solution is evaluated at x = 1: 

> sol(1);
 

[x = 1., y(x) = .787720725926567834, diff(y(x), x) = .628296298165053944, y2(x) = 1.60809619176739282, diff(y2(x), x) = 1.33935818442695509]
[x = 1., y(x) = .787720725926567834, diff(y(x), x) = .628296298165053944, y2(x) = 1.60809619176739282, diff(y2(x), x) = 1.33935818442695509]
(11)
 

The predicted value of y is stored in ypred: 

> ypred:=rhs(sol(1)[2]);
 

.787720725926567834 (12)
 

The predicted value for the Jacobian is stored in y2pred: 

> y2pred:=rhs(sol(1)[4]);
 

1.60809619176739282 (13)
 

The new value for α is obtained as: 

> alpha1:=alpha0+(1-ypred)/y2pred;
 

.6320065772 (14)
 

The error is calculated based on the value of α: 

> err:=alpha1-alpha0;
 

.1320065772 (15)
 

The new value of α is then assigned to α0 for the next iteration. 

> alpha0:=alpha1;
 

.6320065772 (16)
 

A program is written to update the values of α until the error is > 1e - 6.  One can set stricter tolerance limits for higher accuracy. 

> k:=1;
 

1 (17)
 

> while err>1e-6 do
 

> ICs:=(y(0)=alpha0,D(y)(0)=0,y2(0)=1,D(y2)(0)=0);
 

> sol:=dsolve({eqs,ICs},{vars},type=numeric);
 

> ypred:=rhs(sol(1)[2]);
 

> y2pred:=rhs(sol(1)[4]);
 

> alpha1:=alpha0+(1-ypred)/y2pred;
 

> err:=abs(alpha1-alpha0);
 

> alpha0:=alpha1;k:=k+1;
 

> end;
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

y(0) = .6320065772, (D(y))(0) = 0, y2(0) = 1, (D(y2))(0) = 0
proc (x_rkf45) local res, data, vars, solnproc, outpoint, ndsol, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; `:=`(_EnvDSNumericSaveDigits, Digits); `:=`(Digits, 14); if...
1.00115116384101999
1.62555796254959861
.6312984117
0.7081655e-3
.6312984117
2
y(0) = .6312984117, (D(y))(0) = 0, y2(0) = 1, (D(y2))(0) = 0
proc (x_rkf45) local res, data, vars, solnproc, outpoint, ndsol, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; `:=`(_EnvDSNumericSaveDigits, Digits); `:=`(Digits, 14); if...
1.00000003296316220
1.62546395111771891
.6312983914
0.203e-7
.6312983914
3 (18)
 

> k;
 

3 (19)
 

Three iterations were required for this problem.  The error in α is found to be: 

> err;
 

0.203e-7 (20)
 

The solution obtained is then plotted: 

> odeplot(sol,[x,y(x)],0..1,axes=boxed,color=brown,title="Figure Exp. 3.2.8.",thickness=4);
 

Plot_2d
 

For this boundary value problem, it takes only three iterations for the solution to converge.  Depending on the problem and the initial guess provided, the program might take any number of iterations to converge.  In addition, for updating α (equation 3.2.11) the Jacobian  in the denominator might approach zero for certain problems.  Sometimes it is necessary to scale the update of α using the following relations: 

 

                                   αnew= αoldTypesetting:-mrow(Typesetting:-mo(                                             (3.2.16) 

 

where ρ is the number between 0 and 1.  The lower the value of ρ the higher is the number of iterations required for convergence.  The value of ρ depends on the problem.  This is illustrated in the next example. 

>