Numerical Python in Astronomy and Astrophysics by Wolfram Schmidt & Marcel Völschow

Numerical Python in Astronomy and Astrophysics by Wolfram Schmidt & Marcel Völschow

Author:Wolfram Schmidt & Marcel Völschow
Language: eng
Format: epub
ISBN: 9783030703479
Publisher: Springer International Publishing


This examples shows how to plot multiple graphs from within a loop. The time step is iterated in a loop. The nested loop starting at line 66 applies the Euler scheme to Eq. (4.11). Here, the arrays and contain values of the dimensionless variables and . It is important to create these arrays for each iteration of the outer loop (see lines 60–61) because the number of time steps and, consequently, the array size increases. After plotting versus , the time step is reduced by a factor of 10 (line 76) and the number of steps increases by a factor of 10 to reach the same end point (line 77). The loop terminates if . The physical time step in hours is printed in the legend (the label is produced in lines 72–73). Prior to the loop, we print the analytic solution with the shifted time coordinate defined by Eq. (4.10) (see lines 48–53). The results are shown in Fig. 4.2.

Fig. 4.2Numerical solutions of the differential equation in dimensionless formulation (4.11) for different time steps (, , and ; the corresponding physical time steps are indicated in the legend). The Strömgren radius and formation time are and , respectively



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.