# Maple PDE for Linear Constant Coeff. Parabolic PDE on (xl,xr)X(0,tf): # Using Euler's Explicit Method; # u_t=f(x,t,u,u_x,u_{xx});u(x,0)=g(x);u(xl,t)=bl(t);u(xr,t)=br(t); # f(x,t,u,v,w)=a*w+b*v+c*u+d; # Given: m,n,xl,xr,f,g,bl,br,a,b,c,d,ra=a*k/h^2;
> m:=6; n:=11; xl:=0; xr:=1; a:=0.5; b:=1; c:=-1; d:=-3; ra:=0.25;
< m := 6 < n := 11 < xl := 0 < xr := 1 < a := .5 < b := 1 < c := -1 < d := -3 < ra := .25
> f:=(x,t,u,v,w)->a*w+b*v+c*u+d;
< f := (x,t,u,v,w) -> a w + b v + c u + d
> g:=x->100*(1-abs(2*x-1));
< g := x -> 100 - 100 abs(2 x - 1)
> bl:=t->0; br:=t->0;
< bl := 0 < br := 0
> h:=(xr-xl)/m; k:=ra*h^2/a;
< h := 1/6 < k := .01388888889
> with(linalg): > x:=vector(m+1,[seq(xl+(i-1)*h,i=1..m+1)]);
< x := [ 0, 1/6, 1/3, 1/2, 2/3, 5/6, 1 ]
> t[1]=0; uv:=vector(m+1,[seq(g(x[i]),i=1..m+1)]);
< t[1] = 0 < uv := [ 0, 100/3, 200/3, 100, 200/3, 100/3, 0 ]
> for j from 1 to n do t[j+1]:=j*k; > vv:=vector(m,[0,seq((uv[i+1]-uv[i-1])/(2*h),i=2..m)]): > wv:=vector(m,[0,seq((uv[i+1]-2*uv[i]+uv[i-1])/h^2,i=2..m)]): > fv:=vector(m,[0,seq(f(x[i],t[1],uv[i],vv[i],wv[i]),i=2..m)]): > uv:=vector(m+1,[bl(t[j+1]),seq(uv[i]+k*fv[i],i=2..m),br(t[j+1])]); > od;
< t[2] := .01388888889 < vv := [ 0, 200, 200, 0, -200, -200 ] < wv := [ 0, 0, 0, -2400, 0, 0 ] < fv := [ 0, 491/3, 391/3, -1303.0, -809/3, -709/3 ] < uv := [ 0, 35.60648148, 68.47685186, 81.90277778, 62.92129630, 30.05092592, 0 ]
< t[3] := .02777777778 < vv := [ 0, 205.4305556, 138.8888889, -16.66666668, -155.5555556, -188.7638889 ] < wv := [ 0, -98.49999960, -699.9999998, -1166.666668, -500.0000004, 101.5000006 ] < fv := [ 0, 117.5740743, -282.5879629, -684.9027785, -471.4768521, -171.0648145 ] < uv := [ 0, 37.23945473, 64.55201904, 72.39023919, 56.37300669, 27.67502572, 0 ]
< t[4] := .04166666667 < vv := [ 0, 193.6560571, 105.4523534, -24.53703705, -134.1456404, -169.1190201 ] < wv := [ 0, -357.3680551, -701.0763905, -858.7962961, -456.5069456, 36.82638900 ] < fv := [ 0, -25.26742523, -312.6378609, -529.3254244, -421.7721199, -181.3808513 ] < uv := [ 0, 36.88851827, 60.20982653, 65.03849718, 50.51506058, 25.15584723, 0 ]
< t[5] := .05555555556 < vv := [ 0, 180.6294796, 84.44993675, -29.08429785, -119.6479499, -151.5451818 ] < wv := [ 0, -488.4195604, -665.7349554, -696.6758624, -390.0879644, 7.32118032 ] < fv := [ 0, -103.4688189, -311.6273675, -445.4607263, -368.2069927, -176.0404388 ] < uv := [ 0, 35.45145134, 55.88166865, 58.85154265, 45.40107457, 22.71084114, 0 ]
< t[6] := .06944444445 < vv := [ 0, 167.6450060, 70.20027395, -31.44178224, -108.4221046, -136.2032237 ] < wv := [ 0, -540.7644251, -628.5723592, -591.1323149, -332.6315526, -.74187756 ] < fv := [ 0, -141.1886579, -302.9675744, -388.8594824, -323.1389555, -162.2850036 ] < uv := [ 0, 33.49049776, 51.67378567, 53.45071651, 40.91303352, 20.45688276, 0 ]
< t[7] := .08333333334 < vv := [ 0, 155.0213570, 59.88065625, -32.28225645, -98.98150125, -122.7391006 ] < wv := [ 0, -551.0595546, -590.6288531, -515.3260972, -285.0648397, -.02635200 ] < fv := [ 0, -156.9989181, -290.1075561, -346.3960216, -285.4269547, -146.2091594 ] < uv := [ 0, 31.30995723, 47.64451406, 48.63966065, 36.94877026, 18.42619999, 0 ]
< t[8] := .09722222223 < vv := [ 0, 142.9335422, 51.98911025, -32.08723140, -90.64038200, -110.8463108 ] < wv := [ 0, -539.1144144, -552.2187686, -456.6973313, -245.9404757, 3.46933008 ] < fv := [ 0, -160.9336222, -274.7647882, -312.0755578, -253.5593902, -130.5378458 ] < uv := [ 0, 29.07476803, 43.82833645, 44.30527790, 33.42711206, 16.61317435, 0 ]
< t[9] := .1111111111 < vv := [ 0, 131.4850094, 45.69152961, -31.20367317, -83.07631065, -100.2813362 ] < wv := [ 0, -515.5631860, -513.9585709, -408.7838624, -213.6877873, 7.22748096 ] < fv := [ 0, -158.3713516, -258.1160924, -282.9008823, -226.3473165, -116.2807701 ] < uv := [ 0, 26.87516592, 40.24339072, 40.37609898, 30.28339933, 14.99816365, 0 ]
< t[10] := .1250000000 < vv := [ 0, 120.7301722, 40.50279918, -29.87997417, -76.13380600, -90.85019800 ] < wv := [ 0, -486.2498803, -476.4785954, -368.1146848, -186.9312971, 10.33459308 ] < fv := [ 0, -152.2699339, -240.9798892, -257.3134156, -202.8828539, -103.6810651 ] < uv := [ 0, 24.76030573, 36.89644781, 36.80230154, 27.46558191, 13.55814886, 0 ]
< t[11] := .1388888889 < vv := [ 0, 110.6893435, 36.12598743, -28.29259770, -69.73245805, -82.39674575 ] < wv := [ 0, -454.4698914, -440.2903806, -332.7326410, -164.5456831, 12.57423084 ] < fv := [ 0, -144.3059079, -223.9156507, -234.4612197, -182.4708815, -92.66777919 ] < uv := [ 0, 22.75605701, 33.78650822, 33.54589571, 24.93126411, 12.27109637, 0 ]
< t[12] := .1527777778 < vv := [ 0, 101.3595247, 32.36951610, -26.56573233, -63.82439800, -74.79379235 ] > wv := [ 0, -422.1218088, -405.7582939, -301.4646872, -145.6393010, 14.00656932 ] < fv := [ 0, -135.4574367, -207.2961391, -213.8439716, -164.5753126, -83.06160406 ] < uv := [ 0, 20.87470372, 30.90739518, 30.57584055, 22.64549588, 11.11746298, 0 ]
Email Comments or Questions to hanson@uic.edu