1

I am trying to implement the following scheme mentioned in the paper

"NUMERICAL SOLUTIONS OF BENJAMIN-BONA-MAHONY-BURGERS EQUATION VIA NONSTANDARD FINITE DIFFERENCE SCHEME " What is mentioned in the paper for the BMMB Equation : http://math-frac.org/Journals/EJMAA/Vol6(2)_July_2018/Vol6(2)_Papers/21_EJMAA_Vol6(2)_July_2018_pp_237-245.pdf enter image description here

Using the following scheme enter image description here

enter image description here

enter image description here enter image description here I have tried this code in Mathematica

How to discretize a nonlinear PDE fast? nonlinear-pde-fast/28011 Code Edited following the post

NN = 8 ;
M = 8 ;
a = -10 ; 
b = 10 ;
h = (b - a)/NN;
T = 0.5 ;
k = T/M ; 
\[Phi][x_] = (E^(Sqrt[2] h/3) - 2 + E^(-Sqrt[2] h/3))/(2/9);
\[Psi][y_] = Sinh[y];
(*Defining the Grid points*)
Table[Subscript[x,i] = -10 + i h , {i , 0, M}];
Table[Subscript[t,j] = 0 + j k , {j , 0 , NN } ] ;
(*Defining the Initial Conditions*)
For[i = 0, i <= M, i++ ,Subscript[w , i , 0 ] = E^(-Subscript[x, i]*Subscript[x, i])];
(*Defining the Boundary Conditions*)
For [j = 0 , j <= NN , j++, Subscript[w, 0, j]  = 0];

For[j = 0 , j <= NN , j++ ,Subscript[w, M, j] = 0];

(Defining the nonlinear equations due to discritization) For[i = 1 , i <= NN, i++ , {For [j = 1, j <= M - 1 , j++, f[i, j] = Subscript[w, i + 1, j + 1](1/(2[Psi][k]([Phi][h])^2) + 1/( 2 ([Phi][h])^2) - 1/(4[Phi][h])(1 + ( Subscript[w, i, j + 1] + Subscript[w, i, j])/2)) - ((Subscript[w, i, j + 1] - Subscript[w, i, j - 1])/( 2* [Psi][k]) - (-2 Subscript[w, i, j + 1] + Subscript[w, i - 1, j + 1] - Subscript[w, i + 1, j - 1] + 2Subscript[w, i, j - 1] - Subscript[w, i - 1, j - 1])/( 2* [Psi][k]([Phi][h])^2) - (-2Subscript[w, i, j + 1] + Subscript[w, i - 1, j + 1] + Subscript[w, i + 1, j - 1] - 2Subscript[w, i, j - 1] + Subscript[w, i - 1, j - 1])/(2([Phi][h])^2 ) + (1 + (Subscript[w, i, j + 1] + Subscript[w, i, j])/ 2)((-Subscript[w, i - 1, j + 1] + Subscript[w, i + 1, j] - Subscript[w, i - 1, j])/(4([Phi][h]))))]}]; Sys = Flatten[Table[f[i, j], {i, M - 1}, {j, NN }]]//FullSimplify;

Vec = Flatten[Table[Subscript[w, i, j], {i, M - 1}, {j, NN}]]; Sol = FindRoot[Sys, {#, 1} & /@ Vec]

I get an error with FindRoot
How can i fix my code to show the result For N=M=8 ?

Mahmoud Hassan
  • 293
  • 1
  • 10
  • 1
  • Why not NDSolve? 1. Have you read this post?: https://mathematica.stackexchange.com/q/10453/1871 2. m is undefined, please always pay attention to the color of the variable, the m is blue, which indicates it's "empty". 3. /FullSimplify is obviously wrong. 4. Think about what's wrong with the following: FindRoot[{x == 1, y == 2}, {{{x, 1}, {y, 2}}}] Check the document of Flatten and think about how to fix the sample with this function. 5. Check what's inside Guess[[1, 1]] and think about what's wrong.
  • – xzczd Aug 13 '21 at 02:31
  • 0.I am trying to implement the method mentioned in the paper .Discretization of time and space using central finite difference .1. Yes .I get an Error with FindRoot .How can i fix the error ? I think If i use N =8 , M =8 . I get 8 points out of the domain So i need to replace them with 0 to fix the problem . How can i replace all 8 values in the Sys ? – Mahmoud Hassan Aug 13 '21 at 09:31
  • 1
    It's the paper that's unclear at this point. As you've noticed, with the scheme in the paper we still miss NN-1 equation, because the scheme uses non-standard central difference formula in $t$ direction, too. In traditional finite difference method, the missing equation can be supplied by one-sided difference formula, perhaps the author of the paper has done something similar, but this doesn't seem to be explained in the paper. – xzczd Aug 13 '21 at 12:01