Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.mso.anu.edu.au/~akarakas/Teaching/readme
Дата изменения: Wed Mar 17 06:51:07 2010
Дата индексирования: Tue Oct 2 02:21:44 2012
Кодировка:

Поисковые слова: aircraft
Once you've downloaded the program 'rk.f', you will need to compile
it using a Fortran compiler. In a X-terminal you need to type:

> f77 rk.f -o rk

This should compile without error.

To run the program you will need to type:

> ./rk

It will ask you to enter an integer for n, which provides a measure of
the accuracy. Try values between 10 and 1000 (maximum).


Once the program has run successfully, there should be two output
files:
1) rk.dat
2) exact.dat

The solution to the numerical Runge-Kutta routine is in 'rk.dat', whereas
the exact, analytical solution to the 2nd order ODE is in 'exact.dat'.
For large n, these two should be almost identical. You can see
what these files contain by typing:

> less rk.dat

or

> edit rk.dat

which is program that allows you to edit files (think of a basic word
processor!).

To plot your results, you can use a program called gnuplot. In a terminal
type:

> gnuplot

which takes you inside the program. From the command line type

> plot "exact.dat" using ($1):($2)

a window should pop up with a plot of x versus y. Note that you plotted
column 1 on the x-axis versus column 2 on the y-axis.

I've included a script that includes gnuplot commands already in it.
It is called 'plot.gnu'. To use this script type:

> gnuplot plot.gnu

the result is not a pop-up window with a plot, but a postscript file
called 'print.ps'. You can view this file using 'gv', i.e.,

> gv print.ps