Mathematica Ndsolve periodic boundary conditions

In summary, the conversation discusses the use of Mathematica to solve a periodic equation with an initial function and the use of NDsolve for this purpose. The code provided uses NDSolve to express the equations in a way that Mathematica can understand and then plots the solution using Plot3D.
  • #1
innocent
1
0
Hello,
Mathematica is very new to me. Please help.

n=1,2,3...,10 and stepsize between n(2)-n(1)=0.1
It is periodic. I mean n(11)=n(1). i have a initial function which depends on n
and i want to solve this equation by NDsolve like that

u[n, t = 0] == 1/(2*n + 1)
Do [ u[n, 0], {n, 0, 10, 0.1}] %
u[n + 1, t] == u[1, t]
u [n,t]== u[0,t]
s == NDsolve [
D [u[n, t]] == -[u[n + 1, t] + u[n - 1, t]] - [[u[n, t]]^3], ,
u[n, t == 0], u, {n, 0, 10}, {t, 0, 5}]
Plot3D [s, {n, 0, 10}, {t, 0, 5}]but it doesn't work.
Thank you so much
 
Physics news on Phys.org
  • #2
.It's good that you're asking for help! To use NDSolve, you will need to make sure that your equations are expressed in a way that Mathematica can understand. Here is one way to express the equations you wrote using NDSolve:s = NDSolve[{D[u[n, t], t] == -(u[n + 1, t] + u[n - 1, t]) - u[n, t]^3, u[n, 0] == 1/(2*n + 1), u[10 + 1, t] == u[1, t], u[0, t] == u[10, t]}, u, {n, 0, 10}, {t, 0, 5}]Plot3D[Evaluate[u[n, t] /. s], {n, 0, 10}, {t, 0, 5}]
 

1. What is Mathematica Ndsolve?

Mathematica Ndsolve is a function in the Mathematica software that is used for solving differential equations numerically.

2. What are periodic boundary conditions?

Periodic boundary conditions are a set of conditions used in differential equations to simulate a system that repeats itself after a certain period. This is commonly used in physics and engineering simulations.

3. How do I specify periodic boundary conditions in Mathematica Ndsolve?

To specify periodic boundary conditions in Mathematica Ndsolve, you will need to use the "PeriodicBoundaryCondition" function. This function takes in the variables, the range of the periodicity, and the boundary conditions as inputs.

4. Can I solve differential equations with multiple periodic boundary conditions using Mathematica Ndsolve?

Yes, Mathematica Ndsolve allows you to specify multiple periodic boundary conditions for your differential equations. You can use the "PeriodicBoundaryCondition" function multiple times with different sets of variables and boundary conditions.

5. Are there any limitations to using Mathematica Ndsolve for periodic boundary conditions?

One limitation of using Mathematica Ndsolve for periodic boundary conditions is that it is only applicable for systems with one-dimensional periodicity. If your system has higher-dimensional periodicity, you will need to use other methods or software.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
201
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
156
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
1K
  • Differential Equations
Replies
7
Views
332
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
Back
Top