next up previous contents index
Next: Relative velocity between two Up: The geometry routine for Previous: Calculating the ring relative

The givevel subroutine

Since the velocities are defined on the cylinder/disk boundaries but the velocities are required for various points along the lines of sight a method of interpolating between the given points is needed. This is done by the givevel subroutine, this is passed the $x$ and $z$ co-ordinates of the position where the velocity is required and returns the $r$, $\theta$ & $z$ components of the velocity at that point. Calculating velocity at a given point   [r] \includegraphics[scale=0.7]{velcalc.eps}

The subroutine first works out in which ring the required point lies (it then knows which intersections surround this point). Consider a point P (see figure 4.8) at co-ordinates $X$, $Z$ which lie between cylinders $i-1$ & $i$ and disks $j-1$ & $j$ (at co-ordinates $c_{i-1}$, $c_i$, $d_{j-1}$ & $d_j$ respectively - ie. cylinder/disk intersections A, B, C & D in the diagram). It can then calculate the ratios of the distances between the disks and the cylinders, ie. $r_1=\frac{x-c_{i-1}}{c_i-c_{i-1}}$ and $r_2=\frac{x-d_{j-1}}{d_j-d_{j-1}}$. Using these ratios the $x$(ie. radial) component of velocity is calculated by first taking the two components at A & B and combining them: $v_{AB}=v_A+r_1\left(v_A-v_B\right)$ and then the two components at C & D: $v_{CD}=v_C+r_1\left(v_C-v_D\right)$. These two values can then be combined using $r_2$ to give $v_p=v_{AB}+r_2\left(v_{AB}-v_{CD}\right)$ as the velocity component at point P. This procedure is then repeated for the other two velocity components.

Finding the co-ordinates of a point in the cloud   [l] \includegraphics[scale=0.5]{btor.eps} In order to be able to actually perform the above calculations it is of course necessary to first know the absolute position in the cloud for which the velocity components are required. However, the positions along a line of sight are defined in terms of the line of sight's starting position ($r_{mid}$), its direction ( $\theta_{los}$ & $z_l$) and how far it has travelled so far ($b$). Thus it is necessary to convert these into $r$ and $z$ in the cloud's co-ordinates. Figure 4.9 demonstrates the problem. This is a top view of a line of sight travelling at an angle of $\theta$ - as defined earlier - (ie. effectively a projection of the line of sight onto the plane of the disks). The filled circle is the center line of the cloud (ie. the $r=0$ axis), the line of sight then starts at a distance $r_{mid}$ from this centre line. After a distance $b$ has been travelled along the line of sight the projection distance $b'$ will be $\frac{b}{\sqrt{1+z_{los}^2}}$. The problem is to find the distance $r$ that this point is from the centre line of the cloud. Applying the cosine rule to this triangle yields the required value:

\begin{displaymath}r=\sqrt{\left( \frac{b}{\sqrt{1+z_{los}^2}}\right)^2+r_{mid}^2
-2\frac{b}{\sqrt{1+z_{los}^2}}r_{mid}\cos(\pi-\theta_{los})}
\end{displaymath}

The vertical distance from the centre disk of the cloud is easily calculated and is given by

\begin{displaymath}z=z_{mid}+b \sin \theta_z
\end{displaymath}

These two values are calculated in the geometry subroutine and are then passed to the givevel subroutine as variables rpos and zpos.


next up previous contents index
Next: Relative velocity between two Up: The geometry routine for Previous: Calculating the ring relative

1999-04-12