MODELFIT Program MODELFIT is an interactive program for fitting a model to VLBI data (in the u,v-plane) by non-linear least-squares. Data files with either MERGE-format 1 or 2 are accepted. To run the program type the command MODELFIT (defined in the VLB:LOGIN.COM file). It will ask various questions (see notes below): 1. Input data file? 2. Underlying model? (see below) 3. Input model file? 4. Model acceptable? (if not, you can edit model) 5. Parameters to VARY for each component (0-6 integers) 6. Do a gradient fit? 7. Do a brute force fit? 8. Try again? (if yes, goes to question 2) The program is limited to a maximum of 15 stations, 200 data records, and 20 model components. You can vary as many model parameters as you wish. Discussion: Most questions about how to run this program can be answered when you actually run the program; what follows are a few hints. To speed up the program, average your data as much as you can using AVERAGE, creating a temporary file. If you wish to avoid fitting some data, use VLBEDIT to create a temporary file. MERGE can be used to delete one or more stations. Note that such editing or averaging is a one way process, so be sure to save your original file! The gradient fit is a fit where the gradient of the agreement factor (AF; for a definition, see QFIT) is found, then all variable parameters are changed at once to move a little ways along the gradient towards a minimum in the AF. It seems to be the method of choice when you are a long ways from any local minimum in the AF. The brute force fit minimizes the AF for each parameter, one at a time. It works well if you are within striking distance of a minimum in the AF. If you wish to halt iteration, type a single control-C; the program will then stop at the next reasonable chance and preserve the current model. In addition, if you are running interactively, the program will ask you if you want to continue iterating when approaching a local minimum. MODELFIT Page 2 Underlying model: It is possible to in effect subtract a model from your data and fit the remainder. This is useful in at least two cases. First, if you have a hybrid map which fails to fit the shortest baselines, this program will allow you to modelfit a few components for the largest structure while using the inner part of your hybrid map for the smallest structure. Second, if you wish to measure the size of, say, the core in your map, you may subtract the core from your map and the modelfit with a single component. This is much better than counting contours from a plot! Model files are text files that can be typed or printed directly; they can be modified or created using the standard text editors. A model file consists of one line for each component of the model, with up to 7 numbers on each line (in free format): 1. Component flux density (Jy) 2. Distance of center of component from origin (milliarcsec), "radius" 3. Position angle of center of component with respect to the origin (degrees, North through East), "theta" 4. Major axis of component (milliarcsec), "axis" 5. Axial ratio (minor/major, i.e. < 1), "ratio" 6. Position angle of major axis (degrees, North through East), "phi" 7. Type: 0 or 1: elliptical Gaussian (major axis is FWHM) or delta-function (major axis = 0) 2: uniform elliptical disk (major axis is diameter) 3: optically thin spheroid or tapered disk (major axis is diameter) 4: elliptical ring (major axis is diameter) 5: line (major axis is length) For Gaussians and delta-functions, the Type can be omitted; for delta-functions, the major-axis, axial-ratio, position- angle and type can be omitted. (Not all the programs understand types 2-5.) The "origin" is an arbitrary phase-reference point. The maximum number of components varies from 600 to 10000, depending on the individual program. History Version 1: 1981 Jul 28 (Richard S. Simon). Version 7.0 1983 July 7: Extend to include MERGE-format 2 files and orbiting VLBI stations; increase to 15 stations (D.L. Meier). Version 8: 1985 Feb 7 [TJP] Fix bug found by VMS4.0: attempting to MODELFIT Page 3 read SYS$OUTPUT. Version 9: 1988 Apr 18 [TJP] Convex version. Version 10: 1989 Mar 29 [TJP] Improved performance (vectorized). Version 11: 1990 Nov 5 [TJP] Fix serious bug: it would give the wrong answer on files containing an incomplete set of baselines or triangles.