10 Reputation

One Badge

5 years, 64 days

MaplePrimes Activity


These are questions asked by

PDETWOSTEPVARIAMETHOD.mwPDETWOSTEPVARIAMETHOD.mw

Pls i need help to correct this iteration code, I wrote but is not given the correct answer. find attached the worksheet


 

NULL

restart

with(LinearAlgebra):

alpha := .985

.985

(1)

for i to 7 do for j from -1 by .1 to 1 do Exact[j] := ((1-j)*(1/2))*exp((1+j)*(1/2)); Y[0] := proc (x) options operator, arrow; -(1/8)*exp(1)+1/2+(-(1/8)*exp(1)-3/4)*x+(1/8)*exp(1)*x^2+((1/8)*exp(1)+1/4)*x^3 end proc; Ics := Z(-1) = 1, Z(1) = 0, (D(Z))(-1) = 0, (D(Z))(1) = -(1/2)*exp(1); exp(x) := convert(taylor(exp(x), x = 0, 25), polynom); f := proc (x) options operator, arrow; ((1/32)*x-5/32)*exp((1/2)*x+1/2) end proc; p := proc (x) options operator, arrow; 0 end proc; q := proc (x) options operator, arrow; -1/4 end proc; r := proc (x) options operator, arrow; 0 end proc; u := proc (x) options operator, arrow; -1/16 end proc; eq[i] := diff(Z(x), `$`(x, 4)) = (1-alpha)*(diff(Y[i-1](x), `$`(x, 4)))+alpha*(f(x)-p(x)*(diff(Y[i-1](x), `$`(x, 3)))-q(x)*(diff(Y[i-1](x), `$`(x, 2)))-r(x)*(diff(Y[i-1](x), x))-u(x)*Y[i-1](x)); s[i] := evalf(dsolve({Ics, eq[i]}, Z(x))); Y[i] := unapply(op(2, s[i]), x); App[j] := evalf(Y[i](j)); Er[j] := abs(App[j]-Exact[j]); print([App[j], Exact[j], Er[j]]) end do end do

[1.00000001, 1, 0.1e-7]

 

[.99889373, .9987075410, 0.1861890e-3]

 

[.99542387, .9946538260, 0.7700440e-3]

 

[.98930908, .9875591065, 0.17499735e-2]

 

[.98020108, .9771222065, 0.30788735e-2]

 

[.96769238, .9630190630, 0.46733170e-2]

 

[.95132386, .9449011655, 0.64226945e-2]

 

[.93059225, .9223939070, 0.81983430e-2]

 

[.90495743, .8950948190, 0.98626110e-2]

 

[.87384983, .8625717020, 0.112781280e-1]

 

[.83667770, .8243606355, 0.123170645e-1]

 

[.79283435, .7799638580, 0.128704920e-1]

 

[.74170543, .7288475200, 0.128579100e-1]

 

[.68267630, .6704392900, 0.122370100e-1]

 

[.61513924, .6041258120, 0.110134280e-1]

 

[.53850104, .5292500040, 0.92510360e-2]

 

[.45219044, .4451081856, 0.70822544e-2]

 

[.35566578, .3509470278, 0.47187522e-2]

 

[.24842284, .2459603111, 0.24625289e-2]

 

[.13000273, .1292854830, 0.7172470e-3]

 

[0., 0., 0.]

 

[1.00000001, 1, 0.1e-7]

 

[.99870526, .9987075410, 0.22810e-5]

 

[.99464487, .9946538260, 0.89560e-5]

 

[.98753974, .9875591065, 0.193665e-4]

 

[.97708963, .9771222065, 0.325765e-4]

 

[.96297160, .9630190630, 0.474630e-4]

 

[.94483868, .9449011655, 0.624855e-4]

 

[.92231783, .9223939070, 0.760770e-4]

 

[.89500815, .8950948190, 0.866690e-4]

 

[.86247884, .8625717020, 0.928620e-4]

 

[.82426685, .8243606355, 0.937855e-4]

 

[.77987484, .7799638580, 0.890180e-4]

 

[.72876867, .7288475200, 0.788500e-4]

 

[.67037492, .6704392900, 0.643700e-4]

 

[.60407851, .6041258120, 0.473020e-4]

 

[.52922004, .5292500040, 0.299640e-4]

 

[.44509347, .4451081856, 0.147156e-4]

 

[.35094315, .3509470278, 0.38778e-5]

 

[.24596164, .2459603111, 0.13289e-5]

 

[.12928690, .1292854830, 0.14170e-5]

 

 

[-0.2e-7, 0., 0.2e-7]

 

[2., 1, 1.]

 

[2., .9987075410, 1.001292459]

 

[2., .9946538260, 1.005346174]

 

[2., .9875591065, 1.012440894]

 

[2., .9771222065, 1.022877794]

 

[2., .9630190630, 1.036980937]

 

[2., .9449011655, 1.055098834]

 

[2., .9223939070, 1.077606093]

 

[2., .8950948190, 1.104905181]

 

[2., .8625717020, 1.137428298]

 

[2., .8243606355, 1.175639364]

 

[2., .7799638580, 1.220036142]

 

[2., .7288475200, 1.271152480]

 

[2., .6704392900, 1.329560710]

 

[2., .6041258120, 1.395874188]

 

[2., .5292500040, 1.470749996]

 

[2., .4451081856, 1.554891814]

 

[2., .3509470278, 1.649052972]

 

[2., .2459603111, 1.754039689]

 

[2., .1292854830, 1.870714517]

 

[2., 0., 2.]

 

[1.00000000, 1, 0.]

 

[.99902820, .9987075410, 0.3206590e-3]

 

[.99581870, .9946538260, 0.11648740e-2]

 

[.98992527, .9875591065, 0.23661635e-2]

 

[.98089421, .9771222065, 0.37720035e-2]

 

[.96826375, .9630190630, 0.52446870e-2]

 

[.95156339, .9449011655, 0.66622245e-2]

 

[.93031319, .9223939070, 0.79192830e-2]

 

[.90402310, .8950948190, 0.89282810e-2]

 

[.87219221, .8625717020, 0.96205080e-2]

 

[.83430805, .8243606355, 0.99474145e-2]

 

[.78984585, .7799638580, 0.98819920e-2]

 

[.73826774, .7288475200, 0.94202200e-2]

 

[.67902206, .6704392900, 0.85827700e-2]

 

[.61154254, .6041258120, 0.74167280e-2]

 

[.53524746, .5292500040, 0.59974560e-2]

 

[.44953895, .4451081856, 0.44307644e-2]

 

[.35380210, .3509470278, 0.28550722e-2]

 

[.24740416, .2459603111, 0.14438489e-2]

 

[.12969376, .1292854830, 0.4082770e-3]

 

[0.1e-7, 0., 0.1e-7]

 

[1.00000002, 1, 0.2e-7]

 

[.99870689, .9987075410, 0.6510e-6]

 

[.99464990, .9946538260, 0.39260e-5]

 

[.98754844, .9875591065, 0.106665e-4]

 

[.97710162, .9771222065, 0.205865e-4]

 

[.96298633, .9630190630, 0.327330e-4]

 

[.94485556, .9449011655, 0.456055e-4]

 

[.92233620, .9223939070, 0.577070e-4]

 

[.89502732, .8950948190, 0.674990e-4]

 

[.86249795, .8625717020, 0.737520e-4]

 

[.82428488, .8243606355, 0.757555e-4]

 

[.77989071, .7799638580, 0.731480e-4]

 

[.72878132, .7288475200, 0.662000e-4]

 

[.67038351, .6704392900, 0.557800e-4]

 

[.60408269, .6041258120, 0.431220e-4]

 

[.52922015, .5292500040, 0.298540e-4]

 

[.44509054, .4451081856, 0.176456e-4]

 

[.35093889, .3509470278, 0.81378e-5]

 

[.24595805, .2459603111, 0.22611e-5]

 

[.12928542, .1292854830, 0.630e-7]

 

[-0.1e-7, 0., 0.1e-7]

 

[1.0000000, 1, 0.]

 

[.9987075, .9987075410, 0.410e-7]

 

[.9946539, .9946538260, 0.740e-7]

 

[.9875592, .9875591065, 0.935e-7]

 

[.9771225, .9771222065, 0.2935e-6]

 

[.9630194, .9630190630, 0.3370e-6]

 

[.9449015, .9449011655, 0.3345e-6]

 

[.9223945, .9223939070, 0.5930e-6]

 

[.8950954, .8950948190, 0.5810e-6]

 

[.8625722, .8625717020, 0.4980e-6]

 

[.8243613, .8243606355, 0.6645e-6]

 

[.7799644, .7799638580, 0.5420e-6]

 

[.7288483, .7288475200, 0.7800e-6]

 

[.6704399, .6704392900, 0.6100e-6]

 

[.6041262, .6041258120, 0.3880e-6]

 

[.5292503, .5292500040, 0.2960e-6]

 

[.4451084, .4451081856, 0.2144e-6]

 

[.3509472, .3509470278, 0.1722e-6]

 

[.2459606, .2459603111, 0.2889e-6]

 

[.1292855, .1292854830, 0.170e-7]

 

[0.1e-6, 0., 0.1e-6]

 

[2., 1, 1.]

 

[2., .9987075410, 1.001292459]

 

[2., .9946538260, 1.005346174]

 

[2., .9875591065, 1.012440894]

 

[2., .9771222065, 1.022877794]

 

[2., .9630190630, 1.036980937]

 

[2., .9449011655, 1.055098834]

 

[2., .9223939070, 1.077606093]

 

[2., .8950948190, 1.104905181]

 

[2., .8625717020, 1.137428298]

 

[2., .8243606355, 1.175639364]

 

[2., .7799638580, 1.220036142]

 

[2., .7288475200, 1.271152480]

 

[2., .6704392900, 1.329560710]

 

[2., .6041258120, 1.395874188]

 

[2., .5292500040, 1.470749996]

 

[2., .4451081856, 1.554891814]

 

[2., .3509470278, 1.649052972]

 

[2., .2459603111, 1.754039689]

 

[2., .1292854830, 1.870714517]

 

[2., 0., 2.]

(2)

``


 

Download fourthLINEARBOUD042021.mw
 

NULL

restart

with(LinearAlgebra):

alpha := .985

.985

(1)

for i to 7 do for j from -1 by .1 to 1 do Exact[j] := ((1-j)*(1/2))*exp((1+j)*(1/2)); Y[0] := proc (x) options operator, arrow; -(1/8)*exp(1)+1/2+(-(1/8)*exp(1)-3/4)*x+(1/8)*exp(1)*x^2+((1/8)*exp(1)+1/4)*x^3 end proc; Ics := Z(-1) = 1, Z(1) = 0, (D(Z))(-1) = 0, (D(Z))(1) = -(1/2)*exp(1); exp(x) := convert(taylor(exp(x), x = 0, 25), polynom); f := proc (x) options operator, arrow; ((1/32)*x-5/32)*exp((1/2)*x+1/2) end proc; p := proc (x) options operator, arrow; 0 end proc; q := proc (x) options operator, arrow; -1/4 end proc; r := proc (x) options operator, arrow; 0 end proc; u := proc (x) options operator, arrow; -1/16 end proc; eq[i] := diff(Z(x), `$`(x, 4)) = (1-alpha)*(diff(Y[i-1](x), `$`(x, 4)))+alpha*(f(x)-p(x)*(diff(Y[i-1](x), `$`(x, 3)))-q(x)*(diff(Y[i-1](x), `$`(x, 2)))-r(x)*(diff(Y[i-1](x), x))-u(x)*Y[i-1](x)); s[i] := evalf(dsolve({Ics, eq[i]}, Z(x))); Y[i] := unapply(op(2, s[i]), x); App[j] := evalf(Y[i](j)); Er[j] := abs(App[j]-Exact[j]); print([App[j], Exact[j], Er[j]]) end do end do

[1.00000001, 1, 0.1e-7]

 

[.99889373, .9987075410, 0.1861890e-3]

 

[.99542387, .9946538260, 0.7700440e-3]

 

[.98930908, .9875591065, 0.17499735e-2]

 

[.98020108, .9771222065, 0.30788735e-2]

 

[.96769238, .9630190630, 0.46733170e-2]

 

[.95132386, .9449011655, 0.64226945e-2]

 

[.93059225, .9223939070, 0.81983430e-2]

 

[.90495743, .8950948190, 0.98626110e-2]

 

[.87384983, .8625717020, 0.112781280e-1]

 

[.83667770, .8243606355, 0.123170645e-1]

 

[.79283435, .7799638580, 0.128704920e-1]

 

[.74170543, .7288475200, 0.128579100e-1]

 

[.68267630, .6704392900, 0.122370100e-1]

 

[.61513924, .6041258120, 0.110134280e-1]

 

[.53850104, .5292500040, 0.92510360e-2]

 

[.45219044, .4451081856, 0.70822544e-2]

 

[.35566578, .3509470278, 0.47187522e-2]

 

[.24842284, .2459603111, 0.24625289e-2]

 

[.13000273, .1292854830, 0.7172470e-3]

 

[0., 0., 0.]

 

[1.00000001, 1, 0.1e-7]

 

[.99870526, .9987075410, 0.22810e-5]

 

[.99464487, .9946538260, 0.89560e-5]

 

[.98753974, .9875591065, 0.193665e-4]

 

[.97708963, .9771222065, 0.325765e-4]

 

[.96297160, .9630190630, 0.474630e-4]

 

[.94483868, .9449011655, 0.624855e-4]

 

[.92231783, .9223939070, 0.760770e-4]

 

[.89500815, .8950948190, 0.866690e-4]

 

[.86247884, .8625717020, 0.928620e-4]

 

[.82426685, .8243606355, 0.937855e-4]

 

[.77987484, .7799638580, 0.890180e-4]

 

[.72876867, .7288475200, 0.788500e-4]

 

[.67037492, .6704392900, 0.643700e-4]

 

[.60407851, .6041258120, 0.473020e-4]

 

[.52922004, .5292500040, 0.299640e-4]

 

[.44509347, .4451081856, 0.147156e-4]

 

[.35094315, .3509470278, 0.38778e-5]

 

[.24596164, .2459603111, 0.13289e-5]

 

[.12928690, .1292854830, 0.14170e-5]

 

[-0.2e-7, 0., 0.2e-7]

 

[2., 1, 1.]

 

[2., .9987075410, 1.001292459]

 

[2., .9946538260, 1.005346174]

 

[2., .9875591065, 1.012440894]

 

[2., .9771222065, 1.022877794]

 

[2., .9630190630, 1.036980937]

 

[2., .9449011655, 1.055098834]

 

[2., .9223939070, 1.077606093]

 

[2., .8950948190, 1.104905181]

 

[2., .8625717020, 1.137428298]

 

[2., .8243606355, 1.175639364]

 

[2., .7799638580, 1.220036142]

 

[2., .7288475200, 1.271152480]

 

[2., .6704392900, 1.329560710]

 

[2., .6041258120, 1.395874188]

 

[2., .5292500040, 1.470749996]

 

[2., .4451081856, 1.554891814]

 

[2., .3509470278, 1.649052972]

 

[2., .2459603111, 1.754039689]

 

[2., .1292854830, 1.870714517]

 

[2., 0., 2.]

 

[1.00000000, 1, 0.]

 

[.99902820, .9987075410, 0.3206590e-3]

 

[.99581870, .9946538260, 0.11648740e-2]

 

[.98992527, .9875591065, 0.23661635e-2]

 

[.98089421, .9771222065, 0.37720035e-2]

 

[.96826375, .9630190630, 0.52446870e-2]

 

[.95156339, .9449011655, 0.66622245e-2]

 

[.93031319, .9223939070, 0.79192830e-2]

 

[.90402310, .8950948190, 0.89282810e-2]

 

[.87219221, .8625717020, 0.96205080e-2]

 

[.83430805, .8243606355, 0.99474145e-2]

 

[.78984585, .7799638580, 0.98819920e-2]

 

[.73826774, .7288475200, 0.94202200e-2]

 

[.67902206, .6704392900, 0.85827700e-2]

 

[.61154254, .6041258120, 0.74167280e-2]

 

[.53524746, .5292500040, 0.59974560e-2]

 

[.44953895, .4451081856, 0.44307644e-2]

 

[.35380210, .3509470278, 0.28550722e-2]

 

[.24740416, .2459603111, 0.14438489e-2]

 

[.12969376, .1292854830, 0.4082770e-3]

 

[0.1e-7, 0., 0.1e-7]

 

[1.00000002, 1, 0.2e-7]

 

[.99870689, .9987075410, 0.6510e-6]

 

[.99464990, .9946538260, 0.39260e-5]

 

[.98754844, .9875591065, 0.106665e-4]

 

[.97710162, .9771222065, 0.205865e-4]

 

[.96298633, .9630190630, 0.327330e-4]

 

[.94485556, .9449011655, 0.456055e-4]

 

[.92233620, .9223939070, 0.577070e-4]

 

[.89502732, .8950948190, 0.674990e-4]

 

[.86249795, .8625717020, 0.737520e-4]

 

[.82428488, .8243606355, 0.757555e-4]

 

[.77989071, .7799638580, 0.731480e-4]

 

[.72878132, .7288475200, 0.662000e-4]

 

[.67038351, .6704392900, 0.557800e-4]

 

[.60408269, .6041258120, 0.431220e-4]

 

[.52922015, .5292500040, 0.298540e-4]

 

[.44509054, .4451081856, 0.176456e-4]

 

[.35093889, .3509470278, 0.81378e-5]

 

[.24595805, .2459603111, 0.22611e-5]

 

[.12928542, .1292854830, 0.630e-7]

 

[-0.1e-7, 0., 0.1e-7]

 

[1.0000000, 1, 0.]

 

[.9987075, .9987075410, 0.410e-7]

 

[.9946539, .9946538260, 0.740e-7]

 

[.9875592, .9875591065, 0.935e-7]

 

[.9771225, .9771222065, 0.2935e-6]

 

[.9630194, .9630190630, 0.3370e-6]

 

[.9449015, .9449011655, 0.3345e-6]

 

[.9223945, .9223939070, 0.5930e-6]

 

[.8950954, .8950948190, 0.5810e-6]

 

[.8625722, .8625717020, 0.4980e-6]

 

[.8243613, .8243606355, 0.6645e-6]

 

[.7799644, .7799638580, 0.5420e-6]

 

[.7288483, .7288475200, 0.7800e-6]

 

[.6704399, .6704392900, 0.6100e-6]

 

[.6041262, .6041258120, 0.3880e-6]

 

[.5292503, .5292500040, 0.2960e-6]

 

[.4451084, .4451081856, 0.2144e-6]

 

[.3509472, .3509470278, 0.1722e-6]

 

[.2459606, .2459603111, 0.2889e-6]

 

[.1292855, .1292854830, 0.170e-7]

 

[0.1e-6, 0., 0.1e-6]

 

[2., 1, 1.]

 

[2., .9987075410, 1.001292459]

 

[2., .9946538260, 1.005346174]

 

[2., .9875591065, 1.012440894]

 

[2., .9771222065, 1.022877794]

 

[2., .9630190630, 1.036980937]

 

[2., .9449011655, 1.055098834]

 

[2., .9223939070, 1.077606093]

 

[2., .8950948190, 1.104905181]

 

[2., .8625717020, 1.137428298]

 

[2., .8243606355, 1.175639364]

 

[2., .7799638580, 1.220036142]

 

[2., .7288475200, 1.271152480]

 

[2., .6704392900, 1.329560710]

 

[2., .6041258120, 1.395874188]

 

[2., .5292500040, 1.470749996]

 

[2., .4451081856, 1.554891814]

 

[2., .3509470278, 1.649052972]

 

[2., .2459603111, 1.754039689]

 

[2., .1292854830, 1.870714517]

 

[2., 0., 2.]

(2)

``


 

Download fourthLINEARBOUD042021.mw
 

NULL

restart

with(LinearAlgebra):

alpha := .985

.985

(1)

for i to 7 do for j from -1 by .1 to 1 do Exact[j] := ((1-j)*(1/2))*exp((1+j)*(1/2)); Y[0] := proc (x) options operator, arrow; -(1/8)*exp(1)+1/2+(-(1/8)*exp(1)-3/4)*x+(1/8)*exp(1)*x^2+((1/8)*exp(1)+1/4)*x^3 end proc; Ics := Z(-1) = 1, Z(1) = 0, (D(Z))(-1) = 0, (D(Z))(1) = -(1/2)*exp(1); exp(x) := convert(taylor(exp(x), x = 0, 25), polynom); f := proc (x) options operator, arrow; ((1/32)*x-5/32)*exp((1/2)*x+1/2) end proc; p := proc (x) options operator, arrow; 0 end proc; q := proc (x) options operator, arrow; -1/4 end proc; r := proc (x) options operator, arrow; 0 end proc; u := proc (x) options operator, arrow; -1/16 end proc; eq[i] := diff(Z(x), `$`(x, 4)) = (1-alpha)*(diff(Y[i-1](x), `$`(x, 4)))+alpha*(f(x)-p(x)*(diff(Y[i-1](x), `$`(x, 3)))-q(x)*(diff(Y[i-1](x), `$`(x, 2)))-r(x)*(diff(Y[i-1](x), x))-u(x)*Y[i-1](x)); s[i] := evalf(dsolve({Ics, eq[i]}, Z(x))); Y[i] := unapply(op(2, s[i]), x); App[j] := evalf(Y[i](j)); Er[j] := abs(App[j]-Exact[j]); print([App[j], Exact[j], Er[j]]) end do end do

[1.00000001, 1, 0.1e-7]

 

[.99889373, .9987075410, 0.1861890e-3]

 

[.99542387, .9946538260, 0.7700440e-3]

 

[.98930908, .9875591065, 0.17499735e-2]

 

[.98020108, .9771222065, 0.30788735e-2]

 

[.96769238, .9630190630, 0.46733170e-2]

 

[.95132386, .9449011655, 0.64226945e-2]

 

[.93059225, .9223939070, 0.81983430e-2]

 

[.90495743, .8950948190, 0.98626110e-2]

 

[.87384983, .8625717020, 0.112781280e-1]

 

[.83667770, .8243606355, 0.123170645e-1]

 

[.79283435, .7799638580, 0.128704920e-1]

 

[.74170543, .7288475200, 0.128579100e-1]

 

[.68267630, .6704392900, 0.122370100e-1]

 

[.61513924, .6041258120, 0.110134280e-1]

 

[.53850104, .5292500040, 0.92510360e-2]

 

[.45219044, .4451081856, 0.70822544e-2]

 

[.35566578, .3509470278, 0.47187522e-2]

 

[.24842284, .2459603111, 0.24625289e-2]

 

[.13000273, .1292854830, 0.7172470e-3]

 

[0., 0., 0.]

 

[1.00000001, 1, 0.1e-7]

 

[.99870526, .9987075410, 0.22810e-5]

 

[.99464487, .9946538260, 0.89560e-5]

 

[.98753974, .9875591065, 0.193665e-4]

 

[.97708963, .9771222065, 0.325765e-4]

 

[.96297160, .9630190630, 0.474630e-4]

 

[.94483868, .9449011655, 0.624855e-4]

 

[.92231783, .9223939070, 0.760770e-4]

 

[.89500815, .8950948190, 0.866690e-4]

 

[.86247884, .8625717020, 0.928620e-4]

 

[.82426685, .8243606355, 0.937855e-4]

 

[.77987484, .7799638580, 0.890180e-4]

 

[.72876867, .7288475200, 0.788500e-4]

 

[.67037492, .6704392900, 0.643700e-4]

 

[.60407851, .6041258120, 0.473020e-4]

 

[.52922004, .5292500040, 0.299640e-4]

 

[.44509347, .4451081856, 0.147156e-4]

 

[.35094315, .3509470278, 0.38778e-5]

 

[.24596164, .2459603111, 0.13289e-5]

 

[.12928690, .1292854830, 0.14170e-5]

 

[-0.2e-7, 0., 0.2e-7]

 

[2., 1, 1.]

 

[2., .9987075410, 1.001292459]

 

[2., .9946538260, 1.005346174]

 

[2., .9875591065, 1.012440894]

 

[2., .9771222065, 1.022877794]

 

[2., .9630190630, 1.036980937]

 

[2., .9449011655, 1.055098834]

 

[2., .9223939070, 1.077606093]

 

[2., .8950948190, 1.104905181]

 

[2., .8625717020, 1.137428298]

 

[2., .8243606355, 1.175639364]

 

[2., .7799638580, 1.220036142]

 

[2., .7288475200, 1.271152480]

 

[2., .6704392900, 1.329560710]

 

[2., .6041258120, 1.395874188]

 

[2., .5292500040, 1.470749996]

 

[2., .4451081856, 1.554891814]

 

[2., .3509470278, 1.649052972]

 

[2., .2459603111, 1.754039689]

 

[2., .1292854830, 1.870714517]

 

[2., 0., 2.]

 

[1.00000000, 1, 0.]

 

[.99902820, .9987075410, 0.3206590e-3]

 

[.99581870, .9946538260, 0.11648740e-2]

 

[.98992527, .9875591065, 0.23661635e-2]

 

[.98089421, .9771222065, 0.37720035e-2]

 

[.96826375, .9630190630, 0.52446870e-2]

 

[.95156339, .9449011655, 0.66622245e-2]

 

[.93031319, .9223939070, 0.79192830e-2]

 

[.90402310, .8950948190, 0.89282810e-2]

 

[.87219221, .8625717020, 0.96205080e-2]

 

[.83430805, .8243606355, 0.99474145e-2]

 

[.78984585, .7799638580, 0.98819920e-2]

 

[.73826774, .7288475200, 0.94202200e-2]

 

[.67902206, .6704392900, 0.85827700e-2]

 

[.61154254, .6041258120, 0.74167280e-2]

 

[.53524746, .5292500040, 0.59974560e-2]

 

[.44953895, .4451081856, 0.44307644e-2]

 

[.35380210, .3509470278, 0.28550722e-2]

 

[.24740416, .2459603111, 0.14438489e-2]

 

[.12969376, .1292854830, 0.4082770e-3]

 

[0.1e-7, 0., 0.1e-7]

 

[1.00000002, 1, 0.2e-7]

 

[.99870689, .9987075410, 0.6510e-6]

 

[.99464990, .9946538260, 0.39260e-5]

 

[.98754844, .9875591065, 0.106665e-4]

 

[.97710162, .9771222065, 0.205865e-4]

 

[.96298633, .9630190630, 0.327330e-4]

 

[.94485556, .9449011655, 0.456055e-4]

 

[.92233620, .9223939070, 0.577070e-4]

 

[.89502732, .8950948190, 0.674990e-4]

 

[.86249795, .8625717020, 0.737520e-4]

 

[.82428488, .8243606355, 0.757555e-4]

 

[.77989071, .7799638580, 0.731480e-4]

 

[.72878132, .7288475200, 0.662000e-4]

 

[.67038351, .6704392900, 0.557800e-4]

 

[.60408269, .6041258120, 0.431220e-4]

 

[.52922015, .5292500040, 0.298540e-4]

 

[.44509054, .4451081856, 0.176456e-4]

 

[.35093889, .3509470278, 0.81378e-5]

 

[.24595805, .2459603111, 0.22611e-5]

 

[.12928542, .1292854830, 0.630e-7]

 

[-0.1e-7, 0., 0.1e-7]

 

[1.0000000, 1, 0.]

 

[.9987075, .9987075410, 0.410e-7]

 

[.9946539, .9946538260, 0.740e-7]

 

[.9875592, .9875591065, 0.935e-7]

 

[.9771225, .9771222065, 0.2935e-6]

 

[.9630194, .9630190630, 0.3370e-6]

 

[.9449015, .9449011655, 0.3345e-6]

 

[.9223945, .9223939070, 0.5930e-6]

 

[.8950954, .8950948190, 0.5810e-6]

 

[.8625722, .8625717020, 0.4980e-6]

 

[.8243613, .8243606355, 0.6645e-6]

 

[.7799644, .7799638580, 0.5420e-6]

 

[.7288483, .7288475200, 0.7800e-6]

 

[.6704399, .6704392900, 0.6100e-6]

 

[.6041262, .6041258120, 0.3880e-6]

 

[.5292503, .5292500040, 0.2960e-6]

 

[.4451084, .4451081856, 0.2144e-6]

 

[.3509472, .3509470278, 0.1722e-6]

 

[.2459606, .2459603111, 0.2889e-6]

 

[.1292855, .1292854830, 0.170e-7]

 

[0.1e-6, 0., 0.1e-6]

 

[2., 1, 1.]

 

[2., .9987075410, 1.001292459]

 

[2., .9946538260, 1.005346174]

 

[2., .9875591065, 1.012440894]

 

[2., .9771222065, 1.022877794]

 

[2., .9630190630, 1.036980937]

 

[2., .9449011655, 1.055098834]

 

[2., .9223939070, 1.077606093]

 

[2., .8950948190, 1.104905181]

 

[2., .8625717020, 1.137428298]

 

[2., .8243606355, 1.175639364]

 

[2., .7799638580, 1.220036142]

 

[2., .7288475200, 1.271152480]

 

[2., .6704392900, 1.329560710]

 

[2., .6041258120, 1.395874188]

 

[2., .5292500040, 1.470749996]

 

[2., .4451081856, 1.554891814]

 

[2., .3509470278, 1.649052972]

 

[2., .2459603111, 1.754039689]

 

[2., .1292854830, 1.870714517]

 

[2., 0., 2.]

(2)

``


 

Download fourthLINEARBOUD042021.mw
 

NULL

restart

with(LinearAlgebra):

alpha := .985

.985

(1)

for i to 7 do for j from -1 by .1 to 1 do Exact[j] := ((1-j)*(1/2))*exp((1+j)*(1/2)); Y[0] := proc (x) options operator, arrow; -(1/8)*exp(1)+1/2+(-(1/8)*exp(1)-3/4)*x+(1/8)*exp(1)*x^2+((1/8)*exp(1)+1/4)*x^3 end proc; Ics := Z(-1) = 1, Z(1) = 0, (D(Z))(-1) = 0, (D(Z))(1) = -(1/2)*exp(1); exp(x) := convert(taylor(exp(x), x = 0, 25), polynom); f := proc (x) options operator, arrow; ((1/32)*x-5/32)*exp((1/2)*x+1/2) end proc; p := proc (x) options operator, arrow; 0 end proc; q := proc (x) options operator, arrow; -1/4 end proc; r := proc (x) options operator, arrow; 0 end proc; u := proc (x) options operator, arrow; -1/16 end proc; eq[i] := diff(Z(x), `$`(x, 4)) = (1-alpha)*(diff(Y[i-1](x), `$`(x, 4)))+alpha*(f(x)-p(x)*(diff(Y[i-1](x), `$`(x, 3)))-q(x)*(diff(Y[i-1](x), `$`(x, 2)))-r(x)*(diff(Y[i-1](x), x))-u(x)*Y[i-1](x)); s[i] := evalf(dsolve({Ics, eq[i]}, Z(x))); Y[i] := unapply(op(2, s[i]), x); App[j] := evalf(Y[i](j)); Er[j] := abs(App[j]-Exact[j]); print([App[j], Exact[j], Er[j]]) end do end do

[1.00000001, 1, 0.1e-7]

 

[.99889373, .9987075410, 0.1861890e-3]

 

[.99542387, .9946538260, 0.7700440e-3]

 

[.98930908, .9875591065, 0.17499735e-2]

 

[.98020108, .9771222065, 0.30788735e-2]

 

[.96769238, .9630190630, 0.46733170e-2]

 

[.95132386, .9449011655, 0.64226945e-2]

 

[.93059225, .9223939070, 0.81983430e-2]

 

[.90495743, .8950948190, 0.98626110e-2]

 

[.87384983, .8625717020, 0.112781280e-1]

 

[.83667770, .8243606355, 0.123170645e-1]

 

[.79283435, .7799638580, 0.128704920e-1]

 

[.74170543, .7288475200, 0.128579100e-1]

 

[.68267630, .6704392900, 0.122370100e-1]

 

[.61513924, .6041258120, 0.110134280e-1]

 

[.53850104, .5292500040, 0.92510360e-2]

 

[.45219044, .4451081856, 0.70822544e-2]

 

[.35566578, .3509470278, 0.47187522e-2]

 

[.24842284, .2459603111, 0.24625289e-2]

 

[.13000273, .1292854830, 0.7172470e-3]

 

[0., 0., 0.]

 

[1.00000001, 1, 0.1e-7]

 

[.99870526, .9987075410, 0.22810e-5]

 

[.99464487, .9946538260, 0.89560e-5]

 

[.98753974, .9875591065, 0.193665e-4]

 

[.97708963, .9771222065, 0.325765e-4]

 

[.96297160, .9630190630, 0.474630e-4]

 

[.94483868, .9449011655, 0.624855e-4]

 

[.92231783, .9223939070, 0.760770e-4]

 

[.89500815, .8950948190, 0.866690e-4]

 

[.86247884, .8625717020, 0.928620e-4]

 

[.82426685, .8243606355, 0.937855e-4]

 

[.77987484, .7799638580, 0.890180e-4]

 

[.72876867, .7288475200, 0.788500e-4]

 

[.67037492, .6704392900, 0.643700e-4]

 

[.60407851, .6041258120, 0.473020e-4]

 

[.52922004, .5292500040, 0.299640e-4]

 

[.44509347, .4451081856, 0.147156e-4]

 

[.35094315, .3509470278, 0.38778e-5]

 

[.24596164, .2459603111, 0.13289e-5]

 

[.12928690, .1292854830, 0.14170e-5]

 

[-0.2e-7, 0., 0.2e-7]

 

[2., 1, 1.]

 

[2., .9987075410, 1.001292459]

 

[2., .9946538260, 1.005346174]

 

[2., .9875591065, 1.012440894]

 

[2., .9771222065, 1.022877794]

 

[2., .9630190630, 1.036980937]

 

[2., .9449011655, 1.055098834]

 

[2., .9223939070, 1.077606093]

 

[2., .8950948190, 1.104905181]

 

[2., .8625717020, 1.137428298]

 

[2., .8243606355, 1.175639364]

 

[2., .7799638580, 1.220036142]

 

[2., .7288475200, 1.271152480]

 

[2., .6704392900, 1.329560710]

 

[2., .6041258120, 1.395874188]

 

[2., .5292500040, 1.470749996]

 

[2., .4451081856, 1.554891814]

 

[2., .3509470278, 1.649052972]

 

[2., .2459603111, 1.754039689]

 

[2., .1292854830, 1.870714517]

 

[2., 0., 2.]

 

[1.00000000, 1, 0.]

 

[.99902820, .9987075410, 0.3206590e-3]

 

[.99581870, .9946538260, 0.11648740e-2]

 

[.98992527, .9875591065, 0.23661635e-2]

 

[.98089421, .9771222065, 0.37720035e-2]

 

[.96826375, .9630190630, 0.52446870e-2]

 

[.95156339, .9449011655, 0.66622245e-2]

 

[.93031319, .9223939070, 0.79192830e-2]

 

[.90402310, .8950948190, 0.89282810e-2]

 

[.87219221, .8625717020, 0.96205080e-2]

 

[.83430805, .8243606355, 0.99474145e-2]

 

[.78984585, .7799638580, 0.98819920e-2]

 

[.73826774, .7288475200, 0.94202200e-2]

 

[.67902206, .6704392900, 0.85827700e-2]

 

[.61154254, .6041258120, 0.74167280e-2]

 

[.53524746, .5292500040, 0.59974560e-2]

 

[.44953895, .4451081856, 0.44307644e-2]

 

[.35380210, .3509470278, 0.28550722e-2]

 

[.24740416, .2459603111, 0.14438489e-2]

 

[.12969376, .1292854830, 0.4082770e-3]

 

[0.1e-7, 0., 0.1e-7]

 

[1.00000002, 1, 0.2e-7]

 

[.99870689, .9987075410, 0.6510e-6]

 

[.99464990, .9946538260, 0.39260e-5]

 

[.98754844, .9875591065, 0.106665e-4]

 

[.97710162, .9771222065, 0.205865e-4]

 

[.96298633, .9630190630, 0.327330e-4]

 

[.94485556, .9449011655, 0.456055e-4]

 

[.92233620, .9223939070, 0.577070e-4]

 

[.89502732, .8950948190, 0.674990e-4]

 

[.86249795, .8625717020, 0.737520e-4]

 

[.82428488, .8243606355, 0.757555e-4]

 

[.77989071, .7799638580, 0.731480e-4]

 

[.72878132, .7288475200, 0.662000e-4]

 

[.67038351, .6704392900, 0.557800e-4]

 

[.60408269, .6041258120, 0.431220e-4]

 

[.52922015, .5292500040, 0.298540e-4]

 

[.44509054, .4451081856, 0.176456e-4]

 

[.35093889, .3509470278, 0.81378e-5]

 

[.24595805, .2459603111, 0.22611e-5]

 

[.12928542, .1292854830, 0.630e-7]

 

[-0.1e-7, 0., 0.1e-7]

 

[1.0000000, 1, 0.]

 

[.9987075, .9987075410, 0.410e-7]

 

[.9946539, .9946538260, 0.740e-7]

 

[.9875592, .9875591065, 0.935e-7]

 

[.9771225, .9771222065, 0.2935e-6]

 

[.9630194, .9630190630, 0.3370e-6]

 

[.9449015, .9449011655, 0.3345e-6]

 

[.9223945, .9223939070, 0.5930e-6]

 

[.8950954, .8950948190, 0.5810e-6]

 

[.8625722, .8625717020, 0.4980e-6]

 

[.8243613, .8243606355, 0.6645e-6]

 

[.7799644, .7799638580, 0.5420e-6]

 

[.7288483, .7288475200, 0.7800e-6]

 

[.6704399, .6704392900, 0.6100e-6]

 

[.6041262, .6041258120, 0.3880e-6]

 

[.5292503, .5292500040, 0.2960e-6]

 

[.4451084, .4451081856, 0.2144e-6]

 

[.3509472, .3509470278, 0.1722e-6]

 

[.2459606, .2459603111, 0.2889e-6]

 

[.1292855, .1292854830, 0.170e-7]

 

[0.1e-6, 0., 0.1e-6]

 

[2., 1, 1.]

 

[2., .9987075410, 1.001292459]

 

[2., .9946538260, 1.005346174]

 

[2., .9875591065, 1.012440894]

 

[2., .9771222065, 1.022877794]

 

[2., .9630190630, 1.036980937]

 

[2., .9449011655, 1.055098834]

 

[2., .9223939070, 1.077606093]

 

[2., .8950948190, 1.104905181]

 

[2., .8625717020, 1.137428298]

 

[2., .8243606355, 1.175639364]

 

[2., .7799638580, 1.220036142]

 

[2., .7288475200, 1.271152480]

 

[2., .6704392900, 1.329560710]

 

[2., .6041258120, 1.395874188]

 

[2., .5292500040, 1.470749996]

 

[2., .4451081856, 1.554891814]

 

[2., .3509470278, 1.649052972]

 

[2., .2459603111, 1.754039689]

 

[2., .1292854830, 1.870714517]

 

[2., 0., 2.]

(2)

``


 

Download fourthLINEARBOUD042021.mw

 

 

 

PLS FIND ATTACHED A MAPLE CODE TO SOLVE SOME BOUNDARY VALUE PROBLEM, BUT IT JUMP SOME ITERATION WITHOUT EVALUATION WHICH END UP WITH INACCURATE SOLUTION.

> restart;
> with(LinearAlgebra);
> exp(1) := 2.7182818284590452354;
> alpha := .975;
> NULL;
> st := time[real]();
> for i to 4 do for j from 0 by .1 to 4-exp(1) do Exact[j] := evalf(ln(exp(1)+j)); Y[0] := proc (x) options operator, arrow; 1+x/exp(1)+(1/4)*((exp(1))^2-8*exp(1)+24*ln(2)*exp(1)-32)*x^2/(exp(1)*(16-8*exp(1)+(exp(1))^2))+(1/4)*(16*ln(2)*exp(1)-16-8*exp(1)+(exp(1))^2)*x^3/((-64+48*exp(1)-12*(exp(1))^2+(exp(1))^3)*exp(1)) end proc; Ics := Z(0) = 1, (D(Z))(0) = 1/exp(1), Z(4-exp(1)) = evalf(ln(4)), (D(Z))(4-exp(1)) = 1/4; f := proc (x) options operator, arrow; 0 end proc; p := proc (x) options operator, arrow; 0 end proc; q := proc (x) options operator, arrow; 0 end proc; r := proc (x) options operator, arrow; 0 end proc; u := proc (x) options operator, arrow; 0 end proc; eq[i] := diff(Z(x), `$`(x, 4)) = (1-alpha)*(diff(Y[i-1](x), `$`(x, 4)))+alpha*(-6*convert(taylor(exp(-4*Y[i-1](x)), x = 0, 20), polynom)); s[i] := dsolve({Ics, eq[i]}, Z(x)); Y[i] := unapply(op(2, s[i]), x); App[j] := evalf(Y[i](j)); Er[j] := abs(App[j]-Exact[j]); print([App[j], Exact[j], Er[j]]) end do end do; time[real]()-st;
 

fourthNONLINEARBOUD234.mwfourthNONLINEARBOUD234.mw
 

``

NULL

NULL

NULL

[0., 0, 0.]

(1)

restart

with(LinearAlgebra)

``

for i to 1 do for j from 0 by .1 to 1 do Exact[j] := exp(j); Y[0] := proc (x) options operator, arrow; 1+x-(58/9)*x^2-3*x^2*exp(1)+(64/9)*x^2*exp(3/4)+(40/9)*x^3+4*x^3*exp(1)-(64/9)*x^3*exp(3/4) end proc; Ics := Z(0) = 1, (D(Z))(0) = 1, Z(1) = exp(1), Z(3/4) = exp(3/4); exp(-x) := convert(taylor(exp(-x), x = 0, 5), polynom); f := proc (x) options operator, arrow; 0 end proc; p := proc (x) options operator, arrow; 0 end proc; q := proc (x) options operator, arrow; 0 end proc; r := proc (x) options operator, arrow; 0 end proc; u := proc (x) options operator, arrow; 0 end proc; eq[i] := diff(Z(x), `$`(x, 4)) = 0.1e-2*(diff(Y[i-1](x), `$`(x, 4)))+.999*(f(x)+exp(-x)*Y[i-1](x)*Y[i-1](x)); s[i] := dsolve({Ics, eq[i]}, Z(x)); Y[i] := unapply(op(2, s[i]), x); App[j] := evalf(Y[i](j)); Er[j] := abs(App[j]-Exact[j]); A[i] := print([App[j], Exact[j], Er[j]]) end do end do

[1., 1, 0.]

 

[1.105170012, 1.105170918, 0.906e-6]

 

[1.221399998, 1.221402758, 0.2760e-5]

 

[1.349854378, 1.349858808, 0.4430e-5]

 

[1.491819577, 1.491824698, 0.5121e-5]

 

[1.648716753, 1.648721271, 0.4518e-5]

 

[1.822115950, 1.822118800, 0.2850e-5]

 

[2.013751870, 2.013752707, 0.837e-6]

 

[2.225541500, 2.225540928, 0.572e-6]

 

[2.459603808, 2.459603111, 0.697e-6]

 

[2.718281833, 2.718281828, 0.5e-8]

 

[2., 1, 1.]

 

[2., 1.105170918, .894829082]

 

[2., 1.221402758, .778597242]

 

[2., 1.349858808, .650141192]

 

[2., 1.491824698, .508175302]

 

[2., 1.648721271, .351278729]

 

[2., 1.822118800, .177881200]

 

[2., 2.013752707, 0.13752707e-1]

 

[2., 2.225540928, .225540928]

 

[2., 2.459603111, .459603111]

 

[2., 2.718281828, .718281828]

(2)

``

``


 

Download fourthNONLINEARBOUD234.mw

 

Page 1 of 1