The FCC model currently has 179 variables and equations. I've given some description of the model as it was being developed, but it is time to give a better description of the model structure. The simplest way to explain the model is in a top-down mode, starting with the "call" of model to obtain a full solution.
Calling the model
The FCC function is called with the values of the operating variables and the initial guesses for the regenerated catalyst coke level (Crgc) and temperature (Trgn). The converged values of these two variables appear in the three element array on the left. "M" is a huge matrix of the other 177 variables in the solution.
Now let's see the overall structure of FCC.
Overview of FCC
The dashed box is essentially the "call" shown above. The FCC function calls the SME function which minimizes the errors in the heat balance and carbon balance for the regenerator. This operation is performed using a Minerr solve block with Crgc and Trgn as the adjusting variables. This solve block repeatedly calls the SI function which solves the rest of the system for the current values of Crgc and Trgn. A solution from SI is not "closed"...the temperature and coke on the stripper catalyst is not used in the regenerator model equations. Thus, the SME function closes the energy and coke balances for the regenerator.
Before exiting FCC, another call to SI is made with the converged values of Crgc and Trgn to obtain the full solution.
The FCC function code
The FCC function is quite simple. There aren't even any loops evident because all iterations are done by SME and SI. See how easy it is to model a FCC unit!