Example 3.6 

Equation (3.19) can be solved below by finding the matrizant in the manner described above. 

> restart:
 

> with(linalg):with(plots):
 

> N:=2;
 

2 (1)
 

For brevity, only four terms are used for calculating the matrizant in this example.   

> nvars:=4;
 

4 (2)
 

> Eq:=1/x*diff(x*diff(c(x),x),x)=phi^2*c(x);
 

`/`(`*`(`+`(diff(c(x), x), `*`(x, `*`(diff(diff(c(x), x), x))))), `*`(x)) = `*`(`^`(phi, 2), `*`(c(x))) (3)
 

Enter the A matrix (equation 3.22). 

> A:=matrix(2,2,[0,1/x,phi^2*x,0]);
 

`:=`(A, Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mn( (4)
 

> Y0:=matrix(2,1,[c[1],0]);
 

`:=`(Y0, Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-msub(Typesetting:-mverbatim( (5)
 

> id:=Matrix(N,N,shape=identity);
 

Typesetting:-mrow(Typesetting:-mverbatim( (6)
 

> X1:=matrix(N,N);X2:=matrix(N,N);
 

 

array( 1 .. 2, 1 .. 2, [ ] )
array( 1 .. 2, 1 .. 2, [ ] ) (7)
 

> X1:=map(int,subs(x=x1,evalm(A)),x1=0..x);
 

`:=`(X1, Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mn( (8)
 

To avoid the singularity, in X1,  integrate from x0 to x and later find the limit as x0 goes to zero. 

> X1:=map(int,subs(x=x1,evalm(A)),x1=x0..x)assuming x>0,x0>=0,x>=x0;
 

`:=`(X1, Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mn( (9)
 

> mat := evalm(id + X1) ;
 

`:=`(mat, Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mn( (10)
 

> for i from 2 to nvars do
S:=evalm( subs(x=x1,evalm(A))&*subs(x=x1,evalm(X1)) ):X2:=
map(int,S,x1=x0..x):mat := evalm(mat +X2) :
X1:=evalm(X2):od :
 

> evalm(mat)assuming x>0,x0>=0,x>=x0;
 

Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mrow(Typesetting:-mn(
Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mrow(Typesetting:-mn(
Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mrow(Typesetting:-mn(
Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mrow(Typesetting:-mn(
Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mrow(Typesetting:-mn(
Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mrow(Typesetting:-mn(
(11)
 

> sol:=evalm(mat&*Y0);
 

`:=`(sol, Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mverbatim( (12)
 

> C:=sol[1,1];
 

`*`(`+`(1, int(`+`(`/`(`*`(`/`(1, 2), `*`(`^`(phi, 2), `*`(`+`(`*`(`^`(x1, 2)), `-`(`*`(`^`(x0, 2))))))), `*`(x1))), x1 = x0 .. x), int(`/`(`*`(int(`*`(`^`(phi, 2), `*`(x1, `*`(int(`+`(`/`(`*`(`/`(1, ... (13)
 

> dCdx:=1/x*sol[2,1];
 

`/`(`*`(`+`(`*`(`/`(1, 2), `*`(`^`(phi, 2), `*`(`+`(`*`(`^`(x, 2)), `-`(`*`(`^`(x0, 2))))))), int(`*`(`^`(phi, 2), `*`(x1, `*`(int(`+`(`/`(`*`(`/`(1, 2), `*`(`^`(phi, 2), `*`(`+`(`*`(`^`(x1, 2)), `-`(... (14)
 

To find c1 apply the boundary condition at x=1: 

> bc2:=eval(subs(x=1,C))=1 assuming x>0,x0>=0,x>=x0;
 

 

Warning, unable to determine if 0 is between x0 and x1; try to use assumptions or set _EnvAllSolutions to true
`*`(`+`(1, `-`(`*`(`/`(1, 4), `*`(`^`(phi, 2), `*`(`^`(x0, 2))))), `*`(`/`(1, 2), `*`(`^`(phi, 2), `*`(ln(x0), `*`(`^`(x0, 2))))), `*`(`/`(1, 4), `*`(`^`(phi, 2))), `*`(`/`(1, 16), `*`(`^`(phi, 4), `*...
`*`(`+`(1, `-`(`*`(`/`(1, 4), `*`(`^`(phi, 2), `*`(`^`(x0, 2))))), `*`(`/`(1, 2), `*`(`^`(phi, 2), `*`(ln(x0), `*`(`^`(x0, 2))))), `*`(`/`(1, 4), `*`(`^`(phi, 2))), `*`(`/`(1, 16), `*`(`^`(phi, 4), `*...
(15)
 

> c[1]:=solve(bc2,c[1]);
 

`+`(`/`(`*`(64), `*`(`+`(64, `-`(`*`(16, `*`(`^`(phi, 2), `*`(`^`(x0, 2))))), `*`(32, `*`(`^`(phi, 2), `*`(ln(x0), `*`(`^`(x0, 2))))), `*`(16, `*`(`^`(phi, 2))), `*`(4, `*`(`^`(phi, 4), `*`(`^`(x0, 4)... (16)
 

> C:=eval(C);
 

 

 

Warning, unable to determine if 0 is between x0 and x; try to use assumptions or set _EnvAllSolutions to true
Warning, unable to determine if 0 is between x0 and x1; try to use assumptions or set _EnvAllSolutions to true
`+`(`/`(`*`(64, `*`(`+`(1, int(`+`(`/`(`*`(`/`(1, 2), `*`(`^`(phi, 2), `*`(`+`(`*`(`^`(x1, 2)), `-`(`*`(`^`(x0, 2))))))), `*`(x1))), x1 = x0 .. x), int(`/`(`*`(int(`*`(`^`(phi, 2), `*`(x1, `*`(int(`+`... (17)
 

Now apply the limit command for x0. 

>
 

Warning, premature end of input, use <Shift> + <Enter> to avoid this message.
 

> C:=limit(C,x0=0);
 

`/`(`*`(`+`(64, `*`(16, `*`(`^`(phi, 2), `*`(`^`(x, 2)))), `*`(`^`(phi, 4), `*`(`^`(x, 4))))), `*`(`+`(64, `*`(16, `*`(`^`(phi, 2))), `*`(`^`(phi, 4))))) (18)
 

Divide both numerator and denominator by 64.  (Note when different values of 'nvars' are used, this number has to be changed accordingly.) 

> n1:=numer(C)/64;
 

`+`(1, `*`(`/`(1, 4), `*`(`^`(phi, 2), `*`(`^`(x, 2)))), `*`(`/`(1, 64), `*`(`^`(phi, 4), `*`(`^`(x, 4))))) (19)
 

> d1:=denom(C)/64;
 

`+`(1, `*`(`/`(1, 4), `*`(`^`(phi, 2))), `*`(`/`(1, 64), `*`(`^`(phi, 4)))) (20)
 

> C:=n1/d1;
 

`/`(`*`(`+`(1, `*`(`/`(1, 4), `*`(`^`(phi, 2), `*`(`^`(x, 2)))), `*`(`/`(1, 64), `*`(`^`(phi, 4), `*`(`^`(x, 4)))))), `*`(`+`(1, `*`(`/`(1, 4), `*`(`^`(phi, 2))), `*`(`/`(1, 64), `*`(`^`(phi, 4)))))) (21)
 

One can verify that both the numerator and the denominator of C are modified Bessel functions of the order zero by using Maple. 

> series(BesselI(0,phi*x),x);
 

series(`+`(1, `*`(`*`(`/`(1, 4), `*`(`^`(phi, 2))), `*`(`^`(x, 2))), `*`(`*`(`/`(1, 64), `*`(`^`(phi, 4))), `*`(`^`(x, 4))))+O(`^`(x, 6)),x,6) (22)
 

> series(BesselI(0,phi),phi);
 

series(`+`(1, `*`(`/`(1, 4), `*`(`^`(phi, 2))), `*`(`/`(1, 64), `*`(`^`(phi, 4))))+O(`^`(phi, 6)),phi,6) (23)
 

Next, plots can be obtained by substituting the parameters for the Thiele modulus Typesetting:-mrow(Typesetting:-mi( . 

> pars:=[0.1,1,2,10];
 

[.1, 1, 2, 10] (24)
 

> clr:=[red,green,blue,brown];
 

[red, green, blue, brown] (25)
 

> for i to 4 do p[i]:=plot(subs(phi=pars[i],C),x=0..1,color=clr[i]):od:
 

> pt[1]:=textplot([0.1,evalf(subs({x=0.1,phi=pars[1]},C)),'phi=pars[1]'], align=below):
pt[2]:=textplot([0.4,evalf(subs({x=.4,phi=pars[2]},C)),'phi=pars[2]'],align=below):
pt[3]:=textplot([0.5,evalf(subs({x=.5,phi=pars[3]},C)),'phi=pars[3]'],align=below):
pt[4]:=textplot([0.8,evalf(subs({x=0.8,phi=pars[4]},C)),'phi=pars[4]'],align=below):
 

> display({seq(p[i],i=1..4),seq(pt[i],i=1..4)},axes=boxed,thickness=3,title="Figure Exp. 3.1.8.",labels=[x,"C"]);
 

Plot_2d
 

For  higher values of Typesetting:-mrow(Typesetting:-mi(, more terms (nvars) in the matrizant series solution are needed for higher accurance. 

>