Last login: Thu Sep 3 19:25:45 2009 from pc200424.maths. Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 4.11-STABLE (ASTRO) #27: Mon May 9 11:21:57 BST 2005 Welcome to the School of Maths Unix system. Type 'hogs' to see who is using disk space, or 'faq' for a list of questions and answers. *** astro ~$ cd MA469/ astro ~/MA3469$ # First of all, we must compile the program: astro ~/MA3469$ astro ~/MA3469$ g++ -o kepler1d kepler1d.cpp astro ~/MA3469$ astro ~/MA3469$ # Now we can run the program and see what happens: astro ~/MA3469$ astro ~/MA3469$ ./kepler1d 0 0.75 0 0.1 0.75 0.0592593 0.2 0.755926 0.115764 0.3 0.767502 0.167189 0.4 0.784221 0.211929 0.5 0.805414 0.249173 0.6 0.830331 0.278811 0.7 0.858213 0.301242 0.8 0.888337 0.317171 0.9 0.920054 0.327436 1 0.952797 0.332893 1.1 0.986087 0.334344 1.2 1.01952 0.332502 1.3 1.05277 0.327979 1.4 1.08557 0.32129 1.5 1.1177 0.312861 1.6 1.14898 0.303039 1.7 1.17929 0.292107 1.8 1.2085 0.280294 1.9 1.23653 0.267784 2 1.26331 0.254724 2.1 1.28878 0.241233 2.2 1.3129 0.227407 2.3 1.33564 0.21332 2.4 1.35697 0.199034 2.5 1.37688 0.184596 2.6 1.39534 0.170043 2.7 1.41234 0.155407 2.8 1.42788 0.140709 2.9 1.44195 0.125968 3 1.45455 0.111198 3.1 1.46567 0.0964077 3.2 1.47531 0.0816055 3.3 1.48347 0.0667962 3.4 1.49015 0.0519834 3.5 1.49535 0.037169 3.6 1.49907 0.0223542 3.7 1.5013 0.00753941 3.8 1.50206 -0.00727533 3.9 1.50133 -0.0220901 4 1.49912 -0.0369049 4.1 1.49543 -0.0517193 4.2 1.49026 -0.0665322 4.3 1.4836 -0.0813416 4.4 1.47547 -0.096144 4.5 1.46586 -0.110934 4.6 1.45476 -0.125705 4.7 1.44219 -0.140447 4.8 1.42815 -0.155145 4.9 1.41263 -0.169783 5 1.39565 -0.184337 5.1 1.37722 -0.198778 5.2 1.35734 -0.213067 5.3 1.33604 -0.227158 5.4 1.31332 -0.240989 5.5 1.28922 -0.254487 5.6 1.26377 -0.267555 5.7 1.23702 -0.280077 5.8 1.20901 -0.291904 5.9 1.17982 -0.302853 6 1.14953 -0.312697 6.1 1.11826 -0.321154 6.2 1.08615 -0.327877 6.3 1.05336 -0.332443 6.4 1.02012 -0.334338 6.5 0.986682 -0.332951 6.6 0.953387 -0.327572 6.7 0.92063 -0.317401 6.8 0.88889 -0.30158 6.9 0.858732 -0.279272 7 0.830805 -0.249767 7.1 0.805828 -0.21266 7.2 0.784562 -0.168049 7.3 0.767757 -0.116731 7.4 0.756084 -0.0602984 7.5 0.750054 -0.00106478 7.6 0.749948 0.0582193 7.7 0.75577 0.114795 7.8 0.767249 0.166328 7.9 0.783882 0.211196 8 0.805002 0.248576 8.1 0.829859 0.278347 8.2 0.857694 0.300901 8.3 0.887784 0.316939 8.4 0.919478 0.327297 8.5 0.952208 0.332833 8.6 0.985491 0.334349 8.7 1.01893 0.33256 8.8 1.05218 0.32808 8.9 1.08499 0.321426 9 1.11713 0.313024 9.1 1.14843 0.303224 9.2 1.17876 0.29231 9.3 1.20799 0.280511 9.4 1.23604 0.268012 9.5 1.26284 0.254961 9.6 1.28834 0.241477 9.7 1.31248 0.227656 9.8 1.33525 0.213573 9.9 1.35661 0.19929 10 1.37654 0.184854 10.1 1.39502 0.170304 astro ~/MA3469$ astro ~/MA3469$ # It worked, but the long sequence of numbers astro ~/MA3469$ # requires some experience to interpret. astro ~/MA3469$ # To make a plot, let's save the numbers into a file: astro ~/MA3469$ astro ~/MA3469$ ./kepler1d > kepler1d.out astro ~/MA3469$ astro ~/MA3469$ # Of course, it's the very same numbers: astro ~/MA3469$ astro ~/MA3469$ tail kepler1d.out 9.2 1.17876 0.29231 9.3 1.20799 0.280511 9.4 1.23604 0.268012 9.5 1.26284 0.254961 9.6 1.28834 0.241477 9.7 1.31248 0.227656 9.8 1.33525 0.213573 9.9 1.35661 0.19929 10 1.37654 0.184854 10.1 1.39502 0.170304 astro ~/MA3469$ astro ~/MA3469$ # Now we can do whatever we like with them, e.g. make a plot: astro ~/MA3469$ astro ~/MA3469$ gnuplot G N U P L O T Version 3.7 patchlevel 3 last modified Thu Dec 12 13:00:00 GMT 2002 System: FreeBSD 4.11-STABLE Copyright(C) 1986 - 1993, 1998 - 2002 Thomas Williams, Colin Kelley and many others Type `help` to access the on-line reference manual The gnuplot FAQ is available from http://www.gnuplot.info/gnuplot-faq.html Send comments and requests for help to Send bugs, suggestions and mods to Terminal type set to 'x11' gnuplot> gnuplot> # this will plot rho(t): gnuplot> plot "kepler1d.out" using 1:2 with lines gnuplot> gnuplot> # Now v(rho), i.e. the phase diagram: gnuplot> plot "kepler1d.out" using 2:3 with lines gnuplot> gnuplot> # For very simple plots, E-mailing just the plot command is enough. gnuplot> # If you're doing more sophisticated business, after your plot gnuplot> # starts to look fine, save the whole gnuplot configuration: gnuplot> gnuplot> save "kepler1d.gpl" gnuplot> gnuplot> # and send me (dima@maths.tcd.ie) the file kepler1d.gpl gnuplot> # as an E-mail attachment. gnuplot> gnuplot> # Note that we can feed data to gnuplot right from the program gnuplot> # (if generating the data is quicker than saving them): gnuplot> gnuplot> plot "< ./kepler1d" w l gnuplot> # ("using 1:2" is the default, and "w l" means "with lines") gnuplot> gnuplot> plot "< ./kepler1d" u 2:3 w l gnuplot> # This plot is a phase trajectory! gnuplot> gnuplot> quit astro ~/MA3469$