Академический Документы
Профессиональный Документы
Культура Документы
Liability Disclaimer
Micromath and Scientist are registered trademarks of Micromath. 2006 Micromath Micromath reserves the right to change the specifications, functions, or features, at any time, without notice. Micromath has prepared this document for the exclusive use of its employees and customers. The information contained herein is the property of Micromath and shall not be reproduced without prior written approval from Micromath. Printed in the USA.
MS-DOS, Microsoft, Windows, Windows 2000, and Windows XP are registered trademarks of Microsoft Corporation. All other brand or product names mentioned may be trademarks, service marks, or registered trademarks of their respective owners.
Contents
Introduction 1-1
About Scientist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 What's New In Scientist 3.0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2 Using This Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
Document Conventions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
Feedback. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
2-1
Contents
ii
Understanding Scientist
3-1
Using Scientist
4-1
5-1
About Spreadsheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1 Manual Entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 Importing Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 Charting Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4
Quick Chart Command from the Spreadsheet Interface . . . . . . . . . . . . . . . . . . 5-4
Contents
iii
Quick Chart Command from the Variable and Parameter Interface . . . . . . . . . 5-5 Chart Properties Dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
Creating a Model
6-1
7-1
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1 Performing a Least Square Fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2 Simplex Fitting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5
Performing a Simulation
8-1
Calculating Statistics
9-1
iv
Contents
Figures
Figure
2-1 2-2 2-3 2-4 2-5 4-1 5-1 5-2 5-3 5-4 5-5 5-6 5-7 6-1 7-1 7-2 7-3 7-4 7-5 7-6 7-7 8-1 8-2 8-3 8-4 9-1 9-2 9-3
Title
Page
2-3 2-3 2-4 2-4 2-5 4-1 5-1 5-3 5-3 5-4 5-5 5-6 5-7 6-2 7-2 7-3 7-4 7-5 7-6 7-7 7-7 8-2 8-2 8-3 8-4 9-2 9-2 9-3
Welcome . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . License Agreement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Choose Installation Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Choose Start Menu Folder. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Installation Complete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Scientist 3.0 Main Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Spreadsheet Window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Import Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Import Data - Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Spreadsheet with Imported Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Quick Chart Command from the Spreadsheet Interface . . . . . . . . . . . . . Quick Chart from the Variable and Parameter Interface . . . . . . . . . . . . . Chart Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Scientist Default Model File Template . . . . . . . . . . . . . . . . . . . . . . . . . . . Least Square Fit 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Least Square Fit 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Least Square Fit 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Least Square Fit 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simplex Fit 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simplex Fit 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simplex Fit 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simulation 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simulation 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simulation 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simulation 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Calculating Statistics 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Calculating Statistics 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Calculating Statistics 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vi
Figures
vii
Tables
Table
1-1 2-1 4-1 4-2
Title
Page
1-3 2-1 4-2 4-3
viii
Tables
1-1
1
Introduction
The Scientist 3.0 Getting Started Guide provides a brief overview of Scientist and provides step-by-step instructions for the most commonly used procedures. The following topics are included in this chapter: Chapter Topics About Scientist What's New In Scientist 3.0 Using This Guide Terms and Nomenclature Using Scientist Help Scientist Technical Support Feedback
About Scientist
Scientist is a comprehensive modeling, data analysis, curve fitting (regression), and graphing application for scientists and engineers. Scientist can fit data to almost any model, including many that are difficult or impossible with other scientific analysis software. Scientist models can consist of: Non-linear algebraic equations Differential equations Laplace transforms Implicit equations Multivariate equations Combinations or systems of the above Scientist was developed on the belief that researchers should not have to learn complex programming languages or syntax to model systems and analyze data. Scientist was designed to perform regression analysis without programming. With Scientist you create models by simply entering equations much like you would with a pencil and paper. Just provide Scientist with your data and reasonable initial estimates for your parameter (coefficient) values and let Scientist's powerful regression algorithms calculate the best fit values for your model. Scientist lets you focus on science, not software.
1-2
Introduction
After fitting your data, Scientist gives a complete statistical analysis of your results. Scientist provides descriptive statistics and parameter statistics, including parameter estimates, confidence limits, various measures of goodness-to-fit, variance-covariance and correlation information, and analysis of residuals.
Introduction
1-3
Support With the release of Scientist version 3.0, Micromath has expanded its technical support. In addition to telephone and e-mail support, users of Scientist 3.0 can report and track bugs or make suggestions on Micromath's web site. Licensed users can also download service releases from the web site as they become available.
Document Conventions
This guide uses the following document conventions, listed in Table 1-1:
Table 1-1 Document Conventions
It means
Field names
Example
Enter an amount in the Minimum Step Size field. Click OK. Select the font from the Font drop down list. From the File menu, choose Close All. From the Spreadsheet window, select File > Import. Click OK to save and close the Configuration dialog box. Select Edit > Modify. Press CTRL+S to save your changes. Click OK to save your changes.
Boldfaced
Capitalized
Click the right mouse button Right-click and select Merge Cells from the shortcut menu.
1-4
Introduction
Parameters
Coefficients. Values that are allowed to vary during the regression analysis to produce the best fit.
Introduction
1-5
Select Contents from the Help menu in any of the Scientist windows.
Scientist Help topics are grouped according to function and content in three tabs: Contents, Index, and Search.
Contents Tab
The Contents tab is intended to be used as an online Table of Contents. Click a Closed Book icon to display all the help topics contained within the book. Click an Open Book icon to close the book and all of its help topics. Click a Help Topic icon to display the specific help topic window related to the icon.
Index Tab
The Index tab enables you to search for a help topic by using a keyword.
Search Tab
The Search tab enables you to perform a full-text search for Help topics.
1-6
Introduction
E-mail Support
Users may e-mail questions to our technical support team at support@Micromath.com. If you have a question about a particular calculation, please attach the relevant file(s) to your e-mail so our technical support team can attempt to reproduce your result. All e-mail inquiries will receive a response within two business days.
Feedback
We hope you will like Scientist 3.0. We welcome and appreciate your comments, suggestions, and complaints. We value your feedback and believe that feedback from our users is the best way to improve our products. You can provide feedback by E-mail to feedback@micromath.com or by telephone at 1.800.942.6284. You may also report and track bugs on our web site. If you are reporting a bug, please include the model file, data file, and relevant parameter data with your report so we can attempt to reproduce and correct the error.
2-1
2
Requirements and Installation
This chapter describes the requirements and the steps necessary to install, uninstall, and upgrade Scientist. The following topics are included in this chapter: Chapter Topics System Requirements Installing Scientist Uninstalling Scientist
System Requirements
The following are the system requirements for Scientist.
Table 2-1 System Requirements
Component
Requirement
Micromath recommends running Scientist on Microsoft Windows XP Microsoft Windows 98 or higher (includes Windows ME) Microsoft Windows NT 4.0 or higher (includes Windows 2000) Scientist is not available for the Macintosh (Linux) at this time. 133 MHz or higher speed Pentium-compatible processor 64 MB (Megabytes) or more of RAM 100 MB or more of available disk space SVGA or better
Operating System
2-2
Installing Scientist
There are four steps to installing Scientist 3.0: 1. Create your Micromath Account 2. Download and Install the Scientist Trial Software 3. Register the Software and Create License Key 4. Unlock the Scientist Software
If you have already downloaded a trial version of Scientist 3.0, you can skip directly to Register the Software and Create License Key.
NOTE
Go to www.micromath.com. Click Create an Account. Complete the account registration form and click Create Account. You should receive a message asking you to follow the link in the registration E-mail sent to you. Follow the link in your registration E-mail and log in to validate your E-mail address and activate your account. You will be directed to the My Micromath page.
Step 4
Log in (if you are not already logged in to the Micromath web site). Click My Downloads. Click the appropriate link to download the Scientist trial version. (Optional) Move the setup file (SetupScientist30.exe) to the computer on which you wish to install Scientist.
IMPORTANT
Be sure to close all Windows programs and disable any virus protection applications before beginning the Scientist Setup program. Depending on your PCs configuration, the computer may need to restart after the installation completes. The Windows Installer performs this action automatically at the end of the installation process. Step 5
Click Run in the Download Complete dialog or double-click the SetupScientist30.exe file. The Welcome dialog displays (Figure 2-1).
2-3
Step 6
Step 7
After reviewing the License Agreement, click I Agree. The Choose Installation Location dialog displays (Figure 2-3).
2-4
Step 8
Specify the location where you want to install Scientist and click Next. The Choose Start Menu Folder dialog displays (Figure 2-4).
Step 9
Specify the Start Menu folder in which you would like to create the related Scientist shortcuts and click Install. Scientist 3.0 Read Me file displays.
Step 10 As the Setup program finishes installing Scientist on your computer, the
The Read Me file contains the latest information about Scientist from Micromath. Please take time to review this document.
NOTE
Step 11
When installation is complete, the Installation Complete dialog displays (Figure 2-5).
2-5
Start the Scientist program. A dialog with three separate boxes displays. Choose OK. When the program is starting up, a splash screen displays with information about the program, including your hardware fingerprint. You will need your hardware fingerprint to obtain your license key. You can also obtain the hardware fingerprint by selecting Help > About from the Scientist main interface. Log in (if you are not already logged in to the Micromath web site). Go to the My Micromath page on the site. Select My Product Licenses. You should see the product and type of license you purchased on this page. Select Generate a New Key next to the appropriate product. Enter the name of the user to whom the software will be registered. Enter the hardware fingerprint exactly as it appears in your product.
2-6
Step 8 Step 9
Select the appropriate description of the computer on which the product is installed. Select Generate Key. You will receive an E-mail containing your license key.
Start the Scientist program. A dialog with three separate boxes displays. Choose Enter Key. Enter the registration name and license key exactly as they appear in the E-mail you received from Micromath. The license key should validate, and you can now use the product in accordance with the terms of your license.
Uninstalling Scientist
You can remove the Scientist program from your computer using the Add/Remove Programs control panel. There are differences in the control panels location between Microsoft Windows versions, so consult your computers online help for specific instructions. To remove the Scientist application, do the following:
Step 1 Step 2 Step 3 Step 4 Step 5
Locate the Add/Remove Programs control panel. Double-click the Add/Remove Programs icon. The Add/Remove Programs Properties window displays. Select Scientist from the list of programs and click the Add/Remove button. When asked to verify that you want to uninstall Scientist, click Yes to begin the uninstall. Click the OK button. The uninstall is now complete.
3-1
3
Understanding Scientist
The following topics are included in this chapter: Chapter Topics Overview What Does Scientist Do? Components and File Types
Overview
Scientist is designed to provide a comprehensive solution to the problem of fitting experimental data to mathematical models. It is capable of solving systems of model equations that can include nonlinear equations, ordinary differential equations, and Laplace transforms. Scientist is an application for researchers who "know what's going on" with their data and need to establish solid parameter values to model real-world phenomena. The easy-to-use interface in Scientist greatly facilitates model entry and manipulation, data management, and control of initial estimates and constraints on parameter values, as well as statistics and graphics output. The interactive nature of Scientist leads to a higher likelihood of finding optimal parameter values than if fitting were done in batch mode without the ability to examine and react to computational results. It also enables users to develop a much greater awareness of the sensitivity of models to parameter values. This program allows users to develop and fit complicated models using nonlinear, differential, and Laplace transform equations.
3-2
Understanding Scientist
Scientist solves systems of equations, differential equations, and equations expressed in terms of Laplace transforms. Scientist can perform nonlinear regression on models expressed in terms of systems of equations, differential equations, or even models expressed as Laplace transforms. Of course, in order to perform this type of analysis, Scientist must first find solution(s) to the equations. Scientist has powerful algorithms and finds analytic solutions where they exist and numeric solutions when analytical solutions are not possible. There are many applications that will perform either of these functions, but few, if any, will perform both simultaneously and achieve results comparable to those achieved with Scientist.
Types of Problems
Scientist accommodates models from all disciplines and is being used in many teaching and research areas including Physical, Organic, Analytical and Pharmaceutical Chemistry, Health Physics, Heat Transfer and Diffusion, Social Sciences, Econometrics, Biotechnology, Physics, Mechanical Engineering, Applied Mathematics, and many others. Models can consist of single functions defined by several lines of code, multiple functions that may be fit simultaneously, implicit equations or systems of equations, parametric equations (i.e., X and Y both defined in terms of a third variable, say S), equations involving integration or differentiation operators, equations that include Laplace transforms, and equations involving ordinary differential equations.
Model Entry
Models may be entered in Scientist either from the keyboard at runtime, simply by typing in the relevant equations, or they may be read from files. Users may develop their own libraries of models by saving them in text files at the time they are originally developed; a given model needs to be entered only once. Since models are compiled inside the program, there is no need for separate compilation or linking. Furthermore, errors are flagged during compilation and can be corrected immediately in the Scientist editor, without having to restart the entire job. A model template is provided for typing in equations so that the user needs only to fill in those portions of the model file that differ from his or her set of equations.
Data Entry
Data may be entered into Scientist or read from a file. Acceptable data formats include ASCII, Excel, XML, and Scientist's own spreadsheet files. Data can be exported from Scientist in a number of formats including ASCII, Excel, HTML, and XML. Scientist can simultaneously handle numerous data sets for comparison or fitting.
Understanding Scientist
3-3
Parameter Entry
Initial estimates of parameter values are required by the program for use in function evaluation during simulation or as starting values for least squares minimization. Parameter entry is accomplished from the Variable and Parameter Interface. Parameter values may be entered or read from a file. Depending on the difficulty or complexity of the least squares problem being attempted, good initial estimates may be very important in finding an optimal solution.
Minimization Algorithms
By default, Scientist employs a least squares minimization procedure based on a modification of Powell's algorithm. This algorithm is many times faster than the more common microcomputer algorithms based on sequential searches involving one parameter at a time. The algorithm is a hybrid that combines the reliability of a steep descent method with the speed (near convergence) of the Gauss-Newton method. At the user's option, the steepest descent or Levenberg-Marquardt minimization algorithms can be used. A nonlinear simplex algorithm may also be selected for searching through the parameter space for the general location of a minimum, i.e., improving parameter estimates prior to least squares minimization.
3-4
Understanding Scientist
Statistics Output
Scientist provides a broad range of statistics output, including parameter estimates, confidence limits, various measures of goodnessof-fit, variance-covariance and correlation information, and analysis of residuals. Confidence limits for parameter estimates are calculated using the customary approach involving a local linearization of the model, or optionally they may be calculated using a more rigorous approach that locates various points on constant sum of squares contours.
Graphic Output
Scientist is capable of producing publication-quality graphic output when interfaced with appropriate output devices. Graphic information in Scientist is represented as vectors, rather than pixels, so resolution on the screen and on hardcopy output is limited only by the output device.
Understanding Scientist
3-5
Models
Models are the components used by the Scientist compiler to define a mathematical model. Models consist of independent variables, dependent variables, parameters, equations, and constraints.
Spreadsheets
Spreadsheets are used by Scientist to store and manipulate data. The spreadsheet can be used to sort, filter, sieve, auto type (create), and transform data.
Charts
Charts are used to present data and analysis in graphical format. Scientist supports over 50 different types of charts.
3-6
Understanding Scientist
Statistics Reports
Scientist provides a broad range of statistical output, including parameter estimates, confidence limits, various measures of goodnessto-fit, variance-covariance and correlation information, and analysis of residuals. Confidence limits for parameter estimates are calculated using the customary approach involving a local linearization of the model or a more rigorous approach that locates various points on constant sum of squares contours. From the Scientist interface, you can select or deselect the display of descriptive statistics, confidence intervals, the variance/covariance matrix, the correlation matrix, goodness-of-fit statistics, and rigorous calculation of confidence intervals. The confidence interval level can also be adjusted between 0% and 100% non-inclusive.
4-1
4
Using Scientist
The following topics are included in this chapter: Chapter Topics Starting Scientist About the Scientist Main Screen
Starting Scientist
To start Scientist, do the following:
Step
From the Windows desktop, select Start > Programs > Micromath > Scientist 3.0. The Scientist main screen displays (Figure 4-1).
4-2
Using Scientist
Scientist Menus
The Menu Bar in the Scientist screen (Figure 4-1) contains the available menus. The Menu Bar is dockable, allowing you to specify where it appears in the Scientist screen. Table 4-1 describes the menus in Scientist.
Table 4-1 Scientist Menus
Menu
Action
Create a new project, model, spreadsheet, or chart. Open files or reopen recently used files. Access examples and predefined models.
File
Close an open screen. Import data. Configure the printer setup. Exit Scientist. Configure the layout of the screen. Change the theme used by the Scientist application. Access tool options. Specify the window display options. Access the Help system. View the software version and copyright information. Visit the Micromath home page.
Using Scientist
4-3
Toolbar
The Toolbar in the Scientist screen provides quick access to some of the more common functions. Table 4-2 below describes the toolbar.
Table 4-2 Scientist Toolbar
Toolbar Icon
Create a new project.
Action
Save a project.
4-4
Using Scientist
5-1
5
Working with Data
The following topics are included in this chapter: Chapter Topics About Spreadsheets Manual Entry Importing Data Charting Data
About Spreadsheets
Spreadsheet windows are where data are entered and manipulated, and where calculated results are displayed (Figure 5-1).
Figure 5-1 Spreadsheet Window
There is always one active cell in the Spreadsheet window (indicated by highlighting). You can move this selection by clicking on the desired cell with the mouse or by using the arrow keys. Clicking on the column or row headers or moving the selection to these cells with the arrow keys causes the entire column or row to become selected. The column name can be changed when the column header is selected.
To change the name of a column, double-click the column header, make any necessary changes, and then press Tab.
NOTE
5-2
A block of cells in the spreadsheet can be selected by clicking on a cell with the mouse and holding the mouse button down while dragging the mouse cursor to expand the block. Blocks of cells can also be selected with the keyboard by holding down the Shift key while using the arrow keys to expand the block. To move down a page in the Spreadsheet window, press Page Down. To move up a page, press Page Up. To move to the bottom or top of the spreadsheet, press Ctrl+Page Down or Ctrl+Page Up, respectively. To reach the left side of the spreadsheet, press Home. To reach the right side, press the End. To move a page to the right or left, press Ctrl+End or Ctrl+Home, respectively. To overwrite the value in the currently selected cell, simply type in the number that you wish to use to replace it and press Enter.
Manual Entry
You can enter data in a spreadsheet manually using the commands described above.
To change the name of a column, double-click the column header, make any necessary changes, and then press Tab.
NOTE
Importing Data
You can import data into a Scientist spreadsheet from a number of data sources. Data can be imported from Microsoft Excel spreadsheets, Access databases, delimited (CSV) files , XML files, SQL databases, and more. In this example we will import data from an Excel spreadsheet located in the Examples folder in the Scientist installation directory. To import data into a Scientist spreadsheet, do the following:
Step 1
Select File > Import. The Import Data dialog displays (Figure 5-2).
5-3
Step 2
Select the appropriate format of the file you want to import. Figure 5-3 shows the Excel format selected.
Step 3
In the File to Import field, enter the path for the file you want to import or click the button to the right of the field to navigate and select the file you want. Use the Sheet Name drop down to select the appropriate sheet within the file you selected. Use the Options check boxes to specify the options you want. Click Import. The data is imported into a Scientist spreadsheet with the appropriate column names. (Figure 5-4).
5-4
Charting Data
Scientist makes it easy to chart your data. You can use the Quick Chart command from either the Spreadsheet or Variable and Parameter interfaces and then use the Chart Properties dialog to manipulate the chart.
Open a spreadsheet with data in it. Select Data > Chart. You can also use the Chart button on the toolbar. Scientist quickly charts the values in columns A, B ,and C against the values in the column labeled TIME (Figure 5-5).
5-5
The quick chart function assumes that the independent variable data is in the leftmost column and that the columns to the right are dependent variables.
NOTE
While on the Variable and Parameter window, select the Quick Chart function button. Figure 5-6 shows results of a Least Squares Fit calculation from the Variable and Parameter interface.
5-6
Figure 5-6 Quick Chart from the Variable and Parameter Interface
The quick chart function assumes that the independent variable data is in the leftmost column and that the columns to the right are dependent variables.
NOTE
Open a chart. Select Edit > Properties from the Chart menu. The Chart Properties dialog displays (Figure 5-7).
5-7
Step 3 Step 4
5-8
6-1
6
Creating a Model
The following topics are included in this chapter: Chapter Topics Overview Create a Model Model Format
Overview
Models are the primary means for entering equations into Scientist. Text entered into a Scientist Model is compiled by the Scientist compiler then used to perform calculations. It is not necessary to learn complex programming syntax or constructs to create a Scientist model. The Scientist model format is straightforward. If you can write the equations that describe your system with a pencil and paper, you can create a model that will perform the desired calculations.
Create a Model
To create a new Scientist model, do the following:
Step
Select File > New > Model from the main menu. The Scientist Default Model File Template displays (Figure 6-1).
6-2
Creating a Model
The default model file begins with a comment line identifying the file as a Scientist Model file. The model defines T as the independent variable and X, Y and Z as the independent variables. The file also defines KA, KB and KC as parameters. You can now edit the file to create a Scientist Model that describes the system you wish to model.
The default model file does not contain Laplace Variables, Constraints, or Implicit Equations.
NOTE
Model Format
Model files must be in a format that can be parsed by the Scientist compiler. In general, the format is (in order) Independent Variables, Laplace Variables, Dependent Variables, Parameters, Equations, Initial Conditions and Parameter Values, and Constraints.
Creating a Model
6-3
Comments
Comments can be added to an equation file by preceding the comment line with two slashes, //. For example:
//This is a comment line; the text //here is not read by the equation //compiler.
Comments must be placed on a separate line from equations and other required elements.
Independent Variables
Independent variables are those variables in a set of equations that are not constant and do not depend on any of the other variables. They are used to determine the range of calculations. The declaration of independent variables is preceded by the key word 'IndVars:'. The : (colon) symbol is important here. For example:
IndVars: T, X
This example declares T and X to be independent variables, probably for a calculation that has both time and space dependence (as is often the case in diffusion problems). Independent variable names may be separated by commas, spaces, or both. The independent variable declaration in an equation file must be the first line that is not a comment line.
Laplace Variables
Laplace variables are the variables in the Laplace domain that are equivalent to the time variable in the normal equation domain. They are declared separately from the independent variables so that the model parser can recognize Laplace domain equations and work with them appropriately. The declaration of Laplace variables is preceded by the key word 'LaplaceVars:'. As in the case of the independent variable declaration, the colon is required. Example:
LaplaceVars: S
In this example, S is the typical name for the Laplace variable. More than one Laplace variable can be defined to allow several Laplace transform equations to be separately inverted. The Laplace variable declaration must be entered immediately below the independent variables declaration and immediately prior to the dependent variables
Scientist 3.0 Getting Started Guide - Version 1
6-4
Creating a Model
declaration. The Laplace variables declaration can be omitted for equation sets that do not include the inversion of Laplace transforms.
Dependent Variables
Dependent variables are the unknowns that can be calculated from independent variables, parameters, constants, intermediate variables, or other dependent variables. Only those variables for which you want to see calculated values should be entered in the dependent variables declaration. All other derived variables can be entered in the equations section and handled as intermediate variables. The names of the dependent variables to be declared are preceded by the key word 'DepVars:'. The variable names may be separated by commas or spaces. Example:
DepVars: Y, Z
Y is the dependent variable and W is an intermediate variable. Intermediate variables do not need to be declared; Scientist will detect them while parsing the equations with the built-in parser-compiler. The dependent variable declaration line should immediately follow the Laplace variables declaration, or the independent variables declaration if Laplace transforms are not being used.
Parameters
Parameters are those variables whose values are to be changed during least squares fitting, or those that are to be held constant for fitting of a single data set, but varied between sets of data. Parameter names are preceded by the key word 'Params:'. Example:
Params: B, R, G
Any values that are to be held constant at all times can be entered in intermediate variable equations. The parameter declaration line should immediately follow the dependent variable declaration line.
Creating a Model
6-5
Equations
Equations can be entered on the lines following the parameter definition line. Each equation starts on a new line. For differential equations, the ' symbol (single apostrophe) is used to indicate the derivative of a variable. The derivative of y would therefore be entered as y'. The operators that can be used to make up an equation are described in other entries.
Equations that depend on constants, dependent variables, or intermediate variables should be entered below the equations defining those variables.
NOTE
The model parser processes the equations from the top of the model to the bottom and therefore can only properly define equations when all of their defining variables have previously been assigned. The only exception to this rule is systems of mutually dependent differential equations, which can be listed in any order. Complex quantities can be entered in the equations section by enclosing two variables or expressions in square brackets separated by a comma. For example,
Y = [0, 1] Z = [A, B*C] Q = [1.5, PHASE]
all define complex quantities. These complex quantities can be used with any of the built-in functions and in combination with real numbers. The only limitation is that independent variables, dependent variables, and parameters must be real numbers. You can use the above procedure to convert two real numbers to a complex number. The RE and IM functions described below can be used to convert a complex quantity into its real and imaginary parts, respectively, for output.
6-6
Creating a Model
These values will be used as the initial conditions for the solution of differential equations if the variables for which the values are given are defined by a differential equation or as the initial values for parameters when performing simulation or fitting. Variables that are not parameters or are not defined by differential equations should not be assigned initial values since the model parser may hold that variable fixed at the specified value. Initial conditions must be defined below the differential equations to which they apply.
Constraints
Constraints on values may also be entered in a Scientist model. Constraints are entered using the '<' symbol. Example:
0.0<A<10.0 X<5.0 3.0<Y 1 < Z < 2
The manner in which constraints are used depends upon which type of variable is being constrained. If the variable is independent variable, the limits represent the lower and upper bounds over which the parameter can vary during fitting. If the variable is an independent variable, the limits represent the range over which simulation will be performed by default if observed data is not used to determine the calculation points. If the variable is defined by an implicit equation, the limits represent the range over which Scientist can search for a solution to the implicit equation. Unassigned limits are presumed to be -infinity for lower limits and +infinity for upper limits.
Creating a Model
6-7
The following is a sample of a complete Scientist model file that includes differential equations, parameter values and constraints, and initial conditions for the differential equations:
// Scientist Model Equation File Independent Variable: T Dependent Variables: A, B, C Parameters: A0, KAB, KBC A'=-KAB*A B'=KAB*A-KBC*B C'=KBC*B // Parameter values and constraints A0=0.30 KAB=0.03 KBC=0.04 0.0 < A0 < 100.0 0.0 < KAB < 10.0 0.0 < KBC < 10.0 // Initial conditions t=0.0 A=A0 B=0 C=0
6-8
Creating a Model
7-1
7
Performing a Least Square Fit (Regression)
The following topics are included in this chapter: Chapter Topics Overview Performing a Least Square Fit Simplex Fitting
Overview
By default, least squares fitting is performed using a modified Powell algorithm to find a local minimum, or possibly the global minimum, of the sum of squared deviations between observed data and model calculations. It is generally obvious from watching the performance of this algorithm whether convergence has been achieved. Failure is usually a consequence of the initial parameter estimates being so far removed from the solution that Scientist cannot determine which direction to search. The usual behavior is that the algorithm takes anywhere from a few to several dozen iterations in converging to the solution. At the present time, the minimization algorithm is tuned to indicate convergence after it detects an unchanging sum of squares value and a subsequent attempt at restarting iteration also indicates convergence. For this reason, Scientist will frequently take 5 to 10 iterations near the solution in the process of ascertaining convergence.
7-2
In order to fit data to a model you will need to open both the data and the model in Scientist. Open the model file containing the appropriate model or create a new model. Create a new spreadsheet and enter your experimental data, import existing data from another file, or open an existing Scientist spreadsheet. In the example below, we will use the model and data files from the Simple Linear Equation example found in the Models > Examples folder of the Scientist installation directory. We begin with the spreadsheet and the model open as shown in Figure 7-1.
Step 2
To begin the fitting process, open a Variable and Parameter Set. If you created a parameter set with a previous version of Scientist you could simply open it from the File menu in the model interface, but it is just as easy to create a new Variable and Parameter set. Select the model interface and choose File > New Parameter Set from the menu. A new Variable and Parameter set opens in a new tab in the model interface (Figure 7-2).
7-3
NOTE
Notice in the Input Information section, the Simple Linear Model spreadsheet is selected because it was the only spreadsheet open when the Variable and Parameter set was created. In addition, the Parameters and Independent Variable sections of the new Variable and Parameter set have been populated with the parameters and dependent variables defined in the Simple Linear Equation model. Step 3
To perform a least squares fit, you need to input initial values for the parameters and determine which parameters will be allowed to vary during the fit. In this example we allow all of the parameters to vary during the fit and enter initial estimates of 1 for each of the parameters (Figure 7-3).
7-4
Step 4
You now need to determine which dependent variables will be used during the fit. Scientist uses all the dependent variables by default and we will do the same in this example. Select Calculate > Least Squares Fit or press F7. Scientist displays the estimated values for the parameters in a new Variable and Parameters set tab in the model interface (Figure 7-4).
Step 5
7-5
In addition, Scientist places the calculated values for the dependent variables in the spreadsheet.
NOTE
Simplex Fitting
The simplex method offers a different algorithm for fitting nonlinear equations to data. Since the convergence of this algorithm is slow when it nears the solution, only a fixed number of iterations (depending on the number of parameters being fit) is performed. It is expected that this procedure will be used only when intuition and analysis fail to find satisfactory initial estimates for the least squares minimization. Since a fixed number of iterations is used, this procedure can be repeated if it appears to be useful for a given problem. To perform a Simplex Fit, do the following:
Step 1
Open the model and the spreadsheet containing the data to be fit in Scientist. In this example we will used the Simple Linear Equation example found in the Models > Examples folder in the Scientist installation directory (Figure 7-5).
7-6
Step 2
Open a new Variable and Parameter set and enter initial estimates for the parameters (Figure 7-6).
7-7
Step 3 Step 4
Confirm all the dependent variables are selected for fitting. Select Calculate > Simplex Fit in the Variable and Parameter Interface. Scientist outputs the calculated parameter values in a new Variable and Parameter set in a new tab in the model interface (Figure 7-7).
7-8
NOTE
Notice these values are different from those obtained when the same model and data were fit using a Least Squares Fit calculation. This is because the Simplex Fit calculation runs for a specified number of iterations regardless of the result of the calculation. The simplex method can never diverge, but converges slowly near a minimum; thus, when a Simplex Fit is run, Scientist computes a fixed number of iterations, with no attempt to assess convergence. Successive Simplex Fit calculations can be used to obtain better estimates for parameter values in most cases. The Simplex method has been shown to be quite effective in approximately locating minima that are reached from initial parameter estimates where other methods fail.
8-1
8
Performing a Simulation
The following topics are included in this chapter: Chapter Topics Overview Performing a Simulation
Overview
Simulation allows you to generate data using the selected model, parameters, and data (if available). If the model was not compiled before the Simulation command was selected, it is automatically compiled; simulation will be performed only if compilation of the model was completed successfully. Differential equations that are specified in the model will be integrated using the algorithm chosen with the Integrator command. If there is an active data set, the simulation will be done for values of the independent variables that are available in the active spreadsheet; otherwise, Scientist uses the default range and number of iterations for the independent variables specified in the Simulation and Independent Variables section of the Variable and Parameter Interface.
Performing a Simulation
To run a simulation, do the following:
Step 1
Open the model you wish to simulate in Scientist. In this example, we will use the Simple Linear Equation model from the Models > Examples folder in the Scientist installation directory (Figure 8-1).
8-2
Performing a Simulation
Step 2 Step 3
Select File > New Parameter Set. In the Parameters section of the Variables and Parameters Interface, enter the values of the parameters you wish to use in the simulation (Figure 8-2).
Step 4
In the Simulation section, select the spreadsheet where you want the simulated data output. If you leave this field blank, Scientist will place the calculated values in a new spreadsheet. In the Independent Variables
Scientist 3.0 Getting Started Guide - Version 1
Performing a Simulation
8-3
section enter the Number of Intervals, Lower Limit, and Upper Limit of the independent variable to be used in the simulation. If you want to simulate data over a logarithmic interval check the box marked "Log Interval?" next to the appropriate independent variable. In this case we will simulate 10 intervals of X from 10 to 15 as shown in Figure 8-3.
Figure 8-3 Simulation 3
Step 5
Select Calculate > Run from the Variable and Parameter Interface. Scientist puts the independent variable values and the calculated values for each of the dependent parameters in a new spreadsheet as shown in Figure 8-4.
8-4
Performing a Simulation
9-1
9
Calculating Statistics
The following topics are included in this chapter: Chapter Topics Overview Calculating Statistics Statistical Output Explanations
Overview
Statistics calculations are usually performed after a Least Square Fit or Simplex Optimization to determine the accuracy of the calculation.
Calculating Statistics
To perform a Statistics calculation on a given Least Square Fit calculation, do the following:
Step 1
Start with the Variable and Parameter set containing the parameter values for the fit you wish to evaluate. In this example we will use a Least Square Fit of the ABC Kinetic data to the ABC Kinetic model. We calculated best fit values of the parameters as shown in Figure 9-1.
9-2
Calculating Statistics
Step 2
Select Calculate > Statistics. Scientist opens a new Statistics Report in a tab in the model interface (Figure 9-2).
Calculating Statistics
9-3
Step 3
There are no calculations in the Statistics Report at this time. The Input Information section of the Statistics Report shows the Model, Data Set, and Parameter Set to be used in the calculation. In addition, the Report Options section is set to the options that have been set in the Scientist Options Menu. You can change any of these options for this calculation only by making the changes in the Report Options section of the Statistics Report. These changes will not effect the Statistics Options selected in the Scientist Options Menu. After you select the options you like, you calculate the Statistics Report by choosing Calculate > Run. Scientist calculates a Statistics Report in the same tab. The report contains all the information requested by the user in the Report Options. In this case we have chosen Goodness-of-Fit Statistics, Confidence Intervals, Variance-Covariance Matrix, Correlation Matrix, and Residual Analysis as shown in Figure 9-3.
Step 4
9-4
Calculating Statistics
Data Statistics
The statistical information based solely on the observed data that is provided by Scientist includes the minimum value, maximum value, several means, the median value, sums of squares, deviation, variance, skewness, and kurtosis.
Parameter Statistics
The statistical information on parameters provided by Scientist includes the following: The best fit estimate for each parameter. The standard deviation of each estimate. The univariate and support plane 95% confidence ranges for each parameter, based on the assumption of model linearity near the least squares minimum. The variance-covariance matrix and the correlation matrix. In addition, Scientist has the optional capability of performing a rigorous iterative refinement of the confidence intervals assuming a nonlinear response in the region of the parameter estimates.
Goodness-of-Fit Statistics
Several statistical parameters that may be used as indicators of goodness-of-fit are reported by Scientist. These are the standard deviation of data, the correlation, the coefficient of determination, Rsquared, and the Model Selection Criterion.
Analysis of Residuals
The analysis of residuals provides information as to how well the distribution of residuals follows a normal distribution. It is most meaningful for large samples (as obtained, for example, in quasi-elastic light scattering experiments, or half-life determinations for mixtures of radionuclides) and should therefore be viewed skeptically for samples containing relatively small numbers of points (as is usually the case for pharmacokinetic studies or other experiments where data is manually acquired, on point at a time).