This journal page presents my first module set for the transformation between the sperical polar and clebsch coordinate systems. Please see the overview in the journal page **j040507-graphics** - in which there is a description of the algorithms to be used in each direction of the transformation. Also: The previously created modules and initializations have been collected together into the separate journal pages **j040512-app** and **j040512-ini** respectively. This has been done as a step toward being able to do a single initialization, after which further notebooks could be run repeatedly without redoing the module definitions and variable initializations.

In this case, we are given the Clebsch coordinates *u*, *v*, and *w*. From these given coordinates, we determine the spherical polar coordinates of the footpoint on the unit sphere from which we will trace the field line which will take us to the point with corresponding spherical polar coordinates *r*, θ, and φ. To specify the order of the Clebsch coordinates, I have followed the description of Proehl et all. (See the quote at the top of the journal page **j040503-graphics**.): *u* will be equal to the azimuthal spherical polar coordinate (φ) at the footpoint, and *v* will be equal to where *r* and θ are spherical coordinates of the footpoint. The third Clebsch coordinate, *w*, is distance along the field line which proceeds outward from the footpoint. Note that the radial physical component of the magnetic induction vector is given by so that the field points in the direction of increasing *r* if and so that the field points in the direction of decreasing *r* if . I have so far assumed in this work that the footpoint is in the former of these two regions so that the field points in the direction of increasing *r* at the footpoint.

Since the third Clebsch coordinate, *w*, is distance along the field line, we can simply decide how many steps we want to make and choose **ds** accordingly. For the first step, I print the **order+1** term in the taylor series to give some indication as to accuracy.

The bounds on *u* and *v* are determined by their definitions on the unit sphere, and *w* has been taken to be positive in the increasing *r* direction along the field line.

In this case, we are given the spherical polar coordinates and we must follow the field line until we reach its footpoint on the unit sphere. Unlike the previous case, we do not know the distance, and, therefore, we must execute a convergent process. This is done in the following module through the introduction of the variable **δs**. The results obtained below seem to indicate that a lack of a similar process in the previous work was responsible for the failure of higher order terms in the Taylor series to produce improvement in the results. (See for example the remark made at in the journal page **j040511-taylor**.)

Since the first Clebsch coordinate, **u** is determined by the footpoint's azimuthal angle, φ, on the unit sphere, and since the second Clebsch coordinate, **v** is determined by where θ is the footpoint's sperical polar angle and where is the radius of the ionosphere, the range of values for **u** and **v** are as shown in the definitions immediately below. The limits on the first spherical polar coordinate, *r*, and the third Clebsch coordinate, **w**, were explicitly coded into the tranformation modules **clebschGETfromSP** and **spGETfromCLEBSCH** respectively.

As shown in of the journal page **j040512-ini**, terms to the ninth order were retained in the Taylor series. Thus, the "err" term below is the term of order ten. On the face of it, the results seem quite accurate - judging from the results of the inverse transformation in which the output from the first transformation is used as input for the second. The variable **foot** is the approximation to the footpoint obtained in **clebschGETfromSP**. I note that it is convenient during development for variables such as **foot** to be global. After development, they can be made local by being placed in the list that appears at the top of very module.

Converted by