The perturbed sine-Gordon equation.

  • Thread starter Thread starter sigmund
  • Start date Start date
Click For Summary
SUMMARY

The discussion focuses on implementing a semi-difference scheme for the perturbed sine-Gordon equation using Matlab. The equations presented include the time evolution of functions u1 and u2, with specific boundary conditions and discretization methods. The user initially faced issues with incorrect solutions, which were resolved by correcting the plotted arrays. The implementation files mentioned are sineG.m and sineGsol.m, which contain the code for the numerical solution.

PREREQUISITES
  • Understanding of the perturbed sine-Gordon equation
  • Proficiency in Matlab programming
  • Knowledge of numerical methods for partial differential equations
  • Familiarity with boundary condition applications in differential equations
NEXT STEPS
  • Explore advanced numerical methods for solving partial differential equations
  • Learn about stability analysis in numerical schemes
  • Investigate Matlab visualization techniques for plotting numerical results
  • Study the effects of varying boundary conditions on the perturbed sine-Gordon equation
USEFUL FOR

Matlab programmers, mathematicians, and researchers interested in numerical methods for differential equations, particularly those working with the perturbed sine-Gordon equation.

sigmund
Messages
23
Reaction score
0
Well, maybe this is not a mathematics question after all, but however, I ask it here.

I have to implement a semi-difference scheme in Matlab of the perturbed sine-Gordon equation

<br /> u_{1,t}=u_2<br />
<br /> u_{2,t}=u_{1,xx}-\sin(u_1)-\alpha u_2+\gamma.<br />

Here u_1 and u_2 are functions of x and t, and \alpha and \gamma are constants. Solutions are searched in the interval 0\leq x\leq\ell and for t\geq0.

Discretization gives

<br /> u_{1i,t}=u_{2i}<br />
<br /> u_{2i,t}=\frac{1}{(\Delta x)^2}(u_{1(i-1)}-2u_{1i}+u_{1(i+1)})-\sin(u_{1i})-\alpha u_{2i}+\gamma<br />

for i=2,3,\dots,N-1.
For i=1 and i=N we get

<br /> u_{11,t}=u_{21}<br />
<br /> u_{21,t}=\frac{1}{(\Delta x)^2}(2u_{12}-2u_{11}-2\eta\Delta x)-\sin(u_{11})-\alpha u_{21}+\gamma<br />

and

<br /> u_{1N,t}=u_{2N}<br />
<br /> u_{2N,t}=\frac{1}{(\Delta x)^2}(2u_{1(N-1)}-2u_{1N}+2\eta\Delta x)-\sin(u_{1N})-\alpha u_{2N}+\gamma<br />

respectively.
Here, the constant \eta comes from the two boundary conditions u_x(0,t)=\eta and u_x(\ell,t)=\eta.

I have implemented this into Matlab. The implementation is seen in the attached files sineG.m and sineGsol.m. I believe my implementation is correct, but I do not get the correct solution.

I would like to receive some comments on the implementation. Do you see any errors? It might be that I am plotting the wrong values against each other.
 

Attachments

Last edited:
Physics news on Phys.org
Well, after all, everything is correct. It just occurred to me that I did not plot the correct arrays against each other. I've corrected that, and now I have got the correct solutions.
 

Similar threads

  • · Replies 21 ·
Replies
21
Views
2K
  • · Replies 30 ·
2
Replies
30
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
Replies
5
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
9
Views
2K