Home
ModelMaker Reference Manual
Contents
1. 31 step length 39 Goodness of fit methods for assessing 54 Grid Model Options 14 Grid 58 I Initial value compartments 27 Integration Bulirsch Stoer method 35 choice of method 40 error estimates 36 error scaling factor 38 Euler s method 32 Gear s method 35 Mid point method 33 Runge Kutta method 33 Speed eie 39 step length adjustment 37 Bulirsch Stoer 38 36 initial 0 eee 41 step halving 36 Integration methods 31 Interpolation 43 method choice 46 numerical methods linear evan chen etes 45 polynomial 45 rational function 46 rule based methods 44 interval center 44 interval end 44 interval start 44 88 K Keyboard Shortcuts L Lambda Marquardt optimization Levenberg Marquardt Marquardt License end 2 Linear interpolation Local minima versus global Logical operators M Marquardt Mid point method Minima local versus global Mi
2. EventDeactivate Purpose To deactivate the specified list of events Using Event Actions 69 Chapter 8 Syntax EventD eactivate Event Event Return Value None See Also EventA ctivate EventQuery EventProcess Comments The event which uses this action must be universal global or be connected to each of the events in the specified list by an influences Deactivated events are not included in the model run calculations Example EventDeactivate Infection Event EventProcess Purpose To unconditionally process the actions of the specified list of independent and component events Syntax EventProcess Event Event Return Value None See Also EventA ctivate EventDeactivate EventQuery Comments The event which uses this action must be global or be connected to each of the events in the specified list by an influences EventQuery will process a specified event even if it is deactivated Example EventProcess H arvest Event EventQuery Purpose To evaluate the trigger condition for each the specified list of component events If any of the events is triggered its actions are processed 70 Using Event Actions Syntax Return Value See Also Comments Example GetChoice Purpose Syntax Return Value See Also Comments Chapter 8 EventQuery Component Event Component Event D None EventA ctivate EventDeactivate EventProcess All the specified even
3. The first question to ask is Is the system stiff A stiff system is one in which the equations for the processes contain significantly different timescales and at some instants during the simulation the components values all change more slowly than the fastest process A typical stiff system is a set of chemical reactions where some of them reaction rates are so fast that some of the components behave at least for part of the simulation as if they were quasi equilibrium If your system is stiff you should use the Gear solver If your system is not stiff the default 4th order Runge Kutta is a good method to try This solves most problems and is much more reliable than Euler or mid point By this we mean it is more likely to get the right answer However even with Runge Kutta it is always worth occasionally checking that your solutions are accurate by specifying a much higher accuracy level and seeing whether you get the same result The Euler method is not very stable and is really only included for its educational value Mid point is usually a great deal safer Both Euler and mid point can be useful if you are forcing M odelM aker to use short step lengths irrespective of the accuracy criteria You might do this if for some reason you require lots of output intervals In this situation step lengths set by the accuracy criteria often take the solution beyond the next output interval and M odelM aker reduces the step length ac
4. 30 0000 000000000000 00000000044 45 RATIONAL FUNCTION 46 CHOICE OF INTERPOLATION 46 49 OPTIMIZATION 2 0 0 000111000000 50 OPTIMIZATION AS MINIMIZATION OF 50 OPTIMIZATION RECIPE 2 CONVERGENCE CRITERIA PARAMETER CONSTRAINTS 40200000 53 OPTIMIZATION TERMINATION s00eseccceeeccessseeecccceeeeeseeeecccceseeaaneeeeeeees 53 ASSUMPTION OF NORMALITY 54 OPTIMIZATION STATISTICS cccccssssesecccccecceesseeecccceeeeueesecccceeseaaaeeeeeeees 54 OPTIMIZATION 200 000000000 00000000 57 PARAMETER ESTIMATION 0 58 HANDLING DLL FUNCTIONS eere OL DLL FUNCTION INTERFACE 00000000000 0000000000500 61 FUNCTION PROTOTYPE iet RE ERR ev Eee e E YER Ve 62 EXPORTING THE 62 FUNCTION 4 00 00000000000 63 FUNCTION RETURN VALUE 64 FUNCTION 2 2 0 0000000000 0000000 65 USING EVENT ACTIONS e e
5. Integration menu components to be included command or click Advanced on Run menu 16 Interface guide Chapter 2 Dialog To open Description Sample Point Double click a Define Name Time Point Definition sample point on and component for the the Sample Point sample point used in Monte view Carlo and Minimization Start Select Confirm minimization set up Minimization Model Minimize and start the minimization menu command Sub model Click sub model Define Symbol and a Definition with RM B and description for the Sub Definition tab select Sub M odel model definition TableSelection Click the Table Select components whose icon on the Main values areto be displayed on toolbar create the table new table or click the Selection icon on thetable toolbar change current table Table Series Click the Series Configure the numeric icon on theTable format and the column titles toolbar of model series displayed Text Box Double click text Enter text to enhance your definition Box model text box may also be iconized to save space Tip of the Day Select Help Tip of the Day menu or can open at start up Displays a helpful hint for using M odelM aker Toolbar Customization Select View Toolbar Customize Add or remove command icons from View toolbars Interface guide 17 Chapter 2 Di
6. as a Series tab control or a controlled series and the method of interpolation Lookup Table Double click Define the lookup Symbol Definition Lookup Table create or open the Table Definition Tab View and set the active page if several pages of data are available Lookup Table Double click Define the data series in the Definition Lookup Table lookup table either as a Series Tab control or a controlled series and the method of interpolation Minimization Select Define constraint ranges and Configuration Model Configure convergence settings for the Minimization or click Advanced on the Start Minimization dialog minimization process Interface guide 13 Chapter 2 Dialog To open Description Model Data Click the Series Defines mode data series Series Definition icon in the Model i e relates data to model data toolbar components Model Options Diagram tab Select Modal Options menu command Set default line thickness and color for model diagram Toggle Snap to Grid for drawing alignment and size of grid Model Options Font tab Select Model Options menu command Select the default model font and style Model Options Select Define Symbols for the Symbols tab Model Options independent and iterator menu command variables Monte Carlo Select Confirm Monte Carlo set up Run Moda Monte and start the run E
7. Two toolbars are in view at any onetime e Themain toolbar comprises icons for functions that can be used at any time during use e Theview dependent toolbar that changes according to the view currently on display For example if you are viewing a graph then the Graph toolbar is on display The View menu includes a Toolbar command with a sub menu for customizing this view dependent toolbar You cannot change the appearance of the main toolbar Toolbars are dockable and can be rearranged by clicking and dragging on the left hand side To make toolbars floating windows drag away from the toolbar panel Re dock by dragging back to the panel Menus as follows e File common file utility commands e Edit common editing commands View commands pertaining to model views e Component select component type to add to model Evaluation Order and Format open the relevant dialogs and Interface guide 3 Chapter 2 the Align sub menus allow arrangement of selected components e Moda all commands relating to M odel run and analysis functions e Windows common window utility commands e Help open the Help file Tip of the day About box aker version number and licensing and links to the M odelM aker web site In addition right mouse button RM B menus provide commands in context with the currently displayed view or selected model component ModelMaker Help ModelMaker provides comprehensive on li
8. Value See Also Comments Example Chapter 8 Initialize Fuel load Distance traveled reinitialize all the compartments defined values and delays for a model InitializeA II None Initialize The equations for the initial value of all the model s compartments defined values and delays will be evaluated and the calculated values assigned to the components If an initial value equation references the independent variable the current value of the independent variable will be used in the evaluation To display a message box showing the specified formatted text essage essage text Titletext Value None GetChoice GetValue GetFileN ame The message box displayed contains two buttons OK and Cancel Pressing OK will allow the model run to continue Pressing Cancel will stop the model run essage text and Title text fields can contain both ordinary text and formatting commands which define how the following values displayed see M essage Text Formatting earlier in this chapter Message Entering stage at time 94 Warning Using Event Actions 75 Chapter 8 ModelExit Purpose Syntax Return Value See Also Comments Example ModelStop Purpose Syntax Return Value See Also Comments 76 stage t To stop the model run generating an error message Model Exit Value None M odelStop M odelM aker will stop the run
9. aker equations are intended to be as intuitive as possible and follow normal mathematical conventions Equations are entered on a single line and use a restricted character set typical of those used by computers The order in which M odelM aker evaluates an equation follows strict rules of precedence as follows ModelMaker arithmetic 25 Chapter 3 Precedence Operation 1 Expressions in brackets 2 Functions and negatives 1 3 Powers x y 4 Multiplication division 5 Addition subtraction When two operations of equal precedence appear in an equation they are evaluated from left to right Conditions In addition to normal arithmetical equations M odelM aker supports Boolean relationships i e those that produce a TRUE or FALSE result These are called conditions and are used in conjunction with conditional components and component events Conditions use relational operators which yield a TRUE or FALSE result depending on the relative magnitudes of two numeric values In thetable below x and y represent symbols or numerical values O perator Result lt TRUE if x is less than y X gt y TRUE if x is greater than y x lt y TRUE if x is less than or equal to y gt TRUE if x is greater than equal to y X y TRUE if x equals y lt gt TRUE if x is not equal to y 26 ModelMaker arithmetic Chapter 3 If a relational operator does not give a TRUE result then the result is FA
10. arithmetic Function arccos x arccosh x arcsin x arcsinh x arctan x arctanh x cos x cosh x deg x xdiv y exp x fact x frac x In x log x max X1 min x Chapter 3 Remarks Calculates the principle angle in radians whose cosine is x The argument x must bein the range 1to 1 otherwise the function fails Calculates the inverse hyperbolic cosine of x If x lt 1 the function fails Calculates the principal angle in radians whose sine is x The argument x must bein the range 1 to 1 otherwise the function fails Calculates the inverse hyperbolic sine of x Calculates the principle angle in radians whose tangent is x The argument x must bein the range 1to 1 otherwise the function fails Calculates the inverse hyperbolic tangent of x If x lt 1 or x gt 1 the function fails Calculates the cosine of x which is assumed to be an angle radians Calculates the hyperbolic cosine of x Converts the value x in radians to degrees Calculates thenumber of times x is completdy divisibleby y Calculates the value ex If x gt 709 7827 the function fails Calculates the factorial of the integer part of x Returns the fractional part of x i e frac 1 2345 0 2345 Calculates the natural logarithm of x If x lt 0 the function fails Calculates the logarithm to base 10 of x If x lt 0 the function fails Returns the maximum value
11. computing H owever all of this is based upon an approximate Taylor expansion This is only a good approximation if we are near the minimum to begin with If not then the above expression is quite likely to give us a worse set of parameters than we started with In this situation an alternative is required One of the most popular is iterative steepest descent constant x Vy Au next 82 Marquardt and Simplex theory Appendix 4 where the constant should be small enough to ensure that the currently estimated slope does not run out Marquardt s method elegantly combines these two approaches so that the optimization process can smoothly slide between equations 3 and 4 This is done through the constant in equation 4 which is set to be equal to the appropriate diagonal element of a matrix defined below and an overall constant The change in the ith parameter a given by equation 4 is then _ 1 ox i where a is a matrix closely related to the curvature matrix 1 res T j i Equation 3 is re written substituting for D VX a min cur The key feature of this result is that the scaling constant for the gradient approach of equation 4 is included in the diagonal elements of the matrix a When A gt gt 1 a is diagonally dominant and applying equation 5 with in place of D the result is completely equivalent to appl
12. deemed a success and the process is restarted for the next interval This method is very elegant and can be very usefully applied However it should really be reserved for well behaved problems and can be of limited use if many output steps are required see Choice of method later in this chapter Gear s method Gear s method is an algorithm for integrating a set of ordinary differential equations that works efficiently on stiff sets of equations These are typically for systems exhibiting extremes of behavior in some periods the functions are changing slowly and others where they change rapidly whose solutions remain bounded For example simulating a set of chemical reactions often results in a stiff set equations because although a set of reactions may initially occur very Integration methods 35 Step length Euler Mid point and Runge Kutta Chapter 4 rapidly if they tend toward some equilibrium then the timescale decreases greatly In Gear s method when calculating the solution at a point in time an interpolation polynomial is calculated for the previous points in time and the new point A set of values for the solution at the new time point is acceptable if the derivatives at the time point calculated from the equations are sufficiently similar to the derivatives of the interpolating polynomial at the time point Animplementation of Gear s method has to choose when to change the order of the interpolating
13. default the Starting Steps valueis 1 0 so ModelM aker assumes that a reasonable first step length is one output step Smaller first steps can be achieved by increasing the Starting Steps value Integration methods 41 Reference Chapter 5 5 Interpolation in Lookup Files and Tables Overview Lookup tables provide a way of including tables of numerical data in M odelM aker models M odelM aker provides a number of methods for estimating values in between the tabulated values Of these three are really just rules and three are standard numerical interpolation methods Rules Interpolations e Interval Start e Linear e Interval Center e Polynomial e Interval End e Rational Function This chapter outlines the bare essentials of the methods used For a more detailed introduction see Press William H Flannery Brian P Teukolsky Saul A and Vetterling William T Numerical Recipes Cambridge University Press Cambridge 1989 For the full story consult Stoer and Bulirsch R Introduction to N umerical Analysis Springer Verlag New York 1980 Acton Forman S Numerical M ethods that W ork Harper and Row N ew York 1970 Interpolation in lookup files and tables 43 Chapter 5 Rule methods These are very simple methods No actual interpolation is carried out instead simple rules are used to determine which value in the table to use The rules are explained with reference
14. i e third order polynomial function is completely described by four values in the lookup tables This function can then be used to estimate the value of y for x X lt Xnu The order of a polynomial is less than the number of points required to define it so linear interpolation is in fact a first order polynomial interpolation Third or fourth order polynomial interpolation generally produce much smoother results than simple linear interpolation H owever you should be cautious of using higher orders as they are prone to yield solutions that oscillate wildly in between the tabulated values You can check how an interpolation behaves by plotting its results on a fairly fine output mesh over the range of interest Interpolation in lookup files and tables 45 Chapter 5 Rational function interpolation A rational function is one polynomial divided by another n x atbx cx g hx ix r x Generally these are as good as polynomials at interpolation although they are rather more complicated H owever they are useful for interpolating functions which contain poles A pole is singularity of some sort for example a place at which the function approaches positive or negative infinity The function cannot be evaluated at such a place even by arational function but the latter can get a lot closer to a solution than can a comparable polynomial function For the mathematically minded such poles can occur q
15. is avector and therefore written in bold type and 1 is re written as 4 1 Dea where a isthe vector of current model parameters of them C is a constant in fact 4 at the minimum d is a vector N long representing the derivative of x2 with respect to the parameters a D isan XN matrix of the double derivatives of x with respect to a this is sometimes called the curvature matrix This is the Taylor expansion of the y function It is made a little unpleasant by the vectors and matrices which arise because we can adjust more than one parameter at a time Marquardt and Simplex theory 81 Appendix Differentiating this we can obtain a relationship for the gradient of the y function ae D d At the minimum of the x function this will be zero 4D d 0 and at the current parameter values the gradient is eur Gu D d Subtracting these two equations eliminates d and reorganizing gives anin D a D VX a cur Multiplying through by the inverse matrix D 1 we have a D e VX m n cur cur Taking stock this equation gives the parameters of the model amin which have the smallest x2 in terms of the current set of parameters that we have e D 1 theinverse of the curvature matrix D a the slope matrix for y at the current values of the parameters All of these terms are numerically obtainable albeit after some potentially considerable
16. minimize the differences between predicted and observed data Although optimization is a very useful tool if you are interested in the way a model changes when parameter values change then you can also use the M ode Carlo Minimization and Sensitivity analysis functions This chapter outlines the bare essentials of the optimization methods available For an introduction see Optimization 49 Chapter 6 Press William H Flannery Brian P Teukolsky Saul A and Vetterling William T Numerical Recipes Cambridge University Press Cambridge 1989 For the full story refer to Beington Philip R Data Reduction and Error Analysis for the Physical Sciences McGraw Hill New York 1969 Marquardt D W 1963 J Soc Ind A ppl ath 11 431 44 Optimization defined Optimization is the adjustment of parameters in the model in order to minimize the difference between the modal s predictions and observed data As with all simulation methods there are potential disadvantages of which the user should be aware e Optimization is an iterative process and is therefore time consuming e t may not find the best parameter set The minima it finds may be local not global e Initial values of all the parameters to be adjusted will be required For some problems these may need to be good estimates for the method to succeed Optimization as minimization of deviation Two methods of minimization are available e Marqua
17. of the model generating an error message showing the run step during which the action occurred the event responsible and the specified value If optimization confidence interval calculation sensitivity analysis or repeated runs is being performed the process will be terminated M odelExit 1 To stop the model run without generating an error message M odelStop None M odelExit M odelM aker will stop the run of the model without causing an error This means that if sensitivity analysis or a repeated run is being performed the process will not be terminated M odelStop is not valid during model optimization minimization or confidence interval calculation If a M odelStop action is encountered the process will be Using Event Actions QueryPage Purpose Syntax Return Value See Also Example SetPage Purpose Syntax Return Value See Also Comments Example Chapter 8 terminated with an appropriate error message To return the number of the active page of the specified lookup table QueryPage Lookup_Table The number of the active page of the specified lookup table GetPage SetPage page QueryPage M et data To set the active page for the specified lookup table SetPage Lookup Table Value If the specified page number is valid SetPage sets the page as the active page for the specified lookup table GetPage QueryPage M odelM aker attempts to load the page wi
18. polynomial typically orders between 1 and 4 are used and when to change the size of integration steps The version of Gear s method implemented in M odelM aker also estimates the integration step size to be used at the start of a simulation the user can over ride this Step length control and accuracy criteria All the methods used by M odelM aker to solve differential equations automatically control their own step length to provide you with the answer at a specified level of accuracy as quickly as possible Estimates are made of the accuracy of the solution and the length of step is adjusted accordingly If the accuracy is inadequate then the step length is reduced if the accuracy is greater than required the step length is increased In order to be able to adjust the length of step taken an estimate is required of the accuracy of each step In the cases of Euler mid point and Runge Kutta an identical approach to estimating the error is used step halving H aving completed a step the step is redone in two halves This must produce a more accurate answer and the assumption is made that the difference between the two estimates is a good estimate of the error in the step You also get a more accurate esti mate of the function from the two half steps and this is the value that all the methods actually use Of course there is no estimate of how accurate this is relative to the true and probably unobtainable analytic solution All tha
19. 1 63 return 64 Equations order of evaluation 25 Synta X cette 25 Error estimates integration 36 Error scaling factor integration X dh 38 Errors instrumental 55 normality of 54 underestimation of 55 Event Actions 67 EvaluateFunction 69 EventActivate 69 EventDeactivate 69 EventProcess 70 EventQuery 70 GetChoice 71 72 72 73 7 74 InitializeAll 75 Message 75 ModelExit 76 ModelStop 76 77 SetFileName TI SetPage TI text formatting 67 TraceMessage 78 Trace Off rere 78 xia ote 79 Extended Least Squares 51 87 Index F Functions mathematical 28 56 Gear s 35 reference
20. DLL Functions The string table must be defined as follows String numbers Description 20000 20099 Names of the functions contained in the DLL 20100 20199 General description of the functions contained in the DLL 20200 20299 Description of the input parameters 20300 20399 Description of the output parameters If there are more than 100 functions in the DLL the string resource structure repeats from 20400 The function name strings 20000 20099 can also be used to indicate the type of each of the DLL function to M odelM aker as follows Handling DLL functions 65 Chapter 7 String format Function type function_name N Normal default function_name Integrate The type indication contained in the resource strings is only of information It does not prevent a normal type DLL function being called as an integrate function and vice versa 66 Handling DLL functions Chapter 8 8 Using Event Actions This section describes the syntax and use of the model event actions The syntax definition for the actions observe the following conventions parameter optional parameter list up to 64 parameters in length Value numeric or mode component value or expression For example 2 123 2 2 100 V1 V2 Event independent or component event Component_Event component event only Component compartment or defined value Initial compartment defined value or delay Lookup lookup component form
21. LSE No other result is possible Relational operators cannot be used to produce compound conditions This can only be accomplished using logical operators These have operands which are not numerical values but Boolean values either TRUE or FALSE The logical operators are given below 1 and op2 represent relational expressions using the above relational operators and yielding a result which is either TRUE or FALSE O perator Result op1 and op2 TRUE if both op1 and op2 are TRUE 1 or op2 TRUE if either op1 or op2 or both are TRUE 1 xor op2 TRUE if either op1 or op2 is TRUE but FALSE if they are both TRUE not 1 TRUE if op1is FALSE As with the relational operators if the result of a logical expression is not TRUE itis FALSE Initial values of compartments Compartments are described by differential equations which M odelM aker solves by initial value methods Consequently compartments require initial values to be defined by the user Initial value may be an equation although in many cases the equation is simply a constant numeric value For example the default expression for a compartment s initial value is 0 0 This can be changed to a symbolic equation that conforms to the above rules the only limitation is that the equation must be evaluated before a model step is taken It can therefore only use symbols whose values are known at the beginning of a run This limits it to parameters defined values and lookup s
22. M ode M Reference M odelKin amp ix com a division of Cherwell Scientific Limited TheM agdalen Centre Oxford Science Park Oxford OX4 4GA United Kingdom 04 00 End User License Agreement 1 2 End user license agreement LICENSE 11 12 Cherwell Scientific Limited of The Magdalen Centre Oxford Science Park Oxford OX4 4GA hereby grants you a non exdusive license License to use the software accompanying this license Software and the accompanying documentation on the following terms The copyright and all other rights in the Software and the accompanying documentation remain with Cherwell ACCEPTANCE 2 1 22 You are deemed to accept the terms of this License if you install the Software on a computer If you do not wish to accept these terms you must within 30 days of purchase erase any installation file and any copy of the Software and documentation you have downloaded or stored on any medium and return any copies of the CD manuals and packaging to Cherwell together with proof of purchase for a full refund SCOPE OF LICENSE 3 l This License permits you to 3 1 1 use the Software on a single computer or on a networked computer drive 3 1 2 transfer the Software to someone else provided that you assign all of your rights and obligations under this License to such other person you erase all copies of the Software under your control and stored on any mediu
23. VIEW RH EQUATIONS CONDITIONS INITIAL VALUES OF COMPARTMENTS cccccccsssessecccceeseeeseeccceseeeaaneeeeeees 27 NUMERICAL 40 000 000000000000000000000000 28 8 222655 28 MATHEMATICAL FUNCTIONS IN 28 INTEGRATION 8 31 OVERVIEN iR INIMA MM EE 31 BOUNDARY 8 0 2 2 0 00000000000 31 BULER S METHOD wees eie ee E 32 MID POINT METHOD 33 RUNGE KUTTA 2 0 0 000000000000000000000 000 na ntn nnne 33 BULIRSCH STOER METHOD 2020000000000000000 35 GEAR S METHOD 35 STEP LENGTH CONTROL AND ACCURACY CRITERIA 36 CHOICE OF METHOD c0ssseessecccsenevsosesecccccenesevescescetecesssessscccsteecssessvess 40 STARTING STEP LENGTH cccccccccccssssseccccceeecassscecccceeseaaaeceeccceeeeeaanness 41 INTERPOLATION IN LOOKUP FILES AND TABLES 43 ModelMaker ix Contents OVERVIEW 50 0 43 Rm 44 LINEAR INTERPOLATION E 45 POLYNOMIAL 2
24. X Y and Z panels Definition tab Parameters view become active when defining arrays Parameter Double click Define ranges for parameter Definition parameter in estimation during Estimation tab Parameters view optimization Password Entry Opens automatically Enter the correct password to open the model Interface guide 15 Chapter 2 Dialog To open Description Reference Double click Define the Symbol for the Definition Reference reference parent view Reference Double click the Define a Symbol and arrow Definition sub reference position for the link in the model view sub model view Rename model Opens Prompts user to rename Component automatically model component when you paste model component onto the same model level Run Select Confirm Start Stop values Model Integrate for independent variable menu command select repeated run and start or click Go the model run Run Options Select Select and configure Integration tab Model Configure Integration menu command or click Advanced on Run menu integration method and error scaling Run Options Select Configure Configure the repeated run Repeated Run Integration menu or sensitivity analysis Settings tab command or click Advanced on Run menu Run Options Select Set the number of repeated Repeated Run Model Configure runs to perform and the tab
25. able model data view Insert new row or rows into table of experimental mode data Delete row or rows from table of experimental model data Insert new column or columns into table of model data column or columns from table of model data Command Attributes Title legend and frame attributes of currently active graph Change X axis characteristics for currently active graph Change Y axis characteristics for currently active graph gt Adds new parameter to mode Adds new sample point to model Interface guide 7 Chapter 2 The Diagram icons conized text box Double dick to open Use Model Options Diagram dialog to select whether icon opens read only text box or text box definition dialog Dialogs In this section we list the M odelM aker dialog boxes N ote that component definition dialogs have many things in common including A Bitmap pane for importing a graphic to enhance your model display e An Information panel allowing you to add useful explanatory notes A list of available components whose values may be used a defining equation e A list of ModelM aker functions that may be used in a defining equation or in the case of event action M odelM aker commands and logical expressions A set of filters for selecting the components and functions to be displayed in the lists If you make a mistake in defining a component or usethe symbol for an as yet undefined co
26. ained variation by chance e P Value This is the probability associated with the variance ratio and degrees of freedom values It is the probability that the model explained the variation by chance The smaller it is the better the fit e 2 This is the fraction of the total variation explained by the model i e r2 Model WSS Total WSS It is worth pointing out that the total sum of squares is calculated as the total squared deviation of the data from the weighted mean of 2 The residual variation is the variation of the data about the simple model i e the mean data value 56 Optimization Comparison of Q and F Visual comparison Chapter 6 the data In other words what you are really testing with your analysis of variance is whether the model is a significantly better representation of the data than its mean value Analysis of variance is therefore answering different question to the Q value derived from x2 Q is the probability that the difference between the model and the data is pure chance i e does not arise through a fault in the model assuming that the data errors you provide are accurate and normal This may give a low valuefor reasons other than the model being wrong Similarly a low r2 doesn t necessarily imply a poor fit to the data merely that the model does not do much better than the mean This sometimes happens if the data is very flat Thefinal very popular way to test goodness o
27. alog To open Description Unconditional Double click Define Symbol Equation Compartment Compartment and initial value for Definition Compartment Definition tab Unconditional Double click Define symbol and equation Defined Value Defined Value for a Defined Value Definition Definition tab User Select User Toggle a number of options Preferences Preferences from controlling how you work General tab the Edit menu with M odelM aker e g quiet editing mode undo levels and user warnings User Select User Define report file names and Preferences Preferences from levels of active tracing when Output tab the Edit menu debugging Variable Double click a Enter an equation to be Definition variable calculated at every time step during the model run View Data Click View Data View data or text file on Lookup File imported into M odelM aker Definition or on File Format dialog X or Y Axis Click the X or Y Configure the X axis scale Configuration axis icon on the and grid lines Format tab Graph toolbar X or Y Axis Click the X or Y Add thetitle position and Configuration axis icon on the font style for the axis title Title tab Graph toolbar For the Y axis also select to display vertical text X or Y Axis Click the X or Y Configure the numeric Configuration axis icon on the format and font style for the Labels tab Graph toolbar axis labels 18 Interface guide Selecting components Chapter 2 Mouse action Eff
28. amp drag to select multiple components Compartment A compartment represents an integrator in a model Variable Variables hold values which are calculated as Interface guide the model is run Chapter 2 Icon Command lt Defined Value constant value calculated at the start of a model run Flow represents movement betw een compartments Influence Influences represent relationships between model components Delay Useto hold the value of another component for a defined period DLL Allows models to be connected to external functions Windows DLL modules Group components accomplishing a particular function as a sub moded Input Useto transfer data from main model to sub modal Output Useto transfer data from sub model to main model Look up Table Useto enable real data to help definethe Look up File Links model to data in external file for look up function Independent Event Event triggered by independent variable Component Event Event triggered by values of components Text Box Useto annotate mode diagrams add graphics or both Interface guide Table View Graph Histogram View Parameters View Sample Points View Chapter 2 Toolbars other views Icon Command tS Icon TY Selection Useto select component to include on graph or table Series Edit the attributes of the series displayed in active graph t
29. at the error on each component in one integration step is less than 0 1 N ote that for stiff simulations the ones for which Gear is an appropriate solver the solution tends to a steady state based on conservation laws This is independent of the integration errors and hence errors do not accumulate from step to step Gear s Method changes the step size and the order of the interpolating polynomial as follows If the iterative solution procedure for the implicit equations solved by Gear do not converge then the step size is reduced and the step is retried If the iterative solution procedure converges Gear s M ethod estimates the error on that step If that is within the specified criterion Gear s M ethod estimates the largest step sizes at which the error would be acceptable at the current order an increased order and at a reduced order If any of these would mean a significant Integration methods 39 Chapter 4 increase step size the step size is changed and if appropriate so is the order If the error is unacceptable the step size is reduced and the step is re tried If reducing the step size does not cure the problem the order of the interpolating polynomial is reduced Choice of method There is no correct method to solve the differential equations in your model best method to use is the one that gets the right answer in the shortest time The default method in M odelM aker is 4th order Runge K utta
30. atted text text optionally containing formatting commands see below Message Text Formatting M odelM aker uses formatting commands to control the appearance of the values passed to the M essage GetChoice GetValue GetFileN ame and SetFileN ame actions Formatting commands may appear in the message text title text and file name fields of the above actions All of the command begin with the percent character 96 and have the following format 99 I width places command The elements of the formatting command are described below Using Event Actions 67 Chapter 8 width places command This left justifies the formatted value within the space defined by the width element This is the minimum width in characters which the formatted text will occupy If the formatted value requires fewer characters than the minimum with it will be padded with spaces If the value requires more space the minimum number of characters necessary to show the value will be used This is the number of decimal places which will be used to format fixed point or scientific notation values If the places element is absent the default number of decimal places is 5 This controls which notation is to be used to display the value as follows f Fixed point e Scientific i Rounded to the nearest integer Skip the associated value A percent sign If any other character is used or there is no associated value in the parameter
31. ccurs for a number of reasons calculation reaches the limit of machine accuracy This means that the parameters and or RSS are continuing to change and the changes are so small that they cannot be calculated accurately because the computers limit of numerical accuracy has been reached Usually this condition can be interpreted as full convergence Thevalue of Marquardt method becomes too large so that the gradient solution results in a numerical overflow This usually indicates a very poor fit and may be overcome by trying improved starting values for the parameters Optimization 53 Chapter 6 e Themodd itself fails during one of the required simulations This can happen if the optimization takes a wild jump leading to a parameter set that takes the model s equations out of range This situation may be overcome by reducing the constraint range for the parameters e Constraint range violation The optimization has repeatedly tried to take one or more parameters outside their allowed range Sometimes this is a realistic situation and the parameters need to be updated and the optimization repeated perhaps with a wider constraint range Sometimes however a parameter continues to be either decreased with the result that it constantly hits its constraint range This is often because its true value is zero This problem is overcome by accepting the very low or zero parameter value and re optimizing without that paramete
32. checked then it is assumed that the errors are thought to relate to each other but their absolute values are not known In this case additional information is calculated by assuming a good fit and scaling parameter variances by Optimization 51 Chapter 6 the Residual M ean Square that is given as the ratio of the Residual Sum of Squares to the Residual Degrees of Freedom Residual Mean Squares Residual Sum of Squares Residual Degrees of Freedom Optimization recipe The iterative approach employed for optimization is as follows 1 Pick initial starting values for the parameters a 2 Evaluate RSS 3 Change parameters according to the selected method 4 Evaluate the model with the new parameters thereby obtaining a new value of RSS 5 If RSS improves decrease the estimate a re evaluate the model and return to step 3 6 If RSS gets worse increase the estimate a re evaluate the model and return to step 3 Convergence criteria In principle the above recipe could continue indefinitely producing a marginally better fit from time to time In practice we should recognize that any measurement error no matter how small will prevent the perfect parameter set being found even if the model is completely correct Therefore it is sensible to specify when to stop or in other words to stipulate convergence criteria In ModelM aker optimization is deemed to have converged when a user defined number of consecutive convergent ste
33. cing an error e these arguments suggest that the time step Ato which would produce the desired error is given by the following expressions For Euler 0 5 At At For mid point 0 333 At At For Runge Kutta 0 2 At At Integration methods 37 Step length Bulirsch Stoer Chapter 4 These equations are used to control the step length used by M odelM aker If the error is larger than that desired then these are used to determine a new reduced step sizeto retry the step If the error is less than that desired then the equations above are used to determine the step length used for the next step In practice M odelM aker is a little more conservative than these equations suggest when a step fails the time steps are reduced rather more than may be required just to be sure that the next step succeeds The description above has been confined to considering just one differential equation M ost M odelM aker applications contain a number of simultaneous differential equations each with their own errors These are solved together and the same step length is used for each Therefore the step length is determined by the worst equation Another issue raised by the simultaneous solution of numerous equations is that the errors calculated using the step halving approach described above are absolute This does not matter provided that all the equations have solutions of roughly the same
34. cordingly You may therefore inadvertently force the solution to go more slowly than strictly necessary simply because you want lots of points on your graph In these circumstances the 40 Integration methods Chapter 4 simplest methods with their low computational overheads can be useful What about Bulirsch Stoer It has accuracy comparable with that of Runge Kutta and for some kinds of applications is much quicker especially ones with smooth solutions However it does not deal well with discontinuities and sudden changes in the solutions For example data derived from lookup tables is often rather discontinuous The discontinuities can sometimes be smoothed out by using the more sophisticated interpolation options that exist for lookup tables However the major limitation of Bulirsch Stoer is that it is only really useful when it can take giant steps For many problems it can never get into its stride because it has to keep stopping to generate output Starting step length Above we discussed the adjustments to step length which aker performs as it goes along Of course this assumes that there is a valid first step that it can make If the first step is so bad that the run fails immediately giving an error then the program has no chance to adjust automatically The initial step length is calculated by dividing the first output interval by the Starting Steps value set in the Integration Configuration dialog box By
35. e Main values are to be displayed on toolbar createsa thegraph new graph or click the Selection icon on the Graph toolbar changes the current graph Graph Series Click the Series Configure the model and icon on the Graph data series line toolbar color thickness etc to be displayed on the graph Histogram Click the Select sample points to Selection Histogram icon on display on the histogram the Main toolbar Define the number of create new columns in which to display histogram or click the data the Selection icon on the Histogram toolbar change current histogram Independent Double click Define the event as period Event Definition Independent non periodic or both Trigger tab Event click Triggers tab 12 Interface guide Chapter 2 Dialog To open Description Insert Delete Select Insert or Choose how to handle Delete calls insertion or deletion of cells from the RMB in the Model Data view when data is already present in the view License Control Click Licensing To fully activate your copy Dialog in the About of ModelM aker contact us ModelM aker with the two User Codes dialog and then enter the activation codes we give you Lookup File Double click Define the Symbol and the Definition Lookup File path to the lookup file Definition tab Lookup File Double click Define the data series in the Definition Lookup File lookup table either
36. e aav ETE CER ERR TS 84 INDEX eee aao eem tv voee ee no o aoo ae eo o ovo aee ee 87 ModelMaker xi Chapter 1 1 Introduction This manual provides a reference guide to using the M odelM aker application There are two main sections Interface guide The Interface guide Chapter 2 provides a detailed description of the aker interface toolbars menus dialogs and available shortcuts You will find when using the software that there are often different ways of achieving the same result allowing you to work in the way you choose Mathematical reference The remaining chapters provides background information on the mathematical methods used by ModelM aker This includes arithmetic integration and interpolation methods optimization minimization and analysis methods In most cases this is only an introduction and users are referred to standard texts and original papers for detailed descriptions Introduction 1 Chapter 2 2 Interface Reference Guide ModelMaker window overview Main window TheModelMaker window comprises two panels On the left is the Model Explorer on the right is the M odel View Selecting a view on the Model Explorer shows that view on the right It is possibleto work on several models at one time each model being displayed in its own model window You may view these in the manner common to Windows applications using the Windows menu cascade and tiled Toolbars
37. e to the component Message GetChoice GetFileN ame The message box displayed contains two buttons OK and Cancel Pressing OK will cause M odelM aker to evaluate the condition using the entered value If the condition is TRUE the entered value is assigned to the component specified by Value component and the model run continues If the condition is FALSE an error message is displayed and the user prompted to enter another value Pressing Cancel stops the model run TheM essage text and Titletext fields can contain both ordinary text and formatting commands which define how the following values displayed see M essage Text Formatting earlier in this chapter GetValue The production rate cannot be greater than 2f What should the new rate be Production Rate rate rate gt 0 and rate lt max rate max rate To re initialize the specified list of compartments defined values and delays Initialize Component Component None InitializeA II The equations for the initial value of the specified compartments defined values and delays will be evaluated and the calculated values assigned to the components If an initial value equation references the independent variable the current value of the independent variable will be used in the evaluation Using Event Actions Example InitializeAll Purpose Syntax Return Value See Also Comments Message Purpose Syntax Return
38. e use of tables M odelM aker displays Q in the results view N ote that Q is only calculated when you select Reasonable error estimates in the Optimization Run dialog If Q is low then there is a problem which could be caused by any of thefollowing The model is wrong The model does not fit the data and perhaps never will You should always be aware of this possibility e Theerrors on the data are underestimated This can be quite common and the error estimation is usually worth checking Be suspicious of purely instrumental errors where variation between replicates is likely If the errors are based on variation between replicates are the replicates genuine according to the scriptures of experimental design Consult a good textbook on the subject if you are unsure Are there enough replicates to give good estimates of the errors Theprevious points apply only to random errors If there systematic errors in the data they need to accounted for separately e Low values of Q can also be due to non normal errors which often manifest themselves as an unusually high number of outliers This last point is quite common and isn t usually a major problem if the distribution is more or less normal For this reason apparently low values of Q are often accepted A truly wrong model i e onethat fails to fit the data will usually generate very low Q value say 107 or less Q value of 103 or so is worrying but may jus
39. ect Mouse click on unselected component Component selected all other components de selected SHIFT mouse click on unselected component Component is selected any existing selection remains SHIFT mouse click on selected component Component is de selected any existing selection remains Drag area All components inside the drag area selected all other components de selected SHIFT drag area All components inside the drag area selected any existing selection remains Mouse click outside component and selection area All components de selected Scrolling The Model Diagram Key Effect UP ARROW or One line up or down DOWN ARROW Interface guide 19 Chapter 2 LEFT ARROW or RIGHT ARROW One column left or right PAGE UP or PAGE DOWN One page up or down SHIFT LEFT ARROW or SHIFT RIGHT ARROW One page left or right HOME or END To thetop or bottom of the diagram CTRL LEFT ARROW or CTRL RIGHT To the extreme left or right of the diagram ARROW CTRL HOME To the top left corner of the diagram CTRL END To the bottom right corner of the diagram Keyboard Shortcuts Key Effect combination Ctrl Z Undo Will also undo actions within dialog boxes Set undo level in Model Options Diagram dialog box Ctrl Y Redo Ctrl X Cut selection to clipboard C
40. ehaved is jargon usually meaning smooth i e the function has continuous derivatives Werecommend that if you are making serious use of the Euler method you should occasionally check that the results are comparable with those obtained using a more sophisticated method eg Runge Kutta see later in this chapter Mid point method The mid point method is an extension of Euler s method A standard Euler step is used to estimate the value of the function half way across the interval i e at the mid point From this position a new estimate of the derivative is made and this is applied across the whole step from yn to Yn In equations this is represented as Dn At You Yn dt 2 d yos E ELN This method has considerable advantages over Euler s method in terms of accuracy primarily because it is using a value for the derivative that is a better average over the interval than a derivative calculated just at the beginning of the interval Runge Kutta method The idea behind the mid point method be extended almost ad infinitum to produce more and more complex ways to cross the interval with more intermediate points However such extensions do not necessarily confer greater accuracy and certainly make the calculations more complicated A compromise between using more Integration methods 33 Chapter 4 and more intermediate evaluations of the derivatives and a reasonable level of performance is the 4th o
41. en then the temperature is reduced by Tew Factor If Exponential is chosen then the temperature is dropped according to the schedule N current ste T Tu E maximum Steps where is the user defined factor in the Exponential edit box Termination Criterion To stop the annealing the user may wait for the maximum number of temperature steps to be taken or specify a method of stopping the process if nothing is changing User proportion of good steps will stop the optimization if the proportion of good trials falls below a certain level For example if this value is 0 05 and the number of trials at a temperature step is 100 then the algorithm will stop if the number of good trials at a temperature step falls below 0 05 100 5 60 Optimization Chapter 7 7 Handling DLL Functions ModelM aker DLL function components allow models to call functions located in external DLL modules during a model run Such external functions receive an array of values from the model and can perform any manipulation of these values before returning a separate array of values to the model Some possible uses of such functions are to e perform a special mathematical calculation not available within aker e interface a ModelM aker model to the calculations of an existing model e display a specially designed dialog box for the model e query or update a database e access an external device e g play a vid
42. eo or sound clip DLL Function Interface For a function within a DLL to be compatible with a M odelM aker model it must e conform to the ModelM aker DLL function prototype bean exported function ModelM aker DLL function interface also defines the following attributes of the function and DLL resources e function parameters e function return value e function information string table Handling DLL functions 61 C and C Pascal and Delphi Chapter 7 Function Prototype TheM odelM aker DLL function prototype for C and Pascal are shown below extern C int function name int input length double input values int output length double output values Type ArrayDouble array 0 100 of Double array of arbitrary length PArrayDouble ArrayDouble Function function name input length Longint input values PArrayDouble output length Longint output values PArrayDouble Longint cdecl Exporting the Function For C and C the function prototype makes the function an exported function However by default C and C add an underscore to the start of all exported function names In order to make the function available to M odelM aker as function name rather than function name the EXPORTS section of the DLL model definition file must be used as follows EXPORTS function name function name Pascal and Delphi require an export clause to be added to the module file as follo
43. ere eee 67 MESSAGE TEXT 67 69 BENENTAGCTIVATE 69 i 5ceeccenjseesseecdivcdoedevescencdencdosssvecdercdeosdossesccderedsessevece 69 8 82800 eye tel o EE PUES 70 EVENTQUERY 2 70 GET CHOICE 71 GETEILENAME dade vies dea erret t Pe pedore Peer 72 etie ete eee ee ea re eee 72 GETVALUE pe WIDE I IE 73 INITIALIZE wee 4 INITIALIZEALL wo ege EH PPP RETE 75 5 restet teet ette decet lies eie e OO 75 MODELBEXIT i eicere re e nie ies 76 MODELS TOP 4 xe AEAEE A 76 ModelMaker Contents QUERYPAGE 77 Nicandri TT SETEIEENAME noie ere eere tie ERE douse STER TI EET PRENNE TT TRACEMESSAGE detti tor te 78 5 I RII 78 TRACEON M 79 APPENDIX INTRODUCTION TO MARQUARDT AND SIMPLEX THEORY iere eee eee eo to n eoe oo eoa eoe 81 MARQUARDT THEORY 81 THE SIMPLEX METHOD reiecit rese veda evt a
44. f fit is to make a visual comparison of the data overlaid on the model prediction using the graph view This gives an immediate indication as to the accuracy of the model and gross errors may be detected this way However when a quantitative analysis is required you should use M odelM aker s inbuilt functions described above Optimization guidelines Optimization as implemented in M odelM aker is a very powerful facility but it is not a panacea Thetechnique should be applied with care The following points are worth noting as they are common pitfalls for the over ambitious Besensible about how many parameters you attempt to optimize Every Marquardt iteration has to carry out N 1 model runs where is the number of adjustable parameters ence increasing the number of parameters will increase time required e You should have more ideally many more observed values than adjustable parameters e Try provide reasonable initial values for your parameters This will certainly increase your chances of success and probably speed up convergence Optimization 57 Grid Search Chapter 6 Beaware of local minima in the x surface Marquardt does not always find the best parameters for your model the global minimumy it may get stuck in a local minimum perhaps far from thetrue result It is usually worth starting with several different initial sets of parameters to check that they all end up at the same convergence p
45. from the list xo Returns the minimum value from the list x2 ModelMaker arithmetic 29 Chapter 3 Function x mod y rad x rand x y randn x y rande round x sin x sinh x sqrt x tan x tanh x trunc x 30 Remarks Calculates the remainder when x is divided by y Converts the value x in degrees to radians Generates a series of random numbers uniformly distributed between x and y Generates a series of random numbers with a mean of x and a standard deviation of y Generates a series of random numbers exponentially distributed between 0 and 709 7827 Rounds x to the nearest integer If the fractional part of x equals 0 5 x is rounded up Calculates the sine of x which is assumed to be an angle in radians Calculates the hyperbolic sine of x Calculates the square root of x If x lt 0 the function fails Calculates the tangent of x which is assumed to be an angle in radians This function is undefined at multiples 2 Calculates the hyperbolic tangent of x Calculates the integer part of x i e trunc 1 23 10 ModelMaker arithmetic Reference Chapter 4 4 Integration Methods Overview M odelM aker uses numerical methods to solve differential equations Using ModelM aker you can solve equations that cannot be solved using analytical methods and find solutions to problems that would be beyond even expert mathematicians For non expert mathe
46. function has failed and the mode run should terminate A non zero value returned by a DLL function can refer to a string resource contained within the DLL module If the indicated string resource exists M odelM aker displays a message box inserting the string resource text as follows 64 The model run was stopped during step n because text when evaluating the DLL function lt component gt where lt n gt isthestep during which the error occurred text is the text read from the DLL s string resource component is the name of the calling DLL function component Handling DLL functions Chapter 7 If the indicated string resource does not exist M odelM aker displays the following default message box before the mode run terminates The model run was stopped during step n because call to the ALL function function name in module module gt failed with value value when evaluating the DLL function component where lt gt the step during which the error occurred funcion name is the name of the DLL function module name is the name of the DLL module value is the value returned by the DLL function Function Information DLL function interface allows a string table resource to be added to the DLL module containing information about the functions provided by that module This information appears in the DLL Information dialog box see Handling
47. he various methods to calculate future values of the variables N ote that although M odelM aker uses time symbol t as the default independent variable you can use any variable and change the symbol if you wish to do so Euler s method The simplest method for solving differential equations numerically is Euler s method As with all other methods this is based upon the assumption that the rate of change at a point the differential also applies over a finite interval At so that dy At T i The differential which can be calculated from the known equation is assumed to hold over a finite interval At so that a finite change in y A y can be calculated A new value of y can then be calculated from the previous value plus the change over the time interval y y Ay where y is the value of the function after a time period of At This is an approximation because in fact the differential dy dt may change over the finite interval At However the approximation can be a good one if the time interval is small In practice this method is not recommended for many problems as it can be very inaccurate and highly unstable It is included in ModelM aker primarily for 32 Integration methods Chapter 4 1 Educational applications 2 Occasional models whose differential equations are very well behaved and where minimizing the computational overhead associated with the other methods is desirable Well b
48. her Range or Fixed to activate the Grid steps option for Grid search This method of parameter estimation employs a simple grid within the defined estimation range The size of the grid is defined in the Grid Steps edit box As with other optimization routines this will change the parameter set until a minimum is found the estimates will then be passed to the M arquardt optimization routine 58 Optimization Simulated Annealing Configuring Simulated Annealing Chapter 6 When using the Marquardt method to find the optimal parameter set of anonlinear system you usually want to find those that correspond to the global minimum In many cases multiple local minima may exist and these can cause problems in optimization algorithms as they cannot distinguish a local minimum from a global one This is due to the fact that M arquardt finds minima by following the local gradient towards the closest minimum If you have a parameter set close to a global minimum this is fine but otherwise the best solution may not be found Simulated annealing is able to escape these local minima and will find the global minimum more reliably The downside is that the algorithm may take longer to converge at a solution The Estimation tab of the Optimization Settings dialog comprises a number of configuration options for Simulated Annealing These include the default search range and those specific to this algorithm M aximum number of temperature steps S
49. imulated annealing works by starting with an initial tenperature It is this value governing how likely the algorithm is to accept worse steps As the annealing continues this tenperature is gradually lowered meaning that the algorithm is progressively less and less likely to accept worse steps M aximum N umber of temperature steps controls the number of times the algorithm can lower the temperature Number of trials per temperature step At each level of temperature the algorithm makes a number of trials During each trial the parameters are varied and the model is run The new value of the objective function is compared to the current value and the change in the parameters is accepted or rejected Number of good trials before temperature step If thealgorithm is thought to be accepting too many trials at a particular temperature step then the temperature should be lowered as it is likely that the temperature is too high causing too many trials to be accepted Optimization 59 Chapter 6 Initial Temperature This is the initial value of the temperature of the algorithm It is an adjustable parameter for the user to set and change as necessary Acceptance Probability Distribution Trials are accepted or rejected by comparison with a probability distribution Two functions Boltzmann and Tsallis distributions are available Cooling Schedule This controls how the temperature is lowered If a multiplicative factor is chos
50. likely to fail and can deal with some very difficult systems of differential equations although it may not always bethe quickest method It is the default method selected by M odelM aker and if you try one of the 34 Integration methods Chapter 4 alternatives you would be wise to compare its results to those of Runge Kutta before risking your reputation on the rocks of integration noise Bulirsch Stoer method The Bulirsch Stoer method differs from those detailed above in that it does not take small steps it takes wild leaps forward We do not discuss the fine details here but confine ourselves to the basic concept readers are referred to the standard texts for a full discussion A large step is to be taken To begin with this is done is two half steps yielding an estimate of the solution at the end of the large step It is then attempted in four sub steps yielding a new and theoretically more accurate estimate It is then attempted in six sub steps yielding anew and theoretically even more accurate estimate This process could be repeated indefinitely although a practical limit of 96 sub steps is placed on the implementation used in M odelM aker Each time an estimate of the true answer is obtained together with estimates of the extrapolation error If the error is unsatisfactory see Step length control and accuracy criteria another attempt is made to cross the interval If theerror is within the required limits the step is
51. list to format the formatting command will be removed from the message text and ignored Examples Message A value f 50 92346 A value 50 92346 Message A value 96 2e 50 92346 A value 5 09E 401 Message A percentage 9619696 50 92346 A percentage 5196 Message A weight 968 3fkg 50 92346 A weight 50 923kg Message A weight 8 3fkg 50 92346 A weight 50 923kg M essage Second value n i 1 2 Second value2 68 Using Event Actions Chapter 8 EvaluateFunction Purpose Syntax Return V alue See Also Comments Example To evaluate the specified list of DLL function Evaluate Function DLL Fundion DLL Fundion None EventDeactivate EventQuery EventProcess The event which uses this action must be universal global or be connected to each of the DLL functions in the specified list by an influences EvaluateFunction Query DataBase Play Tung EventActivate Purpose Syntax Return V alue See Also Comments Example To activate the specified list of events EventA ctivate Event Event None EventDeactivate EventQuery EventProcess The event which uses this action must be universal global or be connected to each of the events in the specified list by an influences Activated events are included in the model run calculations EventA ctivate Fertilizer Event Irrigation Event Disease Event
52. ll SHIFT Click on acell Extends the selection to the cell Drag to another cell Extends the selection to the cell Click on a row marker Selects the row SHIFT 4 Click on a row marker Extends the selection to the row Drag to another row marker Extends the selection to the row Click on a column Selects the column header SHIFT Click on a Extends the selection to the column header column Drag to another column Extends the selection to the header column 24 Interface guide Chapter 3 3 ModelMaker Arithmetic Overview This chapter defines M odelM aker arithmetic its numerical accuracy numerical and logical operations that are allowed and the mathematical functions provided Equations Each model component has an equation defined by the user ModelM aker equations may contain e Numerical values in either fixed point format e g 13 567 scientific notation e g 1 23E 46 Symbols representing components within the model These must be either global or linked via an influence or flow Symbols representing parameters in the model e Arithmetic operators addition subtraction multiplication division raising to a power Mathematical functions defined within aker e g cos See below for details e Brackets to control evaluation precedence in an equation or to specify the arguments of a function M odelM
53. m including the hard disk copy and any backup copy and the other person agrees to the terms of this License 3 1 3 make one copy of the Software for back up purposes only which copy must reproduce and include this License in full 3 2 You shall not 3 2 1 use or copy the Software other than as permitted by this License 3 2 2 at any time allow more users than stated in your sales invoice to access or use the Software concurrently 3 2 3 modify adapt merge translate decompile disassemble or reverse engineer the Software except as permitted by law 3 2 4 use sell assign rent sub license loan mortgage charge or otherwise deal in any way in the Software or the accompanying documentation or any interest in them or under this License except as expressly provided in this License ModelMaker End User License Agreement 4 TERM 4 1 Unless terminated under clause 4 2 this License shall last for as long as you continue to use the Software 42 This License shall terminate automatically if you fail to abide by any of its terms 4 3 Upon termination of this License you shall destroy the Software and its accompanying documentation and shall erase all copies of the Software under your control and stored on any medium including the hard disk copy and any backup copy 5 WARRANTIESAND REMEDIES 5 1 Cherwell warrants that the storage media on which the Software is supplied will be free from defects in material
54. mates of the solution the earlier values do not contribute 38 Integration methods Step length Gear s method Chapter 4 extra information Therefore if the method has to cross the interval more than seven times before converging satisfactorily then it is wasting some effort implying that a smaller step is required Conversely if fewer than seven trips are required then the step is shorter than strictly needed The next step length is adjusted accordingly The step fails completely if it crosses the interval 11 times and still does not converge Under these circumstances the step length is reduced sharply and the step re attempted Through the use of these techniques M odelM aker constantly adjusts the step lengths it takes to ensure it works not within the accuracy you specify but at the accuracy you specify This means that if the system is highly dynamic then the step lengths are small and the calculation proceeds slowly If the system only changes slowly then the step lengths become longer and the calculation is quicker This effect can become apparent if you have a model where some kind of dynamic event suddenly occurs part way through the run The calculation as monitored by the percentage indicator in the run message bar slows down visibly When using Gear s method a different approach is taken in that the end user specifies relative error per step For example if this is 0 001 then the integration method should ensure th
55. maticians who nevertheless wish to find solutions to complex problems in the field of their own expertise M odelM aker uses suitable general methods of integration In some cases these methods may be inappropriate and other methods may be chosen This chapter gives an insight into these integration methods and when it may be appropriate to use them This chapter describes only the bare essentials of the methods used For a more detailed introduction see Press William H Flannery Brian P Teukolsky Saul A and Vetterling William T Numerical Recipes Cambridge University Press Cambridge 1989 Thefull story is provided by Gear C William Numerical Initial Value Problems Ordinary Differential Equations Prentice Hall Englewood Cliffs N J 1971 Stoer and Bulirsch R Introduction to N umerical Analysis Springer Verlag New York 1980 For details on Gear s Method3 14 00 see W Gear The Automatic Integration of Ordinary Differential Equations CommACM 14 3 pp 176 179 1971 Boundary conditions aker is designed to solve initial boundary problems i e sets of differential equations where only the initial value of a variable is Integration methods 31 Chapter 4 known The application does not solve two point boundary problems Consequently the remainder of this chapter comprises brief descriptions of how given an initial value and a differential equation M odelM aker uses t
56. mation 9 User Codes sete 13 w y Weighted sum of squares 56 Variance 90 Index
57. mponent or parameter M odelM aker will warn you but allow you to continue if you wish You can switch off this warning message by clearing Quiet M odel Editing in User Preferences Edit menu Several dialogs have two or three tabbed panels To open the individual panel click on the tab at the top of the dialog 8 Interface guide Chapter 2 Dialog To open Description About Select Help About Displays M odelM aker M odelM aker menu command version and license information Add Password Select Enter a password that must Protection File Password be entered when opening the Protection model Change Page Select Change Add a new namefor a data Page from RMB sheet menu on data sheet in M odel Explorer Component Double click Define the event trigger in Event Definition Component Event terms of the value of a model Trigger tab component Component Select Component Set line color and thickness Format Format Format from the and text alignment for tab RMB menu on any individual components component Component Select Component Set font attributes for Format Format Format from the individual components tab RMB menu on any component Component Select Evaluation Set the order in which order Order from the Events and DLL functions Component menu are evaluated during a model run Conditional Click Conditional Lists series of conditions and Compartment in Unconditional eq
58. ne help and context sensitive help for all views and dialogs The button provides pop up help for individual functions in dialogs To usethis e Click the icon in the main toolbar or in the top right of the dialog e Click on the item you wish to know more about In addition pressing F1 opens the main help file at the appropriate topic Quick reference guide The following sections provide a guide to all of the features of the M odelM aker interface including the use of keyboard shortcuts Toolbars the Main view Two toolbars are available The Main Toolbar which is always in view and the View Toolbar which changes depending on the current M odelM aker view on display You can customize the View Toolbars using the Customize feature opened from the View Toolbars Customize menu command by adding or removing 4 Interface guide Chapter 2 command buttons from the toolbars Details of the View toolbars are shown below Icon Command Open new model Open existing mode Savemodel to disk 4 Cut selected components or text to clipboard Copy selected components to clipboard Pastefrom clipboard Ec Create new graph opens graph selection dialog box Create new histogram for results of Monte Carlo run opens the Histogram selection dialog Create new table opens table selection dialog box Run active model ts View parameters Create new or edit existing parameters Ls Select component Click
59. nent is in error model will not run 22 Interface guide Using the Keyboard Chapter 2 Moving around and selecting table cells K ey combination Effect Arrow key Moves the direction of the arrow by one cell SHIFT 4 RROW Extends the selection by one cell CTRL RIGHT ARROW Moves right one screen CTRL4SHIFT4RIGHT ARROW Extends the selection right one screen CTRL LEFT ARROW Moves left one screen CTRL4SHIFT4LEFT ARROW Extends the selection left one screen HOME Moves to the beginning of the row SHIFT HOME Extends the selection to the beginning of the row CTRL HOME Moves to the top left hand corner of the page CTRL SHIFT HOME Extends the selection to top left hand corner of page END Moves to the end of the row SHIFT END Extends the selection to the end of the row CTRL END Moves to the bottom right hand corner of the page CTRL SHIFT END Extends selection to bottom right hand corner of page PAGE DOWN Moves down one screen PAGE UP Moves up one screen Interface guide 23 Using the Mouse Chapter 2 K ey combination Effect SHIFT PAGE DOWN Extends the selection down one screen SHIFT PAGE UP Extends the selection up one screen DELETE Deletes the contents of the selected cells Action Effect Click on a cell Moves selection to a ca
60. nimization convergence criteria Model Components events ModelMaker window description N Non linear regression Normality of errors Numerical accuracy Numerical overflow Operators arithmetic 5 25 27 precedence 25 49 convergence criteria 52 definition 50 guidelines 57 lambda te 83 local versus global minima 58 Marquardt theOLy d b RI 81 measurement of deviation 51 non linear regression 50 normality of errors 54 parameter constraints 53 IeCIDe e 52 51 termination 53 Optimization Results 51 Optimization Statistics deter tee ES 54 Order polynomial interpolation p PR CMS 45 Overflow numerical 53 P Parameter Estimation 58 Parameters constraint range 53 constraint range violation 54 Password Protection 9 Poles rational functions 46 Polynomial interpolation 45 P val ue i m tme 56 Q Quick reference guide 4 Qeyalue c eset 55 Q val
61. nter the Carlo menu number of trials to run command Non periodic Click New or Define or edit a non periodic Event Trigger Change under trigger for an independent Definition Non periodic event Triggers in Independent Event Definition Triggers tab Optimization Select Select Optimization method Run Modal Optimize error weighting and error estimation Start the optimization 14 Interface guide Chapter 2 Dialog To open Description Optimization Select Configure initial parameter Settings Model Configure estimation range and Estimation tab Optimization method Grid Search or menu or click Simulated Annealing Advanced from the Optimization Run dialog Optimization Select Configure optimization Settings Model Configure convergence and Marquardt Optimize tab Optimization settings Define a constraint menu or click equation may include Advanced from several parameters the Optimization Run dialog Optimization Select Configure data weighting Settings Model Configure and error ranges for Weightingtab Optimization optimization menu or click Advanced from the Optimization Run dialog Parameter Double dick Define constraint ranges for Definition parameter in parameters limits values Constraints tab Parameters view parameters may take during optimization minimization runs Parameter Double click Define parameter Symbol Definition parameter in and value
62. oint Optimization changes the model predictions by adjusting the parameters If the predictions are not very sensitive to changes in the parameters then it will be difficult to improve thefit Put another way ask yourself whether the data has something to say about the value of the parameters A set of data will beof limited valuein determining the value of a parameter which has only a marginal effect on the simulated values of that data This is particularly true when the data has significant errors associated with it Parameter Estimation Optimization will only give acceptable results if you have good estimates of the values of parameters to begin with If you do not know the values of parameters then you may choose to use one of the parameter esti mation algorithms included with M odelM aker These attempt to find good initial values of parameters before running the optimization The two methods are Grid Search and Simulated annealing Y ou can choose whether or not to use parameter estimation by selecting Initial Parameter Estimation in the Optimization Run dialog This activates the method options You can configure the methods in the Estimation tab of the Configure Optimization dialog opened from the A dvanced button on the Optimization Run dialog or the Configure Optimization command on the M odel menu You can set methods for individual parameters using the Parameter Definition dialog for each parameter On the Estimation tab select eit
63. order so that the errors are roughly comparable If they have solutions that are orders of magnitude apart then problems can arise In this case it may make sense to use a fractional error to normalize betw een the different scale equations The desired accuracy referred to earlier is determined by multiplying the accuracy requirement defined by the user by a scaling factor If Constant Errors is selected in the method setup this scaling factor is a constant that the user can set The default valueis 1 0 If Fractional Errors is selected then the scaling factor is the reciprocal of the function value 1 function value There is a tendency for this last option to appeal to most users as a first choice However they should be awarethat it encounters real problems if the function approaches or passes through zero In fact if the solution is zero then the method fails completely The third scaling method provided by M odelM aker is immuneto this problem it sets the error scaling equal to the magnitude of the solution plus its derivative times the step length yn dt Adjusting the step length for the Bulirsch Stoer method is done rather differently It is quite rare for a Bulirsch Stoer step to fail the whole technique is based around the idea of keeping on trying until you get there A djusting the step length is therefore a rather prosaic business In practice it is rarely useful to extrapolate beyond the last seven esti
64. over the range of interest to check out the method s behavior This can easily be done in M odelM aker see U ser M anual Check to see whether it s doing what you want Interpolation in lookup files and tables 47 Reference Chapter 6 6 Optimization Overview In any simulation modeling environment one of the most important questions to ask should be Is the mode correct or Does this model represent the observed system accurately A first step in validating a model might beto compare the output with observed real data M odelM aker allows you to do this by adding data to the Model data view If the simulated data does not match the observed data to obvious degree then there may be several reasons e The modal itself is incorrectly built i e has the wrong components e The model structure is correct but has the wrong equations e The model is more or less correct but the parameters have the wrong values M odelM aker includes statistical tools that allow some quantitative judgment to be made on just how close the model predictions are to the observed data However the user must decide whether the model structure and the equations used are correct Since most models are imperfect to some extent the decision is really whether the model is good enough If the output seems to fit the discrepancies may be reduced using M odelM aker s Optimization tools Optimization is the adjustment of parameter values to
65. own risk and in no event will Cherwell be liable to you for loss or damage of any kind except personal injury or death resulting from Cherwell s negligence including lost profits consequential or other loss arising from the use of or inability to use the Software or from errors or deficiencies in it whether caused by negligence or otherwise in excess of 125 of the price paid for the Software except as expressly provided in this License 5 5 If you deal as a consumer as defined in the Unfair Contract Terms Act 1977 your statutory rights remain unaffected iv ModelMaker End user license agreement 6 SUPPORT Cherwell s technical support staff will endeavour to answer any queries you may have about the Software Support contact details are given in the Schedule 7 LAW This License constitutes the entire agreement between you and Cherwell relating to the Software and is governed by and construed in accordance with the laws of England The courts of England shall have exclusive jurisdiction SCHEDULE Technical support is available directly from the ModelKinetix web site at http www modelkinetix com support Our web support database is constantly updated and we strongly urge you to explore the support options here before calling us In theunlikely event that you cannot find your answer on our web support database please call our UK office directly on 44 0 1865 784800 between the hours of 9 30 and 17 30 UK time Monday
66. p www modelkinetix com simply follow the links to Support Our Web support database is constantly updated and we strongly urge you to explore the support options here before calling us In the unlikely event that you cannot find your answer then please e mail us support modelkinetix com or call our UK office on 44 0 1865 784800 during normal office hours Telephone calls will belogged in our support system and you will be contacted subsequently with a solution or request for more information by e mail fax or phone ModelMaker vii Contents Contents 1 5 INTERFACE GUIDE eite becuase MATHEMATICAL REFERENCE INTERFACE REFERENCE J MODELMAKER WINDOW OVERVIEW 3 QUICK REFERENCE G DE ee IAES ESRA SREST SRETEN TANTER SREE Ea 4 TOOLBARS THE MAIN essen nan 4 TOOLBARS OTHER 7 THE DIAGRAM ICONS 8 DIALOGS STN ESSE TREE ES 8 SELECTING COMPONENTS sscccccccccssssseecccceeecussseeccccesseauaeceeccceeesauaneess 19 SCROLLING THE MODEL DIAGRAM 2 200 0 050000000000000 000044 19 KEYBOARD SHORTCUTS SELECTING PARAMETERS MODEL COMPONENT SHADING 1 000000000000000000 22 MOVING AROUND AND SELECTING TABLE CELLS eee 23 MODELMAKER 25 OVER
67. ps has occurred A convergent step occurs when RSS improves only marginally and the parameters do not change significantly If both of these conditions are true then the step is convergent If a step is not convergent i e RSS increases or decreases significantly or the 52 Optimization Chapter 6 parameters change significantly then the running total of convergent steps returns to zero The default number of consecutive steps required for convergence is 5 This is rather conservative For many problems lower value will be sufficient and may save considerable computing time Parameter constraints aker will attempt to impose constraints on the range of values the parameters to be optimized can take This is to try and prevent completely unrealistic values being used that would cause the mode to fail thereby terminating the optimization attempt You can override these by setting your own constraints using the Parameter Definition dialog If a parameter hits its constraint it will usually return to a more reasonable value If however the parameter continues to bump into the constraint for a user defined number of times the optimization will halt see O ptimization termination below A constraint range can be defined for each individual parameter which will over ride the default constraint range defined for the optimization process Optimization termination The optimization process may stop before convergence o
68. r selected for adjustment Assumption of normality Marquardt as implemented in M odelM aker assumes that the errors on your data are normally distributed In practice you can usually get away with errors that are more or less normally distributed without any dire consequences fact the estimates of the parameters are usually reliable even if the data has errors that are not at all normal in their distribution However this does not apply to information derived from the covariance matrix such as the uncertainty estimates on the parameter values In such circumstances these should be viewed with caution Optimization statistics How well does the model fit the data M odelM aker provides three main ways of assessing this After performing an optimization run two new views are created under Results in the M odel Explorer These are Parameter Results and Optimization Statistics Click the latter to view the statistical analysis of the optimization run 1 Sometimes the situation occurs where the parameter is continually increased 54 Optimization Interpreting Q Chapter 6 The first measure of the goodness of fit can be obtained from the Sum of Squares value This can be looked up on a x2 table with degrees of freedom equal to the number of data values minus the number of adjusted parameters This gives the Q value the probability that the difference between the model and the data has occurred by chance To avoid th
69. r that is to be minimized is evaluated at each of the simplex s corners The corner which has the highest value is moved through the opposite side to create a new simplex and the process is repeated by contracting or expanding the simplex as outlined below This can be illustrated with an example Consider the calculation of y which depends upon the values of the parameters a and b f a b We make a guess for initial values of a and b in order to position the first point of the simplex in the two dimensional space point x 84 Marquardt and Simplex theory Appendix Deuess b To construct the other two points for the simplex coordinates of a Aa b and a b Ab are used as shown in the above diagram In M odelM aker the values of Aa and Ab are calculated using the value in the fractional change field of the Advanced tab of the Minimization Configuration dialog box By default the value used is 0 001 which means that Aa 0 001 x a The function is then evaluated at each corner of the simplex and the worst i e the largest point identified This point is then reflected through the opposite side of the simplex Essentially this process is repeated until the minimization is judged to have converged However depending upon the value of the new corner the simplex may have expanded or contracted If the new corner is now the best the simplex is expanded in that direction by a factor of two If it is the worst the simplex i
70. rder Runge Kutta method This is probably the most popular numerical method of all for solving differential equations and is the default method used by M odelMaker Runge K utta specifically 4th order Runge Kutta involves four evaluations of the derivatives of the function once at each end point and twice in the middle see diagram below e First the derivative at the beginning of the interval position 1 is calculated and used to estimate the function at the midpoint position 2 mid point method style Thederivative is then calculated at this mid point and applied from the beginning of the interval to arrive at another estimate of the mid point position 3 Thederivative is recalculated at this second estimated mid point and the new valueis applied from the start of the interval to calculate an initial estimate of the function for the end of the interval position 4 e Finally the actual estimated value of the function at the end of the interval yn 1 is calculated by combining the derivatives taking 1 3 of the value of each of the two mid point derivatives and 1 6 of each of the two end ones Algebraically d d d H AL Yra Yn 3 3 2 where 115 the derivative evaluated at position 1 d2 is the derivative evaluated at position 2 d3 is the derivative evaluated at position 3 d4 is the derivative evaluated at position 4 At is the time step Runge Kutta is a particularly robust method It is un
71. rdt also known as Levenberg M arquardt e Simplex 50 Optimization Chapter 6 The default regression method used by M odelM aker is the Marquardt method The measure of deviation used by M odelM aker is the residual sum of squares RSS defined as m 0 RSS 1 where is the value of the ith observation i is the error estimate for that observation and is the mode prediction for that observation M odelM aker offers three main alternatives in the Optimization Run dialog e Ordinary least squares wheree 1 e Weighted least squares where is set by the user in the Optimization Settings dialog opened using the Advanced button in the Optimization Run dialog Weighting tab e Extended least squares where the error is assumed to have the form 1 whereo and are values to be found by ModelMaker When Extended Least Squares method is used values of o and for each component configured in the model data view are displayed in the Optimization Results view under Results in the Mode Explorer A fourth option is to check Reasonable error estimates in the Optimization Run dialog This grays out the individual options and accepts the error weightings chosen by the user in the Optimization Settings dialog as being reasonable estimates and takes these values as they stand Hence this is a weighted least squares with fixed error estimates If Reasonable error estimates is not
72. s and workmanship under normal use for a period of 90 days after the date of original purchase If a defect in any disk occurs during such period you may return it with proof of purchase to Cherwell who will replace it free of charge 5 2 Cherwell warrants that the Software will perform substantially in accordance with its accompanying documentation provided that the Software is properly used on the computer and with the operating system for which it was designed and that the documentation correctly describes the operation of the Software in all material respects If Cherwell is notified of any material error in the Software during the period of 90 days after the date of original purchase it will correct any such error within a reasonable time or at its option refund the price of the Software against return of the Software and its documentation 5 3 The warranties set out in clauses 5 1 and 5 2 are your sole warranties and are in place of all warranties conditions or other terms expressed or implied by statute or otherwise all of which are hereby excluded to the fullest extent permitted by law Clauses 5 1 and 5 2 also set out your sole remedies for any breach of Cherwell s warranties 5 4 In particular Cherwell does not warrant that the Software will meet your requirements or that the operation of the Software will be uninterrupted or error free or that all errors in the Software can be corrected You load and use the Software at your
73. s assigned to the defined lookup The current lookup file name is used as the default value GetFileN ame esage text Titletext Lookup File Value If the entered file name is valid GetFileN ame assigns the file name to the specified lookup file SetFileN ame M essage GetChoice GetValue GetPage The message box displayed contains three buttons OK Find and Cancel Pressing OK causes aker to validate the file If the file is valid it is assigned to the specified lookup file and the model run continues If thefileis invalid an error message is displayed and the user prompted to enter another file name Pressing Find will invokethe Find File dialog box and pressing Cancel stops the model run The M essage text and Title text fields can contain both ordinary text and formatting commands which define how the following values are displayed see M essage Text Formatting earlier in this chapter GetFileN ame Which data file is to be used for i Meteorological Data data 1993 To prompt the user for a lookup table page number Using Event Actions Syntax Return Value See Also Comments Example GetValue Purpose Syntax Return Value Chapter 8 using a message box containing the specified formatted text If the entered page number exists the page becomes the active page defined for the lookup table The current lookup table page number is used as
74. s contracted by a factor of two in that direction If itis still the worst the simplex is contracted about the best corner In ModelM aker the process is judged to have converged when a certain number by default 5 of consecutive convergent steps have occurred A convergent step is one where the value being minimized gets smaller but only by a small amount by default less than 1094 Marquardt and Simplex theory 85 Index A Accuracy and optimization termination cube venice aioe 53 1 1 26 Analysis of 1 56 versus O 57 Argument of a function 28 B Boolean expressions 26 Bulirsch Stoer 35 C Compartments initial values 27 Component Shading 22 Components compartments initial value 27 parameters constraint range 53 Conditions 26 relational operators 26 Constraint range violation optimization 53 54 Convergence criteria 52 85 Cooling Schedule 60 Curvature matrix 81 83 D Deviation measurement of 51 Dialogs descriptions esses 8 lis ofi tete 9 DLL functions 61 DLL Functions Index Index function information 65 222 6
75. s off 78 Using Event Actions Syntax Return Value See Also Comments Example TraceOn Purpose Syntax Return Value See Also Comments Chapter 8 TraceO ff level level None TraceM essage TraceOn If tracing is enabled ModelMaker turns the specified tracing levels off so that any TraceM essage actions which specify any of the levels will be ignored and not output to the configured trace file TraceOff 1 3 5 To turn the specified trace levels on TraceOn level level None TraceM essage TraceOff If tracing is enabled M odelM aker turns the specified tracing levels on so that any TraceM essage actions which specify any of the levels will be processed and output to the configured trace file Using Event Actions 79 Appendix Appendix Introduction to Marquardt and Simplex Theory Marquardt theory Marquardt also known as Levenberg M arquardt is the method of first choice for non linear regression in the same way that Runge Kutta is the first choice for solving differential equations numerically Before briefly outlining the Marquardt method it is worth reviewing Taylor s series theory This says that any function f x close to a given point x can be approximated by the series 2 df FG RAD ST OUR it 32 In our case the function of interest is 72 as a function of the model s parameters a There can be more than one adjustable parameter so a
76. t Value Change on DFF DLL as an equation or model Definition definition Values component value tab Event Definition Double click Define the actions using Actions tab Independent or odelM aker script Component Event commands that will occur when the event is triggered Event Definition Double click Define the Event symbol Definition tab Independent or status and class Component Event File Format Click File Configure data file used as Definition Format on lookup or model data Lookup File Definition or Import File dialog Find Select Edit Find Select component to locate Component Component on the model useful when editing large models Global Click Series Displays Global Sensitivity Sensitivity Statistics in the Results after a M onte Carlo Results Histogram series run dialog Graph Click the Set the background and Attributes Attributes icon on frame colors for the graph Configuration the Graph General tab Toolbar Interface guide 11 Chapter 2 Dialog To open Description Graph Click the Add the legend text set text Attributes Attributes icon on characteristics and position Configuration the Graph Legend tab Toolbar Graph Click the Add the title and set text Attributes Attributes icon on characteristics and position Configuration the Graph Title tab Toolbar Graph Selection Click Graph icon Select components whose on th
77. t be a symptom of errors which are rather non normal A value of say 0 1 is very encouraging High values of Q i e tending to 1 0 are basically too good to betrue They usually arise through overestimating the errors or fudging the data A useful rule of thumb is that x should be roughly equal to the number of Optimization 55 Analysis of variance Chapter 6 degrees of freedom the number of data values minus the number of adjustable parameters The second very common way to assess goodness of fit is to use an analysis of variance for the model This partitions the total variation in the data into the variation explained by the model and the residual variation If the residual variation is small compared to the total variation the model is doing a good job of describing the data The information is summarized in the Optimization Statistics view displayed under Results in the M odelM aker Explorer The columns of this table are the two components of variation M odel and Residual and their total the total variation in the data The statistics presented in the table are e Degrees of freedom DF e Weighted sum of squares WSS This is the variation attributed to each component e The mean square MS This is the variation per degree of freedom i e MS 2WSS DF Thevarianceratio or F Value where F Model MS Residual MS The higher the value of the variance ratio the less likely it is that your model has expl
78. t is really known is how much better it is than the full size step The only way to find out would beto take even smaller steps i e do more work 36 Integration methods Chapter 4 Although step halving involves a lot more computation this is unavoidable if the advantages of step length control are to be gained and in general these advantages greatly outweigh the costs However the overheads are not as great as might be first thought because for each of the methods some of the derivative evaluations can be used for both the full and the half steps The estimate of error which we shall term is used to adjust the step length by comparison with a desired accuracy The relationship used to make this comparison depends upon the method being used because the methods vary in the order of their error term Euler has a second order error term meaning that the error is roughly proportional to At2 In other words its error is only one order less than the solution itself The mid point method s error term is third order so the error is much smaller in relative terms The Runge Kutta error term is fifth order This all means that the accuracy improvement resulting from the same change in step length is greater for Runge Kutta than for mid point which is in turn greater than for Euler Consequently the way in which the step lengths are altered to adjust the error for each step varies across the different methods For atime step At produ
79. th resulting number If an error occurs the model run is terminated with an appropriate error message SetPage M et data page index SetFileName Purpose Syntax Return V alue To set the file name for the specified lookup file SetFileN ame Lookup Filename Value If the specified file name is valid SetFileN ame assigns Using Event Actions 77 Chapter 8 the file name to the specified lookup file See Also GetFileN ame Comments ModelMaker formats the specified text see essage Text Formatting earlier in this chapter and attempts to load the file with resulting name If an error occurs the model run is terminated with an appropriate error message Example SetFileN ame M et data met i dat year TraceMessage Purpose To output a message containing the specified formatted text to the configured trace file Syntax TraceM essage level M essage text Titletext Value Return Value None See Also TraceOn TraceOff Comments If tracing is enabled and the specified trace level is active the formatted message text is output to the configured trace file The TraceM essage text field can contain both ordinary text and formatting commands which define how the following values are formatted see M essage Text Formatting earlier in this chapter Example TraceM essage 1 Tital is f at time f running total t TraceOff Purpose To turn the specified trace level
80. the default value GetPage essagetext Titletext Lookup Table Value If the entered page number is valid GetPage make the pagethe active page of the specified lookup table QueryPage SetPage The message box displayed contains two buttons OK and Cancel Pressing OK causes M odelM aker to validate the entered page number If the page exists it become the active page for the specified lookup table and the model run continues If the page number is invalid an error message is displayed and the user prompted to enter another page number Pressing Cancel stops the model run essage text and Title text fields can contain both ordinary text and formatting commands which define how the following values are displayed see M essage Text Formatting earlier in this chapter GetPage Which page of data is to be used for i Meteorological Data Met data 1993 To prompt the user for a value by using a message box containing the specified formatted text If the entered value satisfies the given validation condition it is assigned to the defined component The current value of the component is used as the default value GetValue M essagetext Titletext Component Condition Value If the entered value is valid GetValue assigns the Using Event Actions 73 Chapter 8 See Also Comments Example Initialize Purpose Syntax Return Value See Also Comments 74 valu
81. to Friday inclusive excluding UK public holidays Telephone calls will be logged in our support system and you will be contacted by e mail fax or telephone with a solution or a request for more information E mail support queries should be sent to support modelkinetix com ModelMaker V Copyright Publisher Disclaimer Trademarks ModelKinetix com web site Technical Support Important information 2000 Cherwell Scientific Ltd All rights reserved No part of this publication or the program M odelM aker may be reproduced transmitted transcribed stored in a retrieval system or translated into any language or computer language in any form or by any means electronic mechanical magnetic optical chemical manual biological or otherwise without prior written permission of the publisher M odelM aker is published by Cherwell Scientific Limited The M agdalen Centre Oxford Science Park Oxford OX4 4GA Cherwell Scientific Ltd make no representations or warranties with respect to the contents hereof and specifically disclaims any implied warranties of merchantability or fitness for any particular purpose All trademarks and registered trademarks are the property of their respective companies For technical support Frequently A sked Questions FA Qs or product information please visit our web site at http www modelkinetix com Technical support is available directly from the M odelKinetix com web site at htt
82. to the diagram below 5 A X XE x 2 2 e Interval Start Suppose we require value of y in the region x1 lt x x If interval start is used then the value of y applies across the whole interval e Interval End Suppose we require a value of y in the region x x lt X2 Under interval end the value of y2 applies over the whole interval e Interval Center Under this rule a y value is used over the half interval above and the half interval below its corresponding x value For example the value of y2 applies from the midpoint between x and x2 to the midpoint between x2 and xs i e over the range XX genti 44 Interpolation in lookup files and tables Chapter 5 Linear interpolation Linear interpolation uses information from two points to estimate values between them As the name suggests it involves taking the straight line between the two values and using this to calculate the value of y at any intermediate x The method is very quick and simple but has the weakness that it can be rather discontinuous at the tabulated values as shown in the example below In some situations this can be a limitation litres s 40 Flow Polynomial interpolation Polynomial interpolation involves using information from points other than those bounding the interval of interest to definea polynomial which then gives an estimate of y for intermediate x For example a cubic
83. trl C Copy selection to clipboard 20 Interface guide Chapter 2 Ctrl V Paste from clipboard into current model Dd Deaete selected component s Ctrl L View top level model main Ctrl N View parent model from sub mode view Ctrl G Create new graph opens Graph Selection dialog box Ctrl T Create new table opens Table Selection dialog box Ctrl D View definitions Ctrl P View Parameters Ctrl Zoom in Ctrl Zoom out Interface guide 21 Chapter 2 Selecting Parameters Before a parameter may be defined or edited it must be selected M ouse K ey combination Effect Mouse click on unselected parameter or parameter array range Parameter or range selected all others deselected SHIFT mouse click on unselected parameter or parameter array range Parameter or range is selected any existing selection remains SHIFT mouse click on selected parameter or parameter array range Parameter or range is de selected any existing selection remains Mouse click outside parameter or parameter array range All Parameter and ranges de selected Model component shading Shading Interpretation Blue diagonal lines Component is empty model will not run Green diagonal lines The component is global Green cross hatching The component is universal Red cross hatchi ng Compo
84. ts must be component events The event which uses this action must be universal global or be connected to each of the events in the specified list by an influences EventQuery will evaluate a specified event even if it is deactivated EventQuery Lake Full Event Pollution Event To prompt the user to make a Yes No choice using a message box containing the specified formatted text Component G etChoice essage text Title text Value Component 1 0 if Yes is pressed Component 0 0 if No is pressed Message GetValue GetFileN ame The message box displayed contains three buttons Yes No and Cancel Pressing Yes or No will return the values 1 0 or 0 0 respectively and allow the model run to continue Pressing Cancel stops the model run The Message text and Title text fields can contain both ordinary text and formatting commands which define how the following values are displayed see M essage Text Formatting earlier in this chapter Using Event Actions 71 Chapter 8 Example halt GetChoice Total production has reached 3f tons on day 96i Do you want to halt production Question produce t GetFileName Purpose Syntax Return V alue See Also Comments Example GetPage Purpose 72 To prompt the user for a lookup file name using a message box containing the specified formatted text If the entered file name exists and is a valid lookup file it i
85. uations for Compartment Definition Compartment Definition Interface guide Chapter 2 Dialog To open Description Conditional Click New or Define condition and Equation Change corresponding equation for Definition Conditional Conditional Component component definition Debug Select Debug Lists debugging information Information Information from Model menu you must have Collect Debug information selected in User preferences dialog and have run the model Delay Definition Double click Define a delay in terms of a Definition Tab Delay symbol the component whose value is to be delayed an initial value and the maximum delay Distribution Click the Select the distribution type button in the and add distribution Parameters view characteristics for M onte when Monte Carlo Carlo analysis is selected for a parameter DLL Definition Doubleclick a Define a DLL symbol the DLL tab DLL component path to the DLL file and the name of the function being called You can also define the function type 10 Interface guide Chapter 2 Dialog To open Description DLL Definition Doubleclicka Lists input values equations Values tab DLL component or model component values passed to the DLL and output values as symbols that may be accessed by other model components DLL Function Click N ew or Define an Input Value for a Inpu
86. ues 2 ot ees 55 55 R Rational function interpolation46 Reference Integration methods 31 Interpolation 43 Optimization 49 Regression non linear 50 Relational operators 26 55 Residual Mean Square definition 52 Residual Sum of Squares 51 r squared value 56 Je Wis ic eoe eee tetas 57 Runge Kutta 33 S Selecting components 19 Simulated Annealing definition 59 Speed calculation 39 Step halving integration 36 Step length integration 1 37 Control insane 36 Sum of squares weighted 56 T Table Cells selecting acaron cisa 23 Taylor s series 81 Technical support vii Temperature Step number of trials per 59 Temperature Steps max 59 Termination Criterion Simulated Annealing 60 Toolbars customization 4 icon definitions 4 89 Index 0 3 analysis of versus 57 U Variance ratio 56 Version infor
87. uite commonly in the complex plane near to the real point where you want to interpolate the function Such a nearby complex pole can upset polynomial interpolation in a way that rational functions can resist Rational function interpolation is useful then for interpolating badly behaved functions while retaining the smoothness advantages of conventional polynomials Choice of interpolation method There is no definitive answer to the question of which interpolation method to use As ever everything depends upon circumstances However thefollowing points are worth bearing in mind e Interpolation is about estimating intermediate values using completely arbitrary functions Everything therefore depends on the nature of the function you are interpolating Sudden jumps and kinks in interpolated values can sometimes upset other numerical methods M odelM aker may be using particularly for solving your differential equations e Higher order polynomials are smoother because they stiffer Like an oil tanker they cannot turn corners quickly If you want a 46 Interpolation in lookup files and tables Chapter 5 lot of sharp changes you may find them smoothed out by a 4th order polynomial e Very high order polynomials are erratic and can oscillate spectacularly in between your tabulated values whilst still passing through them e tis always wise to plot out interpolated variables preferably using a fine output interval
88. ws export function name 62 Handling DLL functions Chapter 7 Function Parameters The parameters passed to a DLL Function are as follows input_length A 4byte integer containing the number of elements in the input_values array This is the number of input values defined for the DLL function component plus e 2for Normal DLL functions e 3for Integrate DLL Functions input_values A far pointer to an array of 8 byte floating point values double with the following structure depending on the type of the DLL function component Normal Integrate Window handle Window handle Independent variable value Independent variable value at the start of the step First input value Independent variable value at the end of the step Last input value The window handle is the handle of the main M odelM aker window and allows the DLL to display a message or dialog box if required Handling DLL functions 63 Chapter 7 output_length A 4byte integer containing the number of elements in the input_values array This is the number of output values defined for the DLL function component output_values A far pointer to an array of 8 byte floating point values double with the following structure First output value Last output value Function Return Value The return value of the DLL function is defined as follows zero The function has completed successfully and the model run should continue non zero The
89. ying equation 4 Therefore by varying the value of the Marquardt method can smoothly move between a direct solution to the minimum and a gradient descent When performing an optimization run then the user can select the initial value of lambda in the Optimization Settings dialog Marquardt and Simplex theory 83 Appendix The simplex method A simplex is a geometrical figure that in dimensions has N 1 vertices so in two dimensions the simplex has 2 1 3 vertices and is a triangle In three dimensions it is a tetrahedron Each dimension represents a parameter whose value is to be adjusted Simplex is used in two areas in ModelMaker The first is in optimizing a model and the second is in minimizing a model component In the former we are minimizing the difference between observed and calculated values of components In the second we are minimizing the value of a single component In both cases the result is achieved by changing values of parameters What follows is a general discussion on the implementation of Simplex minimization In minimization the simplex is applied in a very simple fashion The simplex is positioned by making an initial guess at the parameter values An initial guess is always required for multi dimensional minimization and optimization In addition to an initial position the characteristic scale of the problem has to be guessed in order to give the sides of the simplex a length The component or erro
90. ymbols controlled by the independent variable ModelMaker arithmetic 27 Chapter 3 Numerical accuracy M odelM aker uses 8 byte reals for all its arithmetic operations e Thesmallest value that can be computed is 1 7x10308 Any operation that results in a smaller number gives a result of zero Thelargest value that can be computed is 1 7 103 Any operation that results in a number greater than this produces an error message e All calculations maintain numerical accuracy to the first 15 significant digits Functions M odelM aker supports a library of standard mathematical functions The syntax for using these functions in equations is very straightforward you simply enter the function name and the function argument s in brackets An argument is a value acted upon by the function If required this can be an expression in which case it is evaluated before being passed to the function The Available Functions list box in the various component definition dialog boxes lists all the functions that M odelM aker provides along with their syntax If the result of a function cannot be calculated then the model run halts and an error message is presented telling you which function has failed Mathematical functions in ModelMaker Thefollowing table lists the mathematical functions available when constructing equations and conditions in M odelM aker Function Remarks abs x Calculates the absolute value of x 28 ModelMaker
Download Pdf Manuals
Related Search
Related Contents
Fondo Social para la Vivienda-FSV IPC-POA100D 取扱説明書 Cámara AutoDome HD PTZ Serie 800 Si-R brinシリーズ 機能説明書 - ネットワーク User`s Manual User manual for T06A SEPTEMBRE - OCTOBRE NOVEMBRE 2015 Copyright © All rights reserved.
Failed to retrieve file