Computational Astrophysics AS 3013 Dr. Peter Woitke, Dr. Christiane Helling, Prof. Keith Horne
“The use of computers to gain information and insight into astrophysical phenomena”
Schedule:
• Mon & Thu 14:00-17:00, 15 credits, 4 assessed exercises • 11 weeks, 150 hours (84 hours for additional programming, reading and private study!)
Outline:
• week 1-3:
simple F90 exercises (input and output, loops, vectors, root-finding)
• week 4-5:
Interstellar Mass Function (integration)
• week 6-9:
orbits of stars and planets (differential equations)
• week 10-11: lightcurves of planet transits (noise, statistics)
Skills: UNIX, Fortran 90, python, numerical algorithms, making plots, scientific writing
Computational Astrophysics
AS 3013
Dr. Peter Woitke
week
Mon 14-17
Thu 14-17
1
23.1
26.1.
lecture/1st ex
2
30.1.
2.2.
lecture/1st ex
3
6.2
9.2
lecture/1st ex
→ Mon 13.2. deadline 9am: 1st assessed exercise (15%) Dr. Christiane Helling
Prof. Keith Horne
4
13.2.
16.2.
IMF
5
20.2.
23.2.
IMF
→ Mon 27.2. deadline 9am: 2nd assessed exercise (20%) 6
27.2.
2.3.
orbits
7
6.3.
9.3.
orbits
8
27.3.
30.4.
orbits
9
3.4.
6.4.
orbits
two-week spring break
→ Mon 10.4. deadline 9am: 3rd assessed exercise (40%) Dr. Peter Woitke
10
10.4.
13.4.
planets
11
17.4.
20.4.
planets
→ Mon 24.4. deadline 9am: 4th assessed exercise (25%) Computational Astrophysics
AS 3013
Resources http://www-star.st-and.ac.uk/~pw31/teaching.html – reading material: UNIX, F90, Python (plotting) – links to online reading materials: details of F90, Python – exercise sheets 1, 2, 3, 4 – lectures 1, 2, 3, 4, 5, 6 – code examples, data, and subroutines to work with
Computational Astrophysics
AS 3013
Why use computers? • Pros:
• Cons:
Computational Astrophysics
AS 3013
Why use computers? • Pros: – fast: can do many calculations quickly – keep track of large amounts of data – too complex for analytical solutions
• Cons:
Computational Astrophysics
AS 3013
Why use computers? • Pros: – fast: can do many calculations quickly – keep track of large amounts of data – too complex for analytical solutions
• Cons: – only as good as assumed input physics, and material data – numerical “solution” affected by grid resolution, inaccurate numerical methods, and round-off errors – typically 1 bug on 100 new code lines (!) Computational Astrophysics
AS 3013
Examples ●
Hydrodynamics: −
3D time-dependent simulations of fluid flows ● ●
●
Stellar structure and evolution: −
explore the inner of stars, their evolution and destiny ● ● ●
●
no analytical solutions for turbulent flows grid resolution crucial
no probe can go there matter under extreme conditions inaccessible spatial scales, timescales (103 - 109) years
Data Reduction: −
robotic search for planets ●
find important results, quickly, in Terrabytes of data
Computational Astrophysics
AS 3013
Hydrodynamical Simulations
Computational Astrophysics
AS 3013
Computational Astrophysics
AS 3013
Computational Astrophysics
AS 3013
example F90 program program MYPROG implicit none
unit starts ...
real :: pi1 real*8 :: pi2 real*16 :: pi3
variable declaration
pi1 = ACOS(-1.0) pi2 = ACOS(-1.d0) pi3 = ACOS(-1.0_16) print*,pi1 print*,pi2 print*,pi3
executable statements
end program MYPROG
… unit ends
Computational Astrophysics
AS 3013
How to program in F90, step-by-step 1. open a terminal window, and create a folder > mkdir ex1 > cd ex1
2. edit your program > gedit myprog.f90 & … and press “Save”
or emacs myprog.f90 & → stores myprog.f90 in a file
3. compile your program > gfortran myprog.f90
→ stores a.out in an executable file
4. run your program > ./a.out
Computational Astrophysics
AS 3013
What to do, and what not to do in classroom 1. discuss algorithms with us/fellow students 2. make us/fellow students write your program 3. ask questions about exercises, and submission 4. compare numerical output with other students 5. ask us for technical help 6. exchange of program parts 7. ask us about meaning of compiler errors 8. ask for detailed help after temporary “blackout”
Computational Astrophysics
AS 3013
What to do, and what not to do in classroom 1. ask questions about exercises, and submission 2. ask us for technical help 3. discuss algorithms with us/fellow students 4. ask us about meaning of compiler errors 5. compare numerical output with other students 6. ask for detailed help after temporary “blackout” 7. make us/fellow students write your program 8. exchange of program parts
think/try yourself first → ask us/fellow students Computational Astrophysics
AS 3013
working toward the deadlines ... ●
you are expected to attend all classes
●
you have preference Mon/Thu 14pm-17pm
●
you cannot access the computer labs on weekends
●
you can conncet from home … Linux: > ssh -X
[email protected] or > ssh -X
[email protected] where “name” is your university login-name, e.g. “pw31”, and “xx” = “01” ... “24” MAC: just like Linux, but on new MACs, you may need to install X11 first (“XQuartz”) Windows: install “XMing” and “PuTTy”. Start Xming, then start PuTTy. On the left, scroll down and click on “+” beside the ssh option. Go to “X11 window” and check the “Enable X11 forwarding” box, then press “Connect”
●
to use the Windows Laptops in the lab, start “PuTTy” as above
●
you can connect from PC room downstairs via “PuTTy” as above
Computational Astrophysics
AS 3013