Example5.2.6 Rev 1.mw

Example 5.2.6 The Shrinking Core Model for Catalyst Regeneration 

> restart;
 

> with(linalg):with(plots):
 

> ge:=diff(u(x,t),t)=diff(u(x,t),x$2)+2/x*diff(u(x,t),x);
 

diff(u(x, t), t) = `+`(diff(diff(u(x, t), x), x), `/`(`*`(2, `*`(diff(u(x, t), x))), `*`(x))) (1)
 

> bc1:=u(x,t)-0;
 

u(x, t) (2)
 

> bc2:=u(x,t)-1;
 

`+`(u(x, t), `-`(1)) (3)
 

> IC:=u(x,0)=0;
 

u(x, 0) = 0 (4)
 

> ge2:=diff(xc[1](t),t)=-k*diff(u(x,t),x);
 

diff(xc[1](t), t) = `+`(`-`(`*`(k, `*`(diff(u(x, t), x))))) (5)
 

> k:=0.1;
 

.1 (6)
 

> N:=10;
 

10 (7)
 

> L:=1;
 

1 (8)
 

> dydxf:=1/2*(-u[2](t)-3*u[0](t)+4*u[1](t))/h;
 

`+`(`/`(`*`(`/`(1, 2), `*`(`+`(`-`(u[2](t)), `-`(`*`(3, `*`(u[0](t)))), `*`(4, `*`(u[1](t)))))), `*`(h))) (9)
 

> dydxb:=1/2*(u[N-1](t)+3*u[N+1](t)-4*u[N](t))/h;
 

`+`(`/`(`*`(`/`(1, 2), `*`(`+`(u[9](t), `*`(3, `*`(u[11](t))), `-`(`*`(4, `*`(u[10](t))))))), `*`(h))) (10)
 

> dydx:=1/2/h*(u[m+1](t)-u[m-1](t));
 

`+`(`/`(`*`(`/`(1, 2), `*`(`+`(u[`+`(m, 1)](t), `-`(u[`+`(m, `-`(1))](t))))), `*`(h))) (11)
 

> d2ydx2:=1/h^2*(u[m-1](t)-2*u[m](t)+u[m+1](t));
 

`/`(`*`(`+`(u[`+`(m, `-`(1))](t), `-`(`*`(2, `*`(u[m](t)))), u[`+`(m, 1)](t))), `*`(`^`(h, 2))) (12)
 

> bc1:=subs(diff(u(x,t),x)=dydxf,u(x,t)=u[0](t),bc1);
 

u[0](t) (13)
 

> bc2:=subs(diff(u(x,t),x)=dydxb,u(x,t)=u[N+1](t),bc2);
 

`+`(u[11](t), `-`(1)) (14)
 

> eqX:=subs(diff(u(x,t),x)=dydxf,u(x,t)=u[0](t),ge2);
 

diff(xc[1](t), t) = `+`(`-`(`/`(`*`(0.5000000000e-1, `*`(`+`(`-`(u[2](t)), `-`(`*`(3, `*`(u[0](t)))), `*`(4, `*`(u[1](t)))))), `*`(h)))) (15)
 

> eq[0]:=bc1;
 

u[0](t) (16)
 

> eq[N+1]:=bc2;
 

`+`(u[11](t), `-`(1)) (17)
 

> for i from 1 to N do eq[i]:=diff(u[i](t),t)= subs(diff(u(x,t),x$2) = subs(m=i,d2ydx2),diff(u(x,t),x) = subs(m=i,dydx),u(x,t)=u[i](t),x=xc[1](t)+i*h,rhs(ge));od;
 

 

 

 

 

 

 

 

 

 

diff(u[1](t), t) = `+`(`/`(`*`(`+`(u[0](t), `-`(`*`(2, `*`(u[1](t)))), u[2](t))), `*`(`^`(h, 2))), `/`(`*`(`+`(u[2](t), `-`(u[0](t)))), `*`(`+`(xc[1](t), h), `*`(h))))
diff(u[2](t), t) = `+`(`/`(`*`(`+`(u[1](t), `-`(`*`(2, `*`(u[2](t)))), u[3](t))), `*`(`^`(h, 2))), `/`(`*`(`+`(u[3](t), `-`(u[1](t)))), `*`(`+`(xc[1](t), `*`(2, `*`(h))), `*`(h))))
diff(u[3](t), t) = `+`(`/`(`*`(`+`(u[2](t), `-`(`*`(2, `*`(u[3](t)))), u[4](t))), `*`(`^`(h, 2))), `/`(`*`(`+`(u[4](t), `-`(u[2](t)))), `*`(`+`(xc[1](t), `*`(3, `*`(h))), `*`(h))))
diff(u[4](t), t) = `+`(`/`(`*`(`+`(u[3](t), `-`(`*`(2, `*`(u[4](t)))), u[5](t))), `*`(`^`(h, 2))), `/`(`*`(`+`(u[5](t), `-`(u[3](t)))), `*`(`+`(xc[1](t), `*`(4, `*`(h))), `*`(h))))
diff(u[5](t), t) = `+`(`/`(`*`(`+`(u[4](t), `-`(`*`(2, `*`(u[5](t)))), u[6](t))), `*`(`^`(h, 2))), `/`(`*`(`+`(u[6](t), `-`(u[4](t)))), `*`(`+`(xc[1](t), `*`(5, `*`(h))), `*`(h))))
diff(u[6](t), t) = `+`(`/`(`*`(`+`(u[5](t), `-`(`*`(2, `*`(u[6](t)))), u[7](t))), `*`(`^`(h, 2))), `/`(`*`(`+`(u[7](t), `-`(u[5](t)))), `*`(`+`(xc[1](t), `*`(6, `*`(h))), `*`(h))))
diff(u[7](t), t) = `+`(`/`(`*`(`+`(u[6](t), `-`(`*`(2, `*`(u[7](t)))), u[8](t))), `*`(`^`(h, 2))), `/`(`*`(`+`(u[8](t), `-`(u[6](t)))), `*`(`+`(xc[1](t), `*`(7, `*`(h))), `*`(h))))
diff(u[8](t), t) = `+`(`/`(`*`(`+`(u[7](t), `-`(`*`(2, `*`(u[8](t)))), u[9](t))), `*`(`^`(h, 2))), `/`(`*`(`+`(u[9](t), `-`(u[7](t)))), `*`(`+`(xc[1](t), `*`(8, `*`(h))), `*`(h))))
diff(u[9](t), t) = `+`(`/`(`*`(`+`(u[8](t), `-`(`*`(2, `*`(u[9](t)))), u[10](t))), `*`(`^`(h, 2))), `/`(`*`(`+`(u[10](t), `-`(u[8](t)))), `*`(`+`(xc[1](t), `*`(9, `*`(h))), `*`(h))))
diff(u[10](t), t) = `+`(`/`(`*`(`+`(u[9](t), `-`(`*`(2, `*`(u[10](t)))), u[11](t))), `*`(`^`(h, 2))), `/`(`*`(`+`(u[11](t), `-`(u[9](t)))), `*`(`+`(xc[1](t), `*`(10, `*`(h))), `*`(h)))) (18)
 

> u[0](t):=(solve(eq[0],u[0](t)));
 

0 (19)
 

> u[N+1](t):=solve(eq[N+1],u[N+1](t));
 

1 (20)
 

> h:=(1-xc[1](t))/(N+1);
 

`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))) (21)
 

> for i from 1 to N do eq[i]:=eval(eq[i]);od;
 

 

 

 

 

 

 

 

 

 

diff(u[1](t), t) = `+`(`/`(`*`(`+`(`-`(`*`(2, `*`(u[1](t)))), u[2](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(u[2](t)), `*`(`+`(`*`(`/`(10, 11), `*`(xc[1](t))), ...
diff(u[2](t), t) = `+`(`/`(`*`(`+`(u[1](t), `-`(`*`(2, `*`(u[2](t)))), u[3](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(`+`(u[3](t), `-`(u[1](t)))), `*`(`+`(`*`(`...
diff(u[3](t), t) = `+`(`/`(`*`(`+`(u[2](t), `-`(`*`(2, `*`(u[3](t)))), u[4](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(`+`(u[4](t), `-`(u[2](t)))), `*`(`+`(`*`(`...
diff(u[4](t), t) = `+`(`/`(`*`(`+`(u[3](t), `-`(`*`(2, `*`(u[4](t)))), u[5](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(`+`(u[5](t), `-`(u[3](t)))), `*`(`+`(`*`(`...
diff(u[5](t), t) = `+`(`/`(`*`(`+`(u[4](t), `-`(`*`(2, `*`(u[5](t)))), u[6](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(`+`(u[6](t), `-`(u[4](t)))), `*`(`+`(`*`(`...
diff(u[6](t), t) = `+`(`/`(`*`(`+`(u[5](t), `-`(`*`(2, `*`(u[6](t)))), u[7](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(`+`(u[7](t), `-`(u[5](t)))), `*`(`+`(`*`(`...
diff(u[7](t), t) = `+`(`/`(`*`(`+`(u[6](t), `-`(`*`(2, `*`(u[7](t)))), u[8](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(`+`(u[8](t), `-`(u[6](t)))), `*`(`+`(`*`(`...
diff(u[8](t), t) = `+`(`/`(`*`(`+`(u[7](t), `-`(`*`(2, `*`(u[8](t)))), u[9](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(`+`(u[9](t), `-`(u[7](t)))), `*`(`+`(`*`(`...
diff(u[9](t), t) = `+`(`/`(`*`(`+`(u[8](t), `-`(`*`(2, `*`(u[9](t)))), u[10](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(`+`(u[10](t), `-`(u[8](t)))), `*`(`+`(`*`...
diff(u[10](t), t) = `+`(`/`(`*`(`+`(u[9](t), `-`(`*`(2, `*`(u[10](t)))), 1)), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(`+`(1, `-`(u[9](t)))), `*`(`+`(`*`(`/`(1, 11),... (22)
 

> eqX:=eval(eqX);
 

diff(xc[1](t), t) = `+`(`-`(`/`(`*`(0.5000000000e-1, `*`(`+`(`-`(u[2](t)), `*`(4, `*`(u[1](t)))))), `*`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))))))) (23)
 

> eqs:=seq((eq[j]),j=1..N),eqX;
 

diff(u[1](t), t) = `+`(`/`(`*`(`+`(`-`(`*`(2, `*`(u[1](t)))), u[2](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(u[2](t)), `*`(`+`(`*`(`/`(10, 11), `*`(xc[1](t))), ...
diff(u[1](t), t) = `+`(`/`(`*`(`+`(`-`(`*`(2, `*`(u[1](t)))), u[2](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(u[2](t)), `*`(`+`(`*`(`/`(10, 11), `*`(xc[1](t))), ...
diff(u[1](t), t) = `+`(`/`(`*`(`+`(`-`(`*`(2, `*`(u[1](t)))), u[2](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(u[2](t)), `*`(`+`(`*`(`/`(10, 11), `*`(xc[1](t))), ...
diff(u[1](t), t) = `+`(`/`(`*`(`+`(`-`(`*`(2, `*`(u[1](t)))), u[2](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(u[2](t)), `*`(`+`(`*`(`/`(10, 11), `*`(xc[1](t))), ...
diff(u[1](t), t) = `+`(`/`(`*`(`+`(`-`(`*`(2, `*`(u[1](t)))), u[2](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(u[2](t)), `*`(`+`(`*`(`/`(10, 11), `*`(xc[1](t))), ...
diff(u[1](t), t) = `+`(`/`(`*`(`+`(`-`(`*`(2, `*`(u[1](t)))), u[2](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(u[2](t)), `*`(`+`(`*`(`/`(10, 11), `*`(xc[1](t))), ...
diff(u[1](t), t) = `+`(`/`(`*`(`+`(`-`(`*`(2, `*`(u[1](t)))), u[2](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(u[2](t)), `*`(`+`(`*`(`/`(10, 11), `*`(xc[1](t))), ...
diff(u[1](t), t) = `+`(`/`(`*`(`+`(`-`(`*`(2, `*`(u[1](t)))), u[2](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(u[2](t)), `*`(`+`(`*`(`/`(10, 11), `*`(xc[1](t))), ...
diff(u[1](t), t) = `+`(`/`(`*`(`+`(`-`(`*`(2, `*`(u[1](t)))), u[2](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(u[2](t)), `*`(`+`(`*`(`/`(10, 11), `*`(xc[1](t))), ...
diff(u[1](t), t) = `+`(`/`(`*`(`+`(`-`(`*`(2, `*`(u[1](t)))), u[2](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(u[2](t)), `*`(`+`(`*`(`/`(10, 11), `*`(xc[1](t))), ...
diff(u[1](t), t) = `+`(`/`(`*`(`+`(`-`(`*`(2, `*`(u[1](t)))), u[2](t))), `*`(`^`(`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(xc[1](t))))), 2))), `/`(`*`(u[2](t)), `*`(`+`(`*`(`/`(10, 11), `*`(xc[1](t))), ...
(24)
 

> Y:=seq(u[i](t),i=1..N),xc[1](t);
 

u[1](t), u[2](t), u[3](t), u[4](t), u[5](t), u[6](t), u[7](t), u[8](t), u[9](t), u[10](t), xc[1](t) (25)
 

> ICs:=seq(u[i](0)=rhs(IC),i=1..N),xc[1](0)=0.999999;
 

u[1](0) = 0, u[2](0) = 0, u[3](0) = 0, u[4](0) = 0, u[5](0) = 0, u[6](0) = 0, u[7](0) = 0, u[8](0) = 0, u[9](0) = 0, u[10](0) = 0, xc[1](0) = .999999
u[1](0) = 0, u[2](0) = 0, u[3](0) = 0, u[4](0) = 0, u[5](0) = 0, u[6](0) = 0, u[7](0) = 0, u[8](0) = 0, u[9](0) = 0, u[10](0) = 0, xc[1](0) = .999999
(26)
 

> sol:=dsolve({eqs,ICs},{Y},type=numeric,stiff=true,abserr=1e-20,stop_cond=[u[2](t)-1,xc[1](t)],output=listprocedure);
 

[t = proc (t) local res, data, solnproc, outpoint, t; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; `:=`(_EnvDSNumericSaveDigits, Digits); `:=`(Digits, 14); if _EnvInFsolve ...
[t = proc (t) local res, data, solnproc, outpoint, t; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; `:=`(_EnvDSNumericSaveDigits, Digits); `:=`(Digits, 14); if _EnvInFsolve ...
[t = proc (t) local res, data, solnproc, outpoint, t; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; `:=`(_EnvDSNumericSaveDigits, Digits); `:=`(Digits, 14); if _EnvInFsolve ...
[t = proc (t) local res, data, solnproc, outpoint, t; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; `:=`(_EnvDSNumericSaveDigits, Digits); `:=`(Digits, 14); if _EnvInFsolve ...
[t = proc (t) local res, data, solnproc, outpoint, t; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; `:=`(_EnvDSNumericSaveDigits, Digits); `:=`(Digits, 14); if _EnvInFsolve ...
[t = proc (t) local res, data, solnproc, outpoint, t; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; `:=`(_EnvDSNumericSaveDigits, Digits); `:=`(Digits, 14); if _EnvInFsolve ...
[t = proc (t) local res, data, solnproc, outpoint, t; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; `:=`(_EnvDSNumericSaveDigits, Digits); `:=`(Digits, 14); if _EnvInFsolve ...
(27)
 

> for i to N do U[i]:=subs(sol,u[i](t));od:
 

> U[0]:=subs(u[1](t)=U[1],u[2](t)=U[2],u[0](t));
 

0 (28)
 

> U[N+1]:=subs(u[N](t)=U[N],u[N-1](t)=U[N-1],u[N+1](t));
 

1 (29)
 

> Xc:=subs(sol,xc[1](t));
 

proc (t) local res, data, solnproc, outpoint, `xc[1](t)`; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; `:=`(_EnvDSNumericSaveDigits, Digits); `:=`(Digits, 14); if _EnvInFso... (30)
 

> sol(2.);
 

 

 

 

 

 

 

 

 

 

 

 

 

Warning, cannot evaluate the solution further right of 1.8213372, stop condition #2 violated
Warning, cannot evaluate the solution further right of 1.8213372, stop condition #2 violated
Warning, cannot evaluate the solution further right of 1.8213372, stop condition #2 violated
Warning, cannot evaluate the solution further right of 1.8213372, stop condition #2 violated
Warning, cannot evaluate the solution further right of 1.8213372, stop condition #2 violated
Warning, cannot evaluate the solution further right of 1.8213372, stop condition #2 violated
Warning, cannot evaluate the solution further right of 1.8213372, stop condition #2 violated
Warning, cannot evaluate the solution further right of 1.8213372, stop condition #2 violated
Warning, cannot evaluate the solution further right of 1.8213372, stop condition #2 violated
Warning, cannot evaluate the solution further right of 1.8213372, stop condition #2 violated
Warning, cannot evaluate the solution further right of 1.8213372, stop condition #2 violated
Warning, cannot evaluate the solution further right of 1.8213372, stop condition #2 violated
[t(2.) = 1.82133726317519740, (u[1](t))(2.) = .802350250154852618, (u[2](t))(2.) = .835678564920583566, (u[3](t))(2.) = .864423811797214281, (u[4](t))(2.) = .889601891633213126, (u[5](t))(2.) = .91184...
[t(2.) = 1.82133726317519740, (u[1](t))(2.) = .802350250154852618, (u[2](t))(2.) = .835678564920583566, (u[3](t))(2.) = .864423811797214281, (u[4](t))(2.) = .889601891633213126, (u[5](t))(2.) = .91184...
[t(2.) = 1.82133726317519740, (u[1](t))(2.) = .802350250154852618, (u[2](t))(2.) = .835678564920583566, (u[3](t))(2.) = .864423811797214281, (u[4](t))(2.) = .889601891633213126, (u[5](t))(2.) = .91184...
[t(2.) = 1.82133726317519740, (u[1](t))(2.) = .802350250154852618, (u[2](t))(2.) = .835678564920583566, (u[3](t))(2.) = .864423811797214281, (u[4](t))(2.) = .889601891633213126, (u[5](t))(2.) = .91184...
(31)
 

> tf:=1.8213373*0.99;
 

1.803123927 (32)
 

> plot(Xc(t),t=0..tf,axes=boxed,title="Figure Exp. 5.1.15.",thickness=3,labels=[t,"xc"]);
 

Plot_2d
 

> pp:=plot([seq(U[i](t),i=0..N+1)],t=0..tf);
 

PLOT(CURVES([[0., 0.], [0.393029702184244101e-1, 0.], [0.735002744536357028e-1, 0.], [.111958719650530128, 0.], [.150672092386477913, 0.], [.189201467219549028, 0.], [.224923129793090398, 0.], [.26191... (33)
 

> display(pp,axes=boxed,title="Figure Exp. 5.2.16.",thickness=3,labels=[t,"u"]);
 

Plot_2d
 

> h:=subs(xc[1]=Xc,h);
 

`+`(`/`(1, 11), `-`(`*`(`/`(1, 11), `*`(Xc(t))))) (34)
 

> for j from 0 to 20 do p[j]:=plot([seq([evalf(subs(t=tf*j/20,Xc(t)+i*h)),evalf(subs(t=tf*j/20,U[i](t)))],i=0..N+1)]):od:
 

> display({seq(p[j],j=0..20)},thickness=4,axes=boxed,title="Figure Exp. 5.2.17.",labels=[x,"u"]);
 

Plot_2d
 

> M:=30;
 

30 (35)
 

> T1:=[seq(tf*i/M,i=0..M)];
 

[0., 0.6010413090e-1, .1202082618, .1803123927, .2404165236, .3005206545, .3606247853, .4207289163, .4808330473, .5409371780, .6010413090, .6611454400, .7212495707, .7813537017, .8414578327, .90156196...
[0., 0.6010413090e-1, .1202082618, .1803123927, .2404165236, .3005206545, .3606247853, .4207289163, .4808330473, .5409371780, .6010413090, .6611454400, .7212495707, .7813537017, .8414578327, .90156196...
[0., 0.6010413090e-1, .1202082618, .1803123927, .2404165236, .3005206545, .3606247853, .4207289163, .4808330473, .5409371780, .6010413090, .6611454400, .7212495707, .7813537017, .8414578327, .90156196...
[0., 0.6010413090e-1, .1202082618, .1803123927, .2404165236, .3005206545, .3606247853, .4207289163, .4808330473, .5409371780, .6010413090, .6611454400, .7212495707, .7813537017, .8414578327, .90156196...
[0., 0.6010413090e-1, .1202082618, .1803123927, .2404165236, .3005206545, .3606247853, .4207289163, .4808330473, .5409371780, .6010413090, .6611454400, .7212495707, .7813537017, .8414578327, .90156196...
(36)
 

> PP:=matrix(N+2,M+1);
 

array( 1 .. 12, 1 .. 31, [ ] ) (37)
 

> for i from 1 to N+2 do PP[i,1]:=evalf(subs(x=(i-1)*L/(N+1),rhs(IC)));od:
 

> for i from 1 to N+2 do for j from 1 to M+1 do PP[i,j]:=evalf(subs(t=T1[j],U[i-1](t)));od;od:
 

> plotdata := [seq([ seq([eval(subs(t=T1[j],Xc(t)+(i-1)*h)),T1[j],PP[i,j]], i=1..N+2)], j=1..M+1)]:
 

> surfdata(plotdata,axes=boxed,title="Figure Exp. 5.2.18.", labels=[x,t,u],orientation=[-90,0]);
 

Plot
 

>