The advantage of this co-ordinate system can be seen when the equations for the
cylinders and planes are considered. A cylinder of radius
is located at
.
Similarly a disk at height
above the origin
is located at
.
A straight line consisting of the combination of two vectors
[r]
Unfortunately a straight line does not have such a simple expression. The general
vector expression for a straight line is
.
This is
illustrated in Figure 4.4. The vector
(the dashed line with label
)
points to any point
on the required line (the thicker line). Then a fraction
(which can be negative) of vector
is
(the dashed line with label
)
added to this point. Simply varying the value of
will give any point on the line. However,
in order to be able to simply add the individual components of vectors
and
it is necessary to use a co-ordinate system which has its axes
perpendicular to one another, eg. the usual x,y,z arrangement. A general point
in cylindrical polars then becomes
in Cartesians. The
following equations therefore describe the planes, cylinders and lines:
Offcentre lines of sight
It can now be seen that the easiest position to consider lines of sight for is the origin as
here the vector
is zero. Once the lines of sight at the origin have been
calculated it is easy to calculate those at all other points in the cloud as the vector
will point to the position in the cloud of interest and the
will simply be the same as the lines of sight at the origin. See
figures 4.5 and 4.6 to help visualise this - figure 4.6 represents all
the lines of sight at the origin (as described below) and figure 4.5 shows all these lines
of sight offset by
.
This represents how the lines of sight would be drawn from the centre of one
of the rings, where the centre of the ring has the offset
.
The first part of the problem is how to space the lines of sight in a 3-D manner at the
origin. Ideally
it would be nice to space them evenly (i.e. the angle between any two lines of sight is the
same). Unfortunately this is not possible, this problem is equivalent to asking whether
it is possible to make a regular polyhedron with any given number faces (i.e. a
platonic solid). A line of sight would pass through the middle of each face and all the
lines of sight would then be evenly spaced. Unfortunately there are only 5 platonic
solids4.3 the largest of which has 20
sides. Although as will be shown in figures 5.26 & 5.27 using 20 lines of sight is
in fact sufficient for the models used in this thesis it is quite possible that there are some models for which
this is not the case. Note that using just 20 lines of sight leaves
an angle of 52
degrees4.4 between any two lines. In order to retain the flexibility to have as many lines of
sight as desired the program has been written in a general manner that allows the user to specify the required
number of lines of sight. However, this means that it is not possible to space the lines of sight evenly
around the
steradians. However, as the number of lines increases
it becomes less important if the lines are not perfectly spaced. Therefore the following
method has been used.
Lines of sight
The number of lines to be evenly spaced around a great circle is given as an input called
,
parameter
then represents the number of positions perpendicular to this
that are also to have lines of sight on them (note that this does not include the equatorial line). Figure 4.6 shows this with an example of
(so here
). There are 8 horizontal lines of sight aligned along what could be termed the
equator (marked by a dotted circle), there are then 2 other rings marked on the surface
of the sphere (solid lines). These 2 circles together with a line at each pole and the
dotted equatorial line give a total of 8 vertical positions for the lines of sight.
This ensures an equal spacing vertically and horizontally. However, since the circles
that are not on the equator are smaller than the equatorial circle there must be fewer
lines of sight on these circles. There are
lines of sight on each
circle where
are the number of lines of sight on the equatorial circle and
is the angle between the circle in question and the equatorial circle (i.e.
). In this example
,
and so
as shown in figure 4.6 by the six
dashed lines of sight pointing to each of the two solid rings. In addition there is also a single
line pointing vertically upwards and a single line pointing vertically downwards.
(ie.
and
)
The general rule is that
,
and the example
shown in figure 4.6 is in fact the minimum sensible number of lines of sight
possible (ie. 22). The array
stores the number of lines of sight for each `circle' on the sphere
in figure 4.6, thus for the above example
.
Note that the first 8 is not
needed as there is only one `equatorial' circle, however, to make the programming simpler it is
calculated anyway.
Each line of sight is assigned a number (indexed by
in the program) and the
co-ordinates for a vector of the form
are stored in
and
(the two vertical lines are not actually vertical as
this would need
so
is set to a very large number, presently 10,000). Due to the above mentioned point that
duplicates the number of lines of sight on the equatorial line the first
lines of sight
are ignored - thus
labels the required lines of sight from
thru to
.
At the end of the geometry routine the labeling is altered to
count lines of sight from 1 upwards to make it more logical for the rest of the program. Since
is chosen as required there
is no further calculation required for this value. If
is always fixed at a certain value
(say 1) then
where
is the angle between the `equator' and
the circle that the line of sight lies on. Thus
The task for the geometry subroutine is to take each line of sight at each position (i.e.
equation 4.7 for
and
and equation 4.6 for all
required values of
and
)
and calculate where
that line of sight intersects other cylinders and rings on its way out of the cloud. In order to calculate
where a particular line intersects a plane or cylinder consider
equations 4.5 & 4.8. The line intersects a plane when
.
Thus equating the
components of these 2 equations yields
![]() |
line of sight counter |
![]() |
intersection number |
in ![]() |
present ring x co-ordinate |
in ![]() |
present ring y co-ordinate |
in ![]() |
distance line of sight travels in present ring |
in ![]() |
velocity of present ring relative |
to the origin of the line of sight | |
(see section 4.5.4) |
Originally the program was written with geometry routine called once at the beginning of the program and
the entire geometry of the cloud was then calculated for each line of sight in each ring. However, for clouds
with large numbers of disks and cylinders this leads to the intersect array becoming too large for
present computers to easily handle. For example the old 1-D Sten models were usually run with 30 shells, to
reproduce this kind of resolution in a cloud 30 cylinders and 60 disks are needed. This means that there can
potentially be 120 intersections for a line of sight that travels diagonally across the cloud. Therefore the
intersect array needs to have storage positions for 30 cylinders, 60 disks, 22 lines of sight (at a
minimum) with 120 intersections and then the 4 parameters listed above for each intersection, ie.
positions. This array needs to be double precision which assigns 8
bytes to each position, therefore the array needs approximately 152 MBytes of RAM, this increases to 704
Mbytes to reproduce a 50 shell model. These quantities of memory, whilst not impossible to provide, are
expensive and led to consideration of methods of reducing these requirements. The method adopted therefore is
that the geometry routine is called once for every ring in the cloud during each iteration. It then
returns the geometry for each line of sight emanating in that ring. These data are then written over by the data
from the next ring. This means that when the next iteration starts all these calculations are repeated for
each ring. However, the original monolithic geometry routine took less than a minute to run so for a
cloud that requires say 10 iterations to converge (this would be slow convergence, most clouds converge much
faster) the time penalty is no more than 10 minutes which for a model that takes several hours to run anyway
is an acceptable delay. Additionally since computers are able to handle small arrays much faster than they are
large arrays there is an improvement in the speed at which the array contents are accessed. In the original
STEN program a small part of the array storing the geometry information was used to calculate the line
profiles at the end of the program. Making this array much smaller results in a large (factor of 10+) speed up
for the line profile calculations. This is an effect that is worth considering for other parts of the program,
ie. that it is paradoxically sometimes more efficient to re-calculate data than store it.
Lines of sight
Besides the above basic outline of the method there are additional complications that need to be considered in some situations.
Firstly the matter of which sign to take in equation 4.10 was skipped over.
Consideration of the situation for a general point in the cloud at
and its intersection
with a cylinder at
(see
figure 4.7) shows that lines of sight which have
The other situation that needs treating differently is the case where the lines of sight are
horizontal (i.e. )
as in this case equation 4.9 involves dividing by
zero. As this situation means that the line of sight will never cross any disk as it is
lying parallel to them it is just necessary to calculate the intersections with the
cylinders. Note that this problem does not directly arise for vertical lines, the infinite value appears in
equation 4.11 where
would become infinite for a vertical line, however, since
is never given an infinte number this problem does not arise (as was mentioned previously
only near vertical lines are allowed).
It should also be noted that when a line exactly passes through a corner of two rings then due to rounding errors the program often includes a very short piece of a neighbouring ring in the line of sight. This will slightly slow the program down but due to the very short length in the other ring will not have a significant effect on the final output.