SECTION I.     A Simple Point Mass Lens

    We begin with a point mass lens, because we can easily find the images analytically and then demonstrate how to obtain the same results with gravlens.

Part 1. Analytical Analysis

      First, we find the Einstein radius using the general equation:
See Einstein Radius Equation

      The point mass lens equation can be rewritten as:
(2) Re-formulated Lens Equation
where Theta is the image position and Beta is the source position. Solving this equation yields the two image positions :
(3) Image Position Equation

Once we have the image positions we can calculate the magnification of each image.  Due to the symmetry of this case, we can use the following equation to obtain the magnification of each image.

(4) Image Magnification Equation

Now we will solve these equations.  Solving for the Einstein radius yields:
(5) General Einstein Radius Solution

We will assume that the source position is one half the Einstein radius and determine the image positions:
(6) Source Position

(7) Image Position Solution #1
(8) Image Position Solution #2

Lastly, we find the magnification of each image:
(9) Image Magnification Solution #1
(10) Image Magnification Solution #2

Part 2. Gravlens Analysis

        Now, we can use the gravlens software to obtain the same results.  Because we will be dealing with a case of a point mass at the origin, we must set the gridlo1 variable to a  small non-zero value (e.g. gridlo1 = 1.0e-4) to avoid the central singularity (see §4.1.3 in the gravlens manual).   To do this, simply enter the command:
> set gridlo1 = .0001

Because our value for the Einstein radius will be 2.02 arc seconds, we must set the gridhi1 variable to a larger value (e.g. gridhi1 = 5.0) than the default so the outer image is within the grid used in the software.  We do this via the command: 
> set gridhi1 = 5.0

Once that variable is set, you can begin to specify the mass models using the command:
> startup 1 1

You will then be prompted to specify the mass model and its parameters.  A point mass model is specified as ptmass.  The definition and relation between the code and model parameters can be found in Table 3.2 of the manual.  Of the ten parameters (generally described in §3.2 of the manual) the only one which we must specify for our case is the mass scale or p[1].  The lens will be centered at the origin or represented by the Cartesian coordinate position (0, 0) so p[2] and p[3] are set to zero.  For the point mass model, this represents the Einstein radius of the lensing system.  Using the Einstein radius we found in our analytical calculations, we enter:

ptmass 2.02 0 0 0 0 0 0 0 0 0

Next, you will be prompted to specify which values are allowed to vary for the galaxy.  This is a option that is useful for the lens modeling part of the software.  Since we do not wish to allow any of the parameters to vary, we simple enter all zeros:

0 0 0 0 0 0 0 0 0 0

You have now defined the model and its parameters. 

  Note:  As an alternative to performing this interactive run, you can place the mass model specification in a file and read it with the command
  > startup <file>
  Here the startup file must contain the following model and galaxy information that would be entered through the prompt:
   
1 1
  ptmass 2.02 0 0 0 0 0 0 0 0 0
  0 0 0 0 0 0 0 0 0 0


We can now find the image positions and corresponding magnifications of the lensing system using the findimg command. This command takes two parameters, u and v,  which specify the Cartesian coordinate position of the source.  The relation between the source position, Beta, used in the analytical analysis and the Cartesian coordinate position (u, v) is given by the equation:
Relationship Between Beta and (u, v)

We already have determined that the source position, Beta, is one-half the Einstein radius of the lens.  Therefore, for the sake of simplicity, we will assume that source lies on the y axis (v = 0).  Thus, Cartesian coordinates that define the source position are given by:
u = 1.01
v = 0.00

 With this information, we can now use gravlens to find the images and their magnifications by entering the command:
> findimg 1.01 0.00

This should return:
findimg results:
1.010000e+000 0.000000e+000  # source
# 2 images:
-1.577168e+000 -1.210594e-016 -5.914103e-001
2.587168e+000 -2.908380e-023 1.591410e+000


The first two values in each row represent the image position, (x, y) and the third represents the image magnification.  The results produced by the software can be translated to match the analytical calculations found in Part I by using the relation between the analytical image positions, Theta, and the (x, y) coordinates for each image position as done with the source position given by Beta and (u, v).  The analytical results may differ from the gravlens calculations a little due to rounding in our calculations.

Note:  As an alternative to performing this interactive run, you can perform the entire run by placing all the above commands in a file.  To do this you simply enter the command:
   gravlens <file>
at the command prompt. For example, the input file for this run would contain the following lines:
set gridlo1 = .0001
set gridhi1 = 5.0
startup 1 1
   ptmass 2.02 0 0 0 0 0 0 0 0 0
   0 0 0 0 0 0 0 0 0 0
findimg 1.01 0.00

< INTRODUCTION
SECTION II>