Hello all,
I work on modeling / simulation of some thermal energy system in Mathcad 15. The existing model works on the equation oriented approach, at the end all the mass and energy balance equations are gathered in the given-find block. Now I want to "modularize" the program - the components of the system are to be black-boxes, which have inputs and outputs (more precisely input and output streams, which are vectors of parameters). I was thinking about defining modules as functions, but the problem is I can not use boolean equal sign inside a function, that I need, since the whole system of equations / functions can only be solved numerically, in case of Mathcad in Given-Find block. So, every black-box would be expressed as
Function(X,U) =Y
where
X - vector of input streams (if particular black-box has more than one input stream this vector will often contain nested vectors)
U - vector of internal parameters
Y - vector of output streams (if particular black-box has more than one output stream this vector will often contain nested vectors)
As each module is connected to some other by stream(s), output stream of one module can be at the same time inlet stream of the subsequent module. For example, output stream of the superheater is simultaneously input stream of the turbine.
I would be very grateful to any ideas how to resolve the above described problem. Thanks in advance for help.
Piotr