BEDSOCS(ID:4161/bed001)


for Bradford EDucational Simulation language fOr Continuous Systems

Extension to Dartmouth BASIC to enable modelling

Geoffrey Brown, University of Bradford 1973


Related languages
BASIC => BEDSOCS   Extension of

References:
  • BROWN, G. "BEDSOCS MARK I Reference Manual", Postgraduate School of Studies in computing, University of Bradford, August 1973. view details
  • Eidelson, AF and Robinson, IJ "Implementation of BEDSOCS: an interactive simulation language" view details Abstract: BEDSOCS, an interactive digital computer language that is designed to allow the easy solution of problems described by ordinary differential equations, is used to run PHYSBE (a benchmark program that simulates the human circulatory system). A comparison chart compares BEDSOCS with other simulation systems in time required to execute PHYSBE.

    Extract: BEDSOCS
    Bradford Eaucational Simulation language for Continuous Systems (BEDSOCS), is an interactive digital computer  language designed to allow the easy solution of problems described in terms of ordinary differential equations. The language uses Dartmouth BASIC as the procedural language and, like most BASIC systems, operates interpretively. BEDSOCS has such advanced features as automatic equation sorting, variable-step integration and graphic displays. The equations describing the simulation need not be represented in terms of block diagrams, but rather are entered much like ordinary differential equations. Above all, because BEDSOCS uses an interpreter, there is no compilation time. This allows users to write and debug programs quickly at the cost of longer execution time.
    BEDSOCS, written by Geoffrey Brown (1973) at the University of Bradford, can be implemented on an HP2100 computer having 16k words of memory. The system uses HP BASIC as a subset and supports floating point firmware and a Tektronix storage display. Many options are available for implementing BEDSOCS. However, the authors used a single user version distributed on paper tape. Using BASIC as a subset, BEDSOCS partitions a program into a control region, which contains BASIC statements, and a dynamic region, which describes the representation of the system to be simulated.
    In the control region the user can program in BASIC to establish initial conditions, set control variables and perform general computation and input/output. The dynamic region contains the representation of the set of differential equations.
    The control region is divided into the initial region and the terminal region. The initial region precedes the dynamic portion of the BEDSOCS program and is used to set initial conditions and control variables to be used in the dynamic region. The terminal region is executed when the simulation is completed. This region is generally used to perform final calculations, print results, or loop back for iterative differential equation solving runs. The dynamic region of a BEDSOCS program contains the 'representation set'. This is a set of equations and procedure blocks representing the simulation to be performed. Fig. 2 shows a typical procedure block, enclosed by the 'PROCED' and 'PROEND' statements. The 'PROCED' statement has the form:
    (statement no.) PROCED (output list) = (input list)
    where the (input list) contains the dependent variables used within the procedure block and the (output list) contains the dependent variables which are assigned values by the procedure block. Within a procedure block, the user may describe nonlinear functions or other operations involving any BASIC statement just as in the control region. There may be any number of procedure blocks within a BEDSOCS program. However, a variable may not occur in the output list of two procedure blocks. Inputs and outputs of procedure blocks are sorted just like those of a defined variable equation. Equations of the representation set differ from BASIC statements in their location and form. These statements are not preceded by the 'LET' identifier of BASIC and they are automatically sorted into a BASIC program which evaluates derivatives and then updates state variables (integration). For example, the following differential equation may be expressed in BEDSOCS with the aid of the 'DER' identifier.
    dxZ/dt2 - 5x + 3 = y
    In BEDSOCS
    300 DERZ= Y - 5 * X + 3
    310 DER X = Z
    or
    300 W = 5 * X - 3
    310 DERZ= Y- W
    320 D E R X = Z
    These simple equation statements combined, if necessary with procedure blocks, make it very easy to describe complex systems. Since BEDSOCS is interpretive, it is executed without compilation. When the user types 'RUN', BEDSOCS checks the program structure, creates the symbol table, sorts the representation set and initialises the independent variable or variables to zero. As this initial setup is performed, errors are displayed on the user's console with the number of the line where the error occurred. Execution continues procedurally
    region is split into two sections, a procedural part and the representation set.
    When control flows into the dynamic region, it encounters the first procedural section. This region (transparently to the user) repeats derivative calls and integration steps as determined by the derivative computing routine, defined by procedure blocks and equations within the representation set. This routine is executed until a communication point is encountered. Such points occur at regular intervals set by the user in the control region, or at points determined by test values described by 'EXIT' statements. When a communication point occurs, execution is transferred to a procedural section of the dynamic region following the equations section of the program, typically to produce output. Fig. 3 shows a program which uses the communication points by means of the 'EXIT' statement. When the value of the inequality in the 'EXIT' statement changes from 'FALSE' to 'TRUE', the program transfers control to the procedural section following the representation set as shown.
    BEDSOCS uses a 4th order Runge-Kutta-Merson integration routine which allows variable step sizes. By using control variables, the user can set the error tolerance and the minimum step size. As the simulation continues, the step size is adjusted according to the estimated truncation error.
    Perhaps the most significant feature of BEDSOCS is the ease with which it can be mastered. Using BASIC as a procedural language and implementing the representation set in a familiar format allows even the novice to write complex simulation programs. BEDSOCS not only requires no compilation time, but also greatly simplifies debugging. For users requiring immediate response on small problems, BEDSOCS is an attractive simulation language.
          in The Computer Journal 23(3) 1980 view details