0
$\begingroup$

I want to solve BVP given in the (39)-(40) by the method given below these equations. I have written this method in Mathematica as follows. However, for n=1 it print the solution quickly but for higher iterations it takes too much time. I know that this is due to the exponential functions involved in the scheme which makes higher iteration too much slow. Similar difficulties I face when there are logarithmic functions. When I express the exponential functions in the scheme by Taylor, Mathematica print results quickly but numerical accuracy effects very high. The Picture is attached.

\[Delta] = 10^-20;
Clear[x];
x[0] = Function[t, 0.00000];
x[n_] := x[n] = Function[t,Evaluate[Chop[Expand[x[n - 1][t] -Integrate[Expand[(-Exp[4 (s-t)]/8 + Exp[-4 (s + t)]/8) (x[n - 1]''[s] - 16*x[n - 1][s]+x[n - 1]'[s]*x[n-1]''[s]-(-s^2+3 s- 2)*Exp[-2 s] + (15 s + 2)*Exp[-s])], {s, 0, t}]-Integrate[Expand[(Exp[-4(s+t)]/8 - Exp[4 (t - s)]/8) (x[n - 1]''[s] - 16*x[n - 1][s] + x[n-1]'[s]*x[n-1]''[s]-(-s^2 + 3 s - 2)*Exp[-2s] + (15 s + 2)*Exp[-s])], {s,t, \[Infinity]}]], \[Delta]]]]
a1a = Table[x[n][8.0], {n, 0, 1}]

enter image description here

$\endgroup$

1 Answer 1

4
$\begingroup$

The iterations are slow, as integrals become larger and larger to do for increasing $n$.

For $n=3$ it took about 3 minutes for me. You are supposed to use $t$ as symbolic.

data1 = Table[y[n, t], {n, 0, 2}];
Plot[{t*Exp[-t], Last[data1]}, {t, 0, 4}, 
 PlotStyle -> {Blue, {Dashed, Red}}, 
 PlotLegends -> {"Exact", "Approximation using n=2"}]

Mathematica graphics

You can see the result matches the book

Mathematica graphics

Compare to from book:

enter image description here

The expression for $y_n$ becomes much larger for higher $n$. This slows the integral. here is $n=2$

Mathematica graphics

code

Clear["Global`*"];
y[0, t_] = 0;

y[m_Integer?Positive, t_Symbol] := 
 y[m, t] = 
  Module[{n = m - 1, d1, d2,int1,int2, s,integrand, termA,termB, term},

   termA = (-1/8*Exp[4 *(s - t)] + 1/8*Exp[-4 (s + t)]);
   termB = (1/8*Exp[-4 *(s + t)] - 1/8*Exp[4 *(t - s)]);
   term  = -(-s^2 + 3 s - 2)*Exp[-2 s] + (15 *s + 2)*Exp[-s];
   d1    = D[y[n, t], t];
   d2    = D[y[n, t], {t, 2}];

   int1 = Integrate[termA* (d2 - 16*y[n, t] + d1*d2 + term), {s, 0, t}];
   integrand = Simplify[termB* (d2 - 16*y[n, t] + d1*d2 + term)];
   int2      = Integrate[integrand, {s, t, Infinity}];

   Simplify[y[n, t] - int1 - int2]
   ]

data1 = Table[y[n, t], {n, 0, 2}];
Plot[{t*Exp[-t], Last[data1]}, {t, 0, 4}, 
 PlotStyle -> {Blue, {Dashed, Red}}, 
 PlotLegends -> {"Exact", "Approximation using n=2"}]

I do not know anything about PGES iterations, but it does not seem to me to be fast numerical method if one has to evaluate larger and larger integrals symbolically all the time.

$\endgroup$
1
  • $\begingroup$ Thanks Dear @Nisser. But I have difficulty to to exponential function occurring many times. If there a one exponential function, then it is ok for my. But this really a problem. Because when a I replace all by Taylor, then numerical values effect significantly. $\endgroup$ Nov 30, 2023 at 20:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.