How to plot and animate an ODE in Maple using finite difference scheme

In summary, the conversation discusses plotting and animating a wave function using the Schrodinger equation. The speaker has a finite difference equation and is asking for clarification on setting x=-10 and rearranging for \psi(x,t). They are looking for help and examples on how to solve the equation numerically and use the solution to plot and animate the wave function.
  • #1
Slide rule
3
0
Hi,

I am currently trying to plot and animate a wave function using the Schrodinger equation.

I currently have the following finite difference equation:-

i(\psi(x, t+\Delta t)-\psi(x,t))/(\Delta t)=-(1/2)*(\psi(x+\Delta x, t)+\psi(x-\delta x, t)-2*\psi(x,t))/((\Delta x)^2)+V(x)*\psi(x,t)

Would I set x=-10, for example, where I plan to plot between -10 and 10 so the length L would be L=20 and \Delta x=L/N where N is the number of differences? Should I rearrange for \psi(x,t)?

As you can probably tell, I'm lost on what I need to do, any help or a similar example would be greatly appreciated.

Thanks
 
Physics news on Phys.org
  • #2
Yes, you can set x=-10 and plot between -10 and 10 so the length L would be 20 and \Delta x=L/N where N is the number of differences. You could rearrange the equation for \psi(x,t) to get a recursive relation for \psi(x,t+\Delta t) in terms of \psi(x,t). Then, you can use numerical methods (e.g. Euler method or Runge-Kutta method) to solve the equation numerically. You can then use the solution to plot and animate the wave function.
 

Related to How to plot and animate an ODE in Maple using finite difference scheme

1. How do I plot an ODE in Maple?

To plot an ODE in Maple, you will first need to define the ODE using the diff command. Then, use the dsolve command to solve the ODE and store the solution in a function. Finally, use the plot command to graph the function over a desired interval.

2. What is a finite difference scheme?

A finite difference scheme is a numerical method for solving differential equations by approximating the derivatives with finite differences. This allows for the equations to be solved on a discrete grid of points, making it easier to implement on a computer.

3. How do I use a finite difference scheme to solve an ODE?

To use a finite difference scheme to solve an ODE, you will first need to discretize the equation by approximating the derivatives with finite differences. This will result in a system of algebraic equations, which can then be solved using a linear algebra method, such as Gaussian elimination or LU decomposition.

4. Can I animate the solution to an ODE in Maple?

Yes, you can animate the solution to an ODE in Maple by using the animate command. This allows you to see the evolution of the solution over a desired time interval, which can be helpful in understanding the behavior of the system.

5. Are there any limitations to plotting and animating ODEs in Maple using a finite difference scheme?

One limitation is that the accuracy of the solution may be affected by the size of the grid used in the finite difference scheme. Using a smaller grid can result in a more accurate solution, but it may also increase the computational time. Additionally, some systems of ODEs may be difficult to discretize and solve using a finite difference scheme, in which case a different numerical method may be more suitable.

Similar threads

Replies
1
Views
3K
Replies
1
Views
3K
Replies
4
Views
2K
Replies
5
Views
2K
Replies
1
Views
1K
Replies
1
Views
2K
Back
Top