Question: Difficulty how to plot Numerical simulation of the discrete Klein-Gordon equation

I am trying to create the plot for the dynamics of the discrete Klein - the equation gives Gordon equation (DKG) with friction for t=0 and t=3000.

As you can see below, creating the plot for t=0 is pretty easy. However, for t=3000, I tried to create a procedure to produce the desired plots, but when I ran the code, nothing happened. The worksheets are evaluated all the time. There are no results.

I am studying  for my thesis  the dynamics of the discrete Klein - the equation gives Gordon equation (DKG) with friction:

 

diff(U(t), t, t)-K(`U__n+!`-2*U__n+`U__n-1`)+delta*U__n+(D(W))(U__n) = 0, beta > 0, delta > 0

In the above equation, W describes the potential function:

W(U__n) = -(1/2)*`ω__d`^2*U__n^2+(1/4)*beta*`ω__d`^2*U__n^4

 

to which every coupled unit U__nadheres. In Eq. (1), the variable U__n(t)is the unknown displacement of the oscillator occupying the
n-th position of the lattice, and is the discretization parameter. We denote by the distance between the oscillators of the lattice. The chain (DKG) contains linear damping with a damping coefficient, while β s the coefficient of the nonlinear cubic term.

 

For the DKG chain (1), we will consider the problem of initial-boundary values, with initial conditions

 

U__n(0) = `U__n,0` and U__n(0) = `U__n,1` and `in`(`U__n,1`, 2*real^(k+2))

and Dirichlet boundary conditions at the boundary points x__0 = -(1/2)*Land "`x__k+1`=L/(2),"that is,

U__0 = `U__k+1` and `U__k+1` = 0, t >= 0*3

 

Therefore, when necessary, we will use the short notation `Δ__d`or the one-dimensional discrete Laplacian

`U__Δ__d__U__n∈ℤ` = `U__Error loading this structure.`-2*U__n+4*`U__n-1`

 

We investigate numerically the dynamics of the system (1)-(2)-(3). Our first aim is to conduct a numerical study of the property of Dynamic Stability of the system, which directly depends on the existence and linear stability of the branches of equilibrium points. 

For the discussion of numerical results, it is also important to emphasize the role of the parameter `ω__d`By changing the time variable proc (t) options operator, arrow; 1/h end proc we rewrite Eq.(1) in the form

 

diff(U(t), t, t)-`Δ__d`*U(t)+(diff(delta(x), x))*U__n = `Ω__d`(-`βU__n`^3+U__n)^2, t > 0, `Ω__d`^2 = h^2*`ω__d`^2, diff(delta(x), x) = `hδ`

 

The change in the scaling of the lattice parameter of the problem makes it important to comment here on the nature of the continuous and anti-continuous limit. For the anti-continuous limit, we need to consider the case in Eq. (1) where proc (`ω__d`) options operator, arrow; infinity end procIn the case of nonlinearity present in the governing equations, the continuous limit needs to be taken as well. On the other hand, for small values of the parameter, the system becomes significant. However, because of the model we consider, we take the asymptotic linear limit as

proc (`ω__d`) options operator, arrow; 0 end proc

 

We consider spatially extended initial conditions of the form:

U__n(0) = `U__n,0` and `U__n,0` = a*sin(`jπhn`/L), j = 1, () .. K

 

where h = L/(K+1) is the distance of the grid and  a > 0 is the amplitude of the initial condition
We also assume zero initial velocity:

 

"(`U__n`(0)=`U__n,1`=0) "

 

• 

t=0

 

restart; with(plots); a := 2; j := 2; L := 200; K := 99; h := L/(K+1); n := Vector([`$`(-(1/2)*L+h*i, i = 0 .. K+1)]); U_n0 := a*map(proc (x) options operator, arrow; sin(j*Pi*x/L) end proc, h*n)

plot([seq([n[i], U_n0[i]], i = 1 .. K+2)], style = point, color = blue, axes = boxed, gridlines, grid = [true, true], labelfont = [TIMES, 12])

 

Now I am trying to create plot for different values of a.

a = {2, 1.82, 1.85, 1.9, 1.95}, K = 99, L = 200, beta = 1, delta = 0.5e-1, `ω__d`^2 = 1

restart; with(plots)

L := 200; K := 99; j := 2; omega_d := 1; beta := 1; delta := 0.5e-1

h := L/(K+1); n := Vector([`$`(-(1/2)*L+h*i, i = 0 .. K+1)])

dt := 0.5e-1; tmax := 3000; tspan := [seq(0+dt*i, i = 0 .. trunc(tmax/dt))]

NULL

a := 1; U0 := a*map(proc (x) options operator, arrow; sin(j*Pi*h*x/L) end proc, n); U0[1] := 0; U0[K+2] := 0; Udot0 := Vector(K+2, 0)

discrete_laplacian := proc (U) local i, Laplacian; Laplacian := Vector(K+2); for i from 2 to K+1 do Laplacian[i] := U[i+1]-2*U[i]+U[i-1] end do; Laplacian[1] := 0; Laplacian[K+2] := 0; return Laplacian end proc

NULL

U := U0; Udot := Udot0; for t to num_steps do Lap := discrete_laplacian(U); Ucube := map(proc (x) options operator, arrow; x^3 end proc, U); for i from 2 to K+1 do Udot[i] := Udot[i]+dt*(2*omega_d^2*U[i]-beta*Ucube[i]-delta*Udot[i]+Lap[i]) end do; for i from 2 to K+1 do U[i] := dt*Udot[i]+U[i] end do; U[1] := 0; U[K+2] := 0; if `mod`(t, 1000) = 0 then plotU := plot(n, U, style = line, color = blue, title = cat("Displacement at t=", t*dt), labels = ["n", "Displacement"], grid = [true, true]); display(plotU) end if end do

NULL


My target is the following plots

Download Numerical_Simulation_of_discrete_Klein-Gordon_Equation.mw

Please Wait...