Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
FREGRAVOL1.pdf
Скачиваний:
71
Добавлен:
05.06.2015
Размер:
5.17 Mб
Скачать

B Mathematica Packages

319

We suggest that you type periastro in a separate NoteBook, different from the NoteBook containing the package. This package solves the numerical differential equation and plots the orbit curve in the xy-plane, comparing it with the Keplerian ellipsis. It is an interactive programme that asks the user to supply the semilatus rectum of the orbit expressed in units of the Schwarzschild emiradius and the eccentricity. Next after showing the Keplerian orbit and the General Relativity orbit after one revolution the programme stops and ask whether the user wants to display the orbit for more revolutions and for how many. It goes back to such a question until the user is satisfied and decides to stop.

Programme

Main Programme Periastro This is the main programme which asks for the inputs of the parameters and then calls the calculation subroutines

,

,

periastro:= Print["==========================="];

Print["We make a comparison between orbits in Newton’s Theory"]; Print["and in Schwarzschild geometry"]; Print["—————————"];

Print["Input of geometrical parameters"];

α = Input["Semilatus rectum in units of Schwarzschild emiradius"]; ec = Input["eccentricity"];

= − 2 ;

lqα 1 ec

Print["==========================="]; Print["PLOT of the ORBIT with the following parameters:"];

Print["Semilatus rectum = ", α, "m"]; Print["eccentricity = ", ec]; Print["==========================="]; Print["Keplerian orbit with these parameters"]; perihelkep; Print["==========================="];

Print["The Schwarzschild orbit with the same parameters"]; nn = 1;

perihelgr; Label[ripeto];

Print["After more revolutions, Yes or No?"]; flagga = Input["Yes or No"]; If[flagga===Yes, Goto[plotto], Goto[stoppo]]; If[flagga===No, Goto[stoppo], {pippo = 0}]; Label[plotto];

nn = Input["number of revolutions"]; perihelgr;

Goto[ripeto];

Label[stoppo];

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]