Understanding Class Collection.Solver

##
Class Collection.Solver

This is the primary class in which the Mixer solver is implemented. The solver is implemented with three
methods: 1) **Naive Gauss Elimination**, 2) **LU Decomposition**, and 3) **Call MATLAB Engine**.
It obtains the l-h-s and the r-h-s constants of the linear equations from the constant matrix and the
reactor table. After calculation, the results are stored in one of the columns in the reactor table.

####
Class Usage

An instance of this class has to be created in order to perform the calculation process. In order to
obtain the results successfully, the names of the reactor table, the constant matrix, the inverse matrix
and the scratch matrix must be entered with the corresponding reference objects created.

####
Class Attributes

**Reactor Table** (rReactor): is an object
reference to the reactor table.

**Constant Matrix** (rConstant): is an object reference
to the constant matrix.

**Inverse Matrix** (rInverse): is an object reference
to the inverse matrix.

**Scratch Matrix for Temporaries** (rScratch):
is an object reference to the scratch matrix, needed during the solving process.

####
Class Functions

**Begin Run** (SG_xBgnRun): is mainly used
by the **Call MATLAB Engine** option to open a connection to a local MATLAB engine and create necessary
matrices.

**End Run** (SG_xEndRun): resets the reactor counter
in the simulation control object to 0 for the next run. It is also used by the MATLAB option to clean
up allocated memory and close the MATLAB engine.

**Evaluation** (SG_xEval): acts as a dispatcher
to switch among the solution methods according to the **Solver Type** set in the simulation control
object. The three solution functions, solveLinearEquationsGauss, solveLinearEquationsLUD,
and solveLinearEquationsMatlab, can be found in the source files Collection_Solver.c
and Collection_Solver.f.

**Post-Evaluation** (SG_xPostEval): advances the
system clock by incrementing the current simulated time in the simulation control object.

**Mixer Example for SansGUI**

*Copyright *©*
2001-2003 ProtoDesign, Inc. All rights reserved.*

http://protodesign-inc.com