0
$\begingroup$

I have a pde given below: $u_{t}-u_{xx}+\frac{1}{4}u=0, $ with boundary conditions $u(0,t)=1,\ \ u(1,t)=\frac{1}{2}e^{\frac{-t}{4}}+e^{\frac{-1}{2}},$ where $0\leq x\leq 1$. If the initial iterate is $u_{0}=(\frac{1}{2}e^{\frac{-t}{4}}+e^\frac{-1}{2}$-1)x+1$, \alpha_{n}=0.9$. Then I use the following iterate to obtain the numerical solution for the above pde:

$u_{n+1}(x,t)=u_{n}(x,t)+\alpha_{n}\int_{0}^{x}x(1-s)[(u_{n})_{t}-(u_{n})_{xx}+\frac{1}{4}u_{n}]ds+\alpha_{n}\int_{x}^{1}s(1-x)[(u_{n})_{t}-(u_{n})_{xx}+\frac{1}{4}u_{n}]ds$.

I have coded the above iteration as follows:

\[Delta] = 10^-20;
Clear[u];
u[0 _]:= u[0] = Function[{x,t},(Exp[-t/4]/2+Exp[-1/2]-1)x+1];
a[n_]:= a[n] = 0.9;
u[n_]:= u[n]=Function[{x,t},Evaluate[Chop[Expand[u[n - 1][x,t]+Integrate[Expand[x(1-s) (D[u[n - 1][x,s], s]-D[u[n-1][x,s],{x,2}]+0.25*u[n-1][x,s])],{s,0,x}]+Integrate[Expand[s(1-x)(D[u[n-1][x,s],s]-D[u[n-1][x,s],{x,2}]+0.25*u[n-1][x,s])], {s,x,1}]], \[Delta]]]]
a1a = Table[u[n][0.2, 0.2], {n, 0, 3}]

When I run my code for three iteraions, i get the values for $(0.2,0.2)$ as $1.01643, 0.901749. 0.892542, 1.00427$, which are no convergent to the required solution. I have attached the table of a paper, I donot where is the mistake in my code. The exact solution of this pde is $u(x,t)=\frac{1}{2}xe^{\frac{-t}{4}}+e^{\frac{-x}{2}}$. I also replace $u[n-1][x,t]$ by $u[n][{x,t}]$ but this not work. I think there is saomething wrong in my code. This example is the example 1 of the paper https://doi.org/10.1007/s40819-016-0289-x enter image description here

$\endgroup$
8
  • $\begingroup$ Is there an a[n] missing from the u[n] definition? $\endgroup$
    – MelaGo
    Sep 20, 2023 at 21:29
  • $\begingroup$ With 39.95€ the link is not a bargain . Perhaps you can show the main idea of the iteration? $\endgroup$ Sep 21, 2023 at 7:09
  • $\begingroup$ Is there a comma missing? u[0 _] $\endgroup$ Sep 21, 2023 at 7:32
  • 1
    $\begingroup$ Your exact solution x/2 Exp[-t/4] + Exp[-x/2] doesn't solve the pde! $\endgroup$ Sep 21, 2023 at 7:41
  • 1
    $\begingroup$ Interestingly, the exact solution in the text $$ u(x,t) = \frac{1}{2} x~e^{-\frac{t}{4}} +e^{-\frac{x}{2}} $$ is a solution to $$u_t - u_{xx} + \frac{1}{4}u =0~ ,$$ but not (as @UlrichNeumann already pointed out) $$u_t - u_{xx} - \frac{1}{4}u =0 ~.$$ $\endgroup$
    – ydd
    Sep 21, 2023 at 19:45

0

Your Answer

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