This readme file contains instructions for using the software associated with the book Advanced Kalman Filtering, Least-Squares, and Modeling, A Practical Handbook by B. P. Gibbs, ©2011 by John Wiley & Sons The software is included in a single zip file (Gibbs_Software_1_2.zip) located at web site ftp://ftp.wiley.com/public/sci_tech_med/least_squares/ The zip file includes most of the Fortran 90/95 software used for examples in the book and described in Chapter 13 (also on the web site). The various library subroutines/functions/modules are located in a "library" directory, and program drivers for the examples are located in "Chapter" directories using the same chapter numbering as the book (see dirf90.lis). Sample output from the example executables is also included in these chapter directories so that users may validate their installation of the software. Note: Some of the program drivers for the examples used in the book allow control of algorithm options by modification of an input text file. However, for many programs options were exercised by changing specific code statements and re-compiling. These code lines may be found by searching for the string "###". SOFTWARE STATUS - 3/6/2011 This version, release 1.2, includes most of the Fortran 90/95 software used for examples in the book. Version history: Version 1.1: Changes include modification of the argument calling order for subroutine sinv, and addition of the LS_COV program (least squares covariance analysis). Version 1.2: 1) Added MLE_parameterID.f90 - Maximum likelihood (ML) parameter identification program for a Kalman filter, 2) Added filter_smoother.f90 - general-purpose filter smoother using sparse matrix operations (for large sparse problems) 3) Modifed comments in the LS_COV.F90 program to indicate that measurement data will normally come from an external measurement file. WARNING: The comments included in the program drivers for some examples may be sparse or not entirely accurate. These comments will be improved in later releases. Since some drivers were created from fragments of other code, the comments may not reflect the program as used. This is more likely for code development that was accelerated to meet the book distribution date (e.g., LS-COV, MLE_parameterID, filter_smoother). If you notice errors in comments (or any errors) please send email to bgibbs00@ieee.org. INSTALLATION on a Windows PC 1) The zip file should be extracted to directory \KF_book\distribSWm\. If another directory is used, the directory names in ifort.cfg should be changed. The zip extraction should be performed with switches set so that subdirectories listed in the zip file are created during the extraction. That is, the extracted directory structure should appear as \KF_book\distribSWm\Chapter5\cheby-four \polyInv \timing Chapter6\Imag \subOptPoly Chapter7\constrPoly \fallball \nonlOpt \passiveTrk . . . Chapter13 library 2) If using the LAPACK libraries (required for some examples), the build instructions assume that the files lapack_WIN32.lib and blas_WIN32.lib are located in directory \library\lapack-3.1.1\. If using a different LAPACK version or different directory, the build instructions should be modified accordingly. 3) Directory \KF_book\distribSWm\ contains files setCfg.bat and ifort.cfg. If using the Intel Fortran compiler from the command line, create a command "Build Environment" window using the link provided with the Intel Fortran compiler. This sets various environment variables required for the build. Then run setCfg.bat from the command window. This will re-direct the compiler to use compiler switches set in the local ifort.cfg file -- the included ifort.cfg file sets /check:bounds (for array bound checking), but that can be removed for faster execution Note that ifort.cfg sets the compiler to use module definition and library files located in \KF_book\distribSWm\library\. This can be changed if another directory structure is used. The four lines in ifort.cfg containing references to "Microsoft Visual C++* .NET 7.1" should be deleted if using recent versions of the compiler. The setCfg.bat file also sets switches used by the Compaq Fortran compiler, but this compiler is no longer available so the "set df=" line can be deleted if this compiler is not used. 4) Before the example programs can be linked, the library file libkf_bnd_ifort.lib must be created in directory \kf_book\distribSWm\library\ (as set by ifort.cfg). From a command "build" window, enter "cd \kf_book\distribSWm\library\" to set the default directory. Then enter: ifort filterPrec.f90 /c ifort filterMod.f90 /c ifort *.f90 /c (Text commands can be copied into the paste buffer using an editor, and then entered into the command window using the Edit->Paste option of the command window.) This will compile all the Fortran files in the directory. Modules filterPrec and filterMod must be compiled first because they are used by other modules. Then enter lib /out:libkf_bnd_ifort.lib *.obj to create the library. Notice that array checking has been enabled by the compiler switches set in ifort.cfg, so it may be desirable to re-compile some files without array checking when timing program execution (array checking can significantly increase run time). It may also be useful to create another library (libkf_ifort.lib) without any array bound checking. 5) To build a specific example program, CD to the desired directory (e.g., cd \Chapter5\cheby-four) and enter the build command line as listed in comments in the main program. For example, enter ifort tst_chebv.f90 tst_chebv >tsti_cheb.plt to build and run the tst_chebv program. The program output is directed to file tsti_cheb.plt, which uses a format that can be directly plotted using Tecplot and some other plotting software. Also note that some build comments include a specific reference to library ..\..\library\libkf_bnd_ifort.lib. This was done during development because different libraries were sometimes used. However this should be unnecessary if the default library is set from ifort.cfg.