Numerically, how to get the other solution of this 2nd order ODE?

In summary, the conversation discusses an attempt to write a program in Scilab to simulate a quantum particle with a given potential. The desired result is a decaying wave function, but the program only produces an increasing function. The use of the Euler method for solving the ODE is mentioned, with the explanation that it leads to a linear recurrence that may not produce the desired result and may also be affected by numerical errors.
  • #1
Kaguro
221
57
Homework Statement
Given y''=y
Let
v=y'
v'=y

And solve it with Euler method,
I get only the exp(x) solution. But how can I get the exp(-x) solution?
Relevant Equations
None
Actually I was trying to write a small program in Scilab to simulate a quantum particle. When I give a potential higher than energy, the wave function should go like exp(-x) and decay. But my program just increases without bound.

Is there any nice way to do anything about it?
 
Physics news on Phys.org
  • #2
Kaguro said:
I get only the exp(x) solution. But how can I get the exp(-x) solution?
How do you know that ?
What are your initial conditions ?
 
  • #3
Kaguro said:
Homework Statement:: Given y''=y
Let
v=y'
v'=y

And solve it with Euler method,
I get only the exp(x) solution. But how can I get the exp(-x) solution?
Relevant Equations:: None

Actually I was trying to write a small program in Scilab to simulate a quantum particle. When I give a potential higher than energy, the wave function should go like exp(-x) and decay. But my program just increases without bound.

Is there any nice way to do anything about it?

You are unlikely to see it.

With the Euler method you are approximating the ODE as [tex]
\begin{align*}
\frac{y_{n+1} - y_n}{\Delta x} = v_n \\
\frac{v_{n+1} - v_n}{\Delta x} = y_n
\end{align*}
[/tex] and so are actually solving the linear recurrence [tex]
\mathbf{y}_{n+1} = A \mathbf{y}_n[/tex]
where [itex]\mathbf{y}_n = (y_n, v_n)^T[/itex] and
[tex]
A = \begin{pmatrix} 1 & \Delta x \\ \Delta x & 1 \end{pmatrix}.
[/tex] Now this recurrence can be solved analytically: the solution is [tex]
\mathbf{y}_n = a_1 \begin{pmatrix} 1 \\ 1 \end{pmatrix} (1 + \Delta x)^n + a_2 \begin{pmatrix} 1 \\ -1 \end{pmatrix} (1 - \Delta x)^n[/tex] where [itex]a_i[/itex] are constants determined by the initial conditions.
Now as [itex]1 + \Delta x > 1[/itex] for any strictly positive [itex]\Delta x[/itex] we see that [itex]\|\mathbf{y}_n\| \to \infty[/itex] as [itex]n \to \infty[/itex] for any initial conditions with [itex]a_1 \neq 0[/itex]. So you would certainly require that in order to see the decaying solution. But even in that case the numerical error which is the inevitable consequence of floating-point arithmetic also obeys the same recurrence, and will therefore typically increase without bound as [itex]n \to \infty[/itex].
 
  • Like
Likes pbuk

1. What is a 2nd order ODE?

A 2nd order ODE (ordinary differential equation) is a mathematical equation that involves a function and its first and second derivatives. It is commonly used to model physical phenomena in science and engineering.

2. How do you solve a 2nd order ODE?

To solve a 2nd order ODE, you can use various methods such as separation of variables, substitution, or the method of undetermined coefficients. The specific method used will depend on the form of the equation and the initial conditions given.

3. What does it mean to "get the other solution" of a 2nd order ODE?

In some cases, a 2nd order ODE may have two distinct solutions. "Getting the other solution" refers to finding the second solution in addition to the one that is already known.

4. How do you numerically solve a 2nd order ODE?

Numerical methods can be used to approximate the solutions of a 2nd order ODE. These methods involve breaking the problem into smaller steps and using calculations to estimate the values of the function at each step. Examples of numerical methods include Euler's method and the Runge-Kutta method.

5. What is the significance of finding the other solution of a 2nd order ODE?

Having both solutions of a 2nd order ODE can provide a more complete understanding of the problem at hand. It can also help in verifying the accuracy of the solutions and can be useful in certain applications such as in physics and engineering.

Similar threads

  • Differential Equations
Replies
9
Views
2K
  • Advanced Physics Homework Help
Replies
2
Views
829
Replies
6
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
3K
  • Differential Equations
Replies
2
Views
2K
  • Differential Equations
Replies
1
Views
1K
  • Advanced Physics Homework Help
Replies
7
Views
1K
Replies
11
Views
1K
  • Differential Equations
Replies
5
Views
1K
Back
Top