BOND VALENCE CALCULATOR Version 2.0, February 1993. Version 1.0 by Chris Hormillosa & Sean Healy Revisions and additions by Tamon Stephen Purpose: Calculator for assistance in studying bond valence and length. Requirements: IBM PC or clone with DOS. Files: VALENCE.TXT - This file VALENCE.EXE - The executable file. Source code VLNC.C - Principal source code. MISCHELP.C - Miscellaneous and Help routines. PBV.C - Permanent Bond Valence definitions. ATOMPAR.C - Atomic Parameters. All four C files are required for compilation. Contact I.D.Brown at idbrown@mcmaster.ca for details of source code Loading: Copy the file VALENCE.EXE to an appropriate directory and execute to run the program. Scope of the program: --------------------- VALENCE calculates the bond valence given the length of a particular bond, or the bond length given the valence. The calculations are stored and can be displayed. Selected bond valences or bond lengths in this display can be summed or averaged. The relationship between bond length (R) and bond valence (s) is: s = exp((Ro - R)/B) where Ro and B are bond valence parameters that depend on the two atoms forming the bond. The program supplies default parameters. It first consults a table of bond valence parameters, mostly taken from Brown and Altermatt (1985) Acta Cryst. B41 244-247. This table covers the most commonly encountered bonds, chiefly bonds to oxygen. If no value is found in this table, the program attempts to calculate parameters from a table of atomic properties (O'Keeffe and Brese (1991) J. Amer. Chem. Soc. 113, 3226-3229). *********CAUTION: The O'Keeffe and Brese parameters are only suitable as starting values and should not be used for accurate work. Unfortunately, the program does not tell you which set of parameters are being used, but this can be found using the 'Change' option (see below). If the program is unable to determine parameters by either method it sets the default for Ro = 0.001. *********CAUTION: If 0.001 appears as the default for Ro, it is not an appropriate value to use. Using the program: ------------------ Main Menu --------- This allows you to select a program function. elp This provides help for each of the menu items listed below alence The user is first prompted for two elements and their oxidation states. If an oxidation state of zero is entered, it will be replaced by oxidation states from the permanent bond table if the corresponding elements are found, otherwise, it will be left as zero. The program then searches for the best default parameters for that bond (see above). The user can either accept these, by pressing , or change them, by typing in a new value, and pressing . The bond length is then requested and the bond valence is displayed on the screen and stored for future retrieval using the isplay menu item. The program will then display an option to compute another valence. If this is declined, the program returns to the main menu. If it is accepted, the user is asked if the same bond type is to be used. If yes, then the program promtps for a new length, if no it prompts for new elements. The default in both cases is 'yes', allowing the user to enter a sequence of bonds between the same elements using . There is a maximum of 40 bond valence (or bond length) calculations allowed per session. If you try to create more, you will be given an error message and will not be able to calculate any further valences or lengths. Unwanted valence calculations can be deleted in isplay and this can free up room for further calculations. ength Similar to alence, except the valence is the input and the length is the output. The length and valence calculations are stored in same array and can be viewed together using isplay. isplay This displays all the length and valence calculations made during a session. The table displays the bond type, bond valence parameters used, and the length and valence for each bond entered. The arrow and page keys can be used to move the cursor onto any bond length or valence which can then be selected by typing a number, n, between 1 and 9. The sum and average of all selected values (multiplied by the appropriate value of n) are then shown at the bottom of the secreen. This feature is useful for calculating bond valence sums or average bond lengths. Selected values are marked with an asterix and the value of n. Bonds can be delselected by typing . Scrolling down allows values above and below the screen to be accessed. Selecting a line using (equivalent to typing 1) followed by 'd' will delete the bond from memory. o Calculation This allows the user to find the value of Ro that would give a valence sum equal to the atomic valence for a particular coordination environment. The bond type is selected as for the valence calculation described above, but all the bond lengths in the environment of the first-entered atom are typed in at the 'length' prompt section, each separated by . A final marks the end of the sequence of bonds and results in the calculation of Ro. A name can be given for each such calculation for storage in the Ro table. The user has the choice of either calculating another Ro or returning to the main menu. Up to forty Ro values can be stored, and these can be viewed by selecting the R display option from the main menu. R Display This functions in a similar manner to the isplay of valences and lengths. It shows all Ro calculations, and these values can be selected in order to calculate averages or to deleted items in the same way as in the menu. hange / View Local Bond table The program contains a table of Bond Valence Parameters and another table of Atomic Parameters which can be used to determine approximate bond valence parameters in cases where these are not given in the Bond Valence Parameter table (see Program Scope above). When a particular bond is entered in alence or ength, the default values for the bond valence parameters are taken from the Bond Valence Parameter table and copied to the Local Bond table. If no value is found, the program attempts to calculate a value using the parameters stored in the Atomic Parameter table. If this fails, it stores a value of 0.001 A in the Local Bond table. The hange menu item allows the user to explore the different default values that are available and to select the value to be used in the Local Bond table. This is the value that appears as the default in alence and ength. hange displays the Local Bond table. The user can scan through this table and select a bond with the cursor keys. Up to twenty bonds can be stored in this table, and unwanted bonds can be delete by selecting them and pressing 'd'. Deleting a bond from the local bond table will not delete the corresponding calculations in other tables, and vice-versa. Typing will bring up the "New Parameters" screen, which shows all the available valence parameters for this bond. It allows the user to change the default bond valence parameters for the selected bond type. The New Parameters screen shows the current default values, as well as Ro and B values from the Bond Valence Parameter table, the bond valence parameters calculated from the Atomic Bond table parameters, parameter defaults used during this session, individual Ros calculated in this session, the currently calculated Ro average (average of Ros selected in the Rdisplay screen), and a place for the user to enter new parameters. Scrolling to a row and pressing will select the value displayed as the new default. The most recent of previously used parameters, or calculated Ros, will be displayed initially, but the left and right keys can be used to retrieve and display other values. xit to DOS To exit the program. Any calculations not saved will be lost. Read and Write (ile) menu Moves to the... Read and Write Menu ------------------- This operates in the same manner as the main menu, with four different choices: ave .BVC file This will write all the user's calculations for a given session to a file on the disk. It asks you for the file name, and then adds the .BVC extension. You may add a directory path before the filename. Do not supply an extension. If you already have a file with the same name, it will be overwritten. oad .BVC file This will present you with a list of the .BVC files in the current directory, and the change directory option. Use load the desired file. will exit the screen without loading (a bit counter-intuitive, I'm afraid). A disk with more than around 18 .BVC files will likely make a big mess of the screen. Selecting the change directory option will let you type in any path and change to that directory. It can't, however, change the working drive, so if you are in C:\, type A:\VALENCE, it will change the operating directory of the A: drive to VALENCE, but will you will still be in C:\. ******CAUTION: The calculations you load will overwrite any that you had previously made during a session. Be sure to save anything valuable before loading in new calculations. ump List of Bond Valence Parameters This will create a file with contents of the Bond Valence Parameter table under a user selected filename in a form suitable for printing. This is useful if you want to review the defaults used by the program. uattro File The Quattro file option creates a file which can be read by the Quattro Pro (R) spreadsheet. It can contain either the length and valence calculations, or the Ro calculations, and this choice is presented to the user at the start of the Quattro procedure. It will then ask for a filename, including an optional extension. Suggested extensions are .WQ1 and .PRN, which Quattro tends to look for. Once you have saved this, it can be retrieved from Quattro by selecting, in order, Tools, Import, Comma and "" Delimited file, and finally the path and file name. Once saved by Quattro, the file can be accessed by Quattro in the normal way, but is no longer readable by other packages, such as line editors. Hit enter to return to the main menu from the read/write menu. General Notes ------------- Live Keys: ---------- Menu selections, <> and yes/no questions are received through "live keys", so hitting the key is not required. : ----------- Equivalent to "Hit any key to continue" Cursor Keys: ------------ For the valence/length display, the Ro display, the Local Bond table, the New parameter screen and Directories in the oad section, the up and down keys work in the normal way. The cursor left/right keys can move between the length and valence columns in the valence/length display, and move through stored values on the previously used parameters and individual calculated Ro's rows on the "New Parameters" screen. Page up and Down: ----------------- Should work in approximately the way you would expect in the valence/length and Ro displays. A bit awkward to program and superfluous, so bugs might occur in situations that I hadn't anticipated. If so, don't panic, use the cursor keys. The paging keys may move the computer through a different number of lines depending on the cursor position, but it should usually come in at about a page. , , d: -------------------- On the moving screens, has the effect of starting an action using the value next to the cursor (highlighting it, for example). usually means quit, except when entering values. When entering values, if a default is provided, accepts it unless a value is typed in before is hit. On the moving screens, often means delete. Program License: ---------------- This program, source code, and other files may be distributed as freeware. It must be distributed free of charge, and include all files listed at the top of this file. Changes to the source code are permitted, but must be documented. It is asked that you indicate your changes at the beginning of the source code. It would be appreciated if major changes are returned to Dr. I.D. Brown at McMaster University for use and distribution. The program is copyright 1991 by Chris Hormillosa & Sean Healy.