Wednesday, 10 October 2012

Simplified motion of Cell

After struggling valiantly with Python's 'For' and 'While' loop functions, I managed to write a code ("uvast.py") which calculates the amount of time it takes for a cell at a particular radial position and temperature to rise to 0.95 Solar Radii. There are a few things to note about this code:

1) This is a gross simplification. Neither drag, viscosity nor heat transfer has been calculated for the cell. Hence the incredible speeds achieved.

2) I have not managed to write the 'while' loop very elegantly.

3) I cannot seem to get the values for the time taken and the speeds at those times into arrays, so I am unable to plot them at this time.

Here is an example of the code's output, with a timestep of 0.01 seconds:


In [116]: % run -i uvast.py
Mass (Mkg): 50
Radial Fraction: 0.7
Temperature (MK): 2.4
That took 1989.080 seconds




No comments:

Post a Comment