Re: Suggestion of numerical method for Coupled ODEs



Hsuan-Yeh Chang wrote:
>
> Dear All,
>
> Would anyone suggest a possible numerical method for the
> following coupled first order ODEs?
>
> ( v(x) d/dx , f(x) )( R(x) )= E ( R(x) )
> ( f*(x) , -v(x) d/dx )( L(x) ) ( L(x) )
>
> where {x in Real}, {R(x), L(x) in Complex},
> v(x), f(x) are x-dependent functions, and
> f*(x) is complex conjugate of f(x).
>
> You can consider v(x) = v_0, v_0 = constant, for simplicity.
>
> The boundary conditions are (open boundary condition)
>
> R(0) = R(R) = 0
> L(0) = L(R) = 0
>
> where x in [0, R].
>
> Any suggestion?
>
> HYC

If you use a language with complex arithmetic, no decomposition in
real/imaginary parts is necessary. I suggest Fortran, Python, C99 or
Forth (all support complex arithmetic either intrinsically or as ex-
tensions).

As to algorithm, RK45 is really hard to beat for speed or precision.
That's why it is so widely used in packages like Maple or Mathematica.

Finally let me point you to my ODE notes:

http://galileo.phys.virginia.edu/classes/551.jvn.fall01/551Notes.htm

I see, on review, that I didn't discuss RK45, but you will find it by a
Google search on RK45. It is also known as the Runge-Kutta-Fehlberg method.
I see Fortran and C++ versions that you can download, just from a superficial
look at the sites. You should also search Runge-Kutta-Fehlberg for a discussion
of what it does.

--
Julian V. Noble
Professor Emeritus of Physics
jvn@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
^^^^^^^^^^^^^^^^^^
http://galileo.phys.virginia.edu/~jvn/

"As democracy is perfected, the office of president represents, more and
more closely, the inner soul of the people. On some great and glorious
day the plain folks of the land will reach their heart's desire at last
and the White House will be adorned by a downright moron."

--- H. L. Mencken (1880 - 1956)
.