
DMSolver & related productsOverview DMSolver 6.0 (Dynamic Modular Solver) provides a programming language and algorithm for solving large (or small!) sparse systems of nonlinear simultaneous equations. As such, it provides a "solver engine" for the simulation of complex (or simple!) systems, generally of the continuous type. It operates in the Windows 32bit environment and guides the user in preparing input, but allows for large or complex mathematical models. For simple problems a newforV5.3 methodology may let the user avoid programming in DMSolver's native language, Pascal, entirely, whereas for more complex problems the user has to fill in the programming framework provided. In going from versions 5.x to 6.0 we have simplified the system so that the userwritten portion no longer is a separate command line program, and we have introduced parallel processing in part of the algorithm so that 2 of your cpu cores act simultaneously. The combination of these changes has approximately doubled the speed of the algorithm, important with large problems. You can now try a downloaded DMSolver package free for 60 days. "Modular" refers to the ability of the user to predefine a "module", a block of equations and variables, and link each instance of the module into the model with a single line of code. For some applications a user may link a vector of modules into the problem with a single statement. Steady state ("static") problems are modelled by sets of simultaneous algebraic equations, although an "equation" can optionally be a whole procedure (i.e. subroutine) with few limits to its complexity. Dynamic problem code is that which contains calls to the DMSolver integrator procedure, and so dynamic models contain one or more ODE's. "Addins" are available to extend the use of DMSolver for leastsquares estimation of model parameters and constrained optimization of some objective function which the user defines. Within some limitations the user can program his/her own "addin". For v6.0 a new user interface for creating estimation problems has been added. At various times trial investigations have been made for: ** "Plug flow" (or equivalently, batch) chemical reactors  multiple components, multiple reactions, dynamics over reaction time, estimation of parameters. ** Systems of stirredtank chemical reactors  multiple components and reactions  including heat transfer and product separation, steady state or dynamic with attached feedback control, estimation of parameters. ** A biologist's model for intracellular reaction and mass transport, leading to an oscillatory result resembling circadian rhythm. ** Distillation modelled as a series of many equilibrium (or nonequilibrium) stages  (a) Steady state (the "Distillation Guide" software) or (b) nonsteady state (an unpublished test program) ** Compression, expansion, and separation of light hydrocarbons. ** The steadystate process plant model for dealkylation of toluene to produce benzene, as described in a number of chemical engineering books and papers. ** Models of economic behavior where production and consumption of various commodities and growth of production capacities are assumed to depend on current and past commodity prices and states of the economy. ** The BOAT3D equations for planing boat motion  3degreesoffreedom rigidbody 2dimensional motion with added mass analysis over 40 boat segments in series (see our technical paper on BOAT3D) ** 6degreesoffreedom motion of a rigid body in 3dimensional space with driving forces expressed in body coordinates ** A model of a vibrating guitar string represented by a chain of elastic segments. ** Interacting electronic components connected in circuits. Only some of these types of problems have actually been refined and received practical use, but we hope this gives the reader some idea of what DMSolver can do. By "large" we mean that DMSolver can routinely handle problems with several thousand variables, and arrays within it are dimensioned to hold up to 10,000 variables. To test modifications of the leastsquares estimation addins, the four test cases in chemical kinetics analysis from the EUROKIN Consortium were used. These show the utility of DMSolver in chemical kinetics and reactor design modelling. Case 1 includes batch reactors and CSTR with the same reactions. Case 2 has a plug flow fixed bed reactor and uses a masstransferlimited, heterogeneous catalytic liquidphase reaction model. In Case 3, 20 rate equations are being screened to see which one is most appropriate. Case 4 concerns a tubular reactor with axial heat and mass dispersion. In Case 1 the DMSolver simultaneous problem has 8 (batch) or 6 (CSTR) simultaneous variables, in Case 2 there are 10, in Case 3 there is 1k and in Case 4 there are 794. If you download our technical report on this work as well as the EUROKIN paper, you can see the test cases as they were posed as well as the DMSolver source code and portions of the DMSolver output. DMSolver SteadyState Flowsheet Toolkit (FT) is a set of tools working with DMSolver (previously PMSolver) to simulate steadystate chemical engineering systems. Modules for flash, distillation, heat exchange, and other operations are provided, along with physical property routines. FT automatically generates source code for a system containing these standard modules after the user has used appropriate specification menus. The user may write specialpurpose modules, such as reactor modules, for the system. Due to lack of interest FT is not currently supported, but there is a possibility of reviving it. Distillation Guide (SelfContained) and BOAT3D are programs which incorporate DMSolver technology adapted for specialcase use where the user normally does not have to concern themselves with Solver details or source code. BOAT3D is available and supported, whereas Distillation Guide is not. Home  Top  Technical  Chemical Engineering Overview  Using FT
Form of Equations: The normal form of Solver equations is X_{i} = f_{i}(X_{j1}, X_{j2}, ....) i.e. Variable X_{i} is a function of a set of other simultaneous variables (and not itself). The function f_{i} is implemented in a procedure (i.e. subroutine) which computes X_{i} from X_{j1}, X_{j2}, etc. Any set of computational steps can be used as long as the result X_{i} is continuous and continuous in first derivatives with respect to the X_{j1}, X_{j2}, etc., so we are actually not talking about an "equation" in the narrow sense of something that can be written down in one line. In some cases it is awkward to put all equations in the above form, so a usable alternate form which involves some extra overhead is C_{i} = f_{i}(X_{j1}, X_{j2}, ....) where C_{i} is a userspecified constant. For static problems all the functions f_{i} are defined in the problem source code, but dynamic problems can make use of several built into the system, including an integrator with respect to time. Solutions of a set of ordinary differential equations can be integrated with respect to time from an initial state by using calls to these builtin procedures and other timerelated features of DMSolver. Solver Source Code DMSolver provides a convenient editor window for the source code. If the user starts out to define a completely new problem, a "skeleton" source code file is supplied to which the user needs to add details. Our original software for static problems only was called PMSolver  Pascalbased Modular Solver. When PMSolver and DMSolver were designed Pascal was the best computer language to use. This is still true even though there are more options now. We feel that anyone who has worked with Basic, Fortran, or C can easily learn the subset of Pascal features used in basic DMSolver language, which is plain Pascal except for certain special keywords indicating simultaneous system structure. Pascal is "freeformat" as far as the arrangement of statements goes, and there is a mix of features which variously have parallels in Basic, Fortran, and C. Before 2005 the DMSolver user had to own a (sometimes very expensive) license to the Borland Delphi Pascal compiler, but now the user can get a professionalgrade compiler from the opensource Free Pascal project started by Florian Klaempfl in Europe. Using the Solver: When the user clicks on the appropriate buttons the source code for the problem is preprocessed and compiled, resulting in the Solver program .EXE file and what we call a "problem" (.PRB) file. A PRB file contains a list of variable names with the current value of each variable and other information. If variables are expected to have widely differing magnitudes, the user must enter scale factors for the variables and these are also contained in the PRB file. The Solver uses a Newtontype algorithm, so most nonlinear problems require some type of initial estimate of variable values. For dynamic problems initial conditions are specified at this time. There is a standardstyle "Display/edit" window with numerous menu commands to select categories of variables or constant problem parameters and view and change their values. When the Newton's algorithm is activated it attempts to reduce the equation errors (which also appear in the Display/edit window) to zero. For dynamic problems the initial solution obtained by the first application of Newton's algorithm becomes the initial condition point for integration with respect to time. As integration proceeds, DMSolver writes solution variables as functions of time to a file (with extension TTR). These can be examined and plotted on the screen as functions of time using a utility program, TTRView. (With Windows multitasking, you can be examining a section of solution while DMSolver is continuing to add to the file.) When a dynamic solution is complete, selected portions of it can be converted to EDTECH database (DSF) format for presentationgrade plotting with EDTECH. Topics seldom mentioned in discussions of simulation are that it is very easy to accidently devise a problem which has no solution, and that, even if the problem formulation is correct, on the way to a solution the current estimate of the solution point X may wander into forbidden territory, e.g. where the calculations include taking the logarithm of a negative number, dividing by a value too close to zero, etc. In the ~20+ year development history of the Solvers strategies have been developed for coping with these problems. Basically, the approach is to avoid total collapse of the program by special ways of avoiding taking the log of a negative, etc., and then letting the user have the ability to fully examine the unconverged problem values in an attempt to diagnose difficulties. DMSolver has an automatic adaptive method for coping with "stiff" dynamic problems. Additional Solver Information:
Maximum Problem Size:
Additional Software Requirements:
System & RAM, etc. Addin Features: These have been adapted to Versions 6.0. Also, users can create their own addins through the addin "User Batch Procedure" which lets you proceed through a complex sequence of steps automatically. *** Static nonlinear leastsquares addin allows the estimation of system parameters by fitting static Solver solution output to data. *** Dynamic nonlinear leastsquares does the same for dynamic solutions. *** The static constrained optimization addin adjusts several problem parameters, searching for a minimum or maximum value of an objective function which you specify. The values of the adjustable (i.e. decision) parameters are constrainable between lower and upper bounds, and optionally, you may specify several other functions which are constrained to be either less than or greater than specified constants. 