Parameters configure the heater PI controller, optional feed-forward and cascade control, and optional startup filtering with segment-wise heat distribution. Temperatures are absolute SI temperatures in kelvin, heat flow rates are in watts, and temperature differences are in kelvin.
| Name | Type | Unit | Default | Description |
|---|---|---|---|---|
N | Integer | 1 | size(heatWeights, 1) | Number of reactor segments and heat ports |
q_max | SI.HeatFlowRate | W | 5e4 | Upper limit of the heater PI controller output; with the heat filter enabled this is the total distributed heat-flow command |
useHeatFilter | Boolean | - | false | Enable the first-order startup filter and normalized segment-wise heat distribution |
T_heatFilter | SI.Time | s | 1e-3 | Startup filter time constant; used only when useHeatFilter = true |
heatWeights[:] | Real | - | {1.8, 1.5, 1.2, 1.0, 0.9, 0.8, 0.7, 0.6, 0.3, 0.2} | Relative segment heat weights from inlet to outlet, normalized by their sum when useHeatFilter = true. Its length must match N in that mode. |
T_out_target | SI.Temperature | K | 550 + 273.15 | Temperature set-point; in cascade mode it is the outlet-temperature reference and the base of the bed-mean set-point |
| Name | Type | Unit | Default | Description |
|---|---|---|---|---|
k_PI | Real | W/K | 1e3 | Proportional gain of the heater PI controller |
Ti_PI | SI.Time | s | 0.5 | Integral time of the heater PI controller |
use_Q_ff | Boolean | - | false | Enable the conditional feed-forward input Q_ff, added to the PI controller output before its output limits |
use_cascade | Boolean | - | false | Enable an outer outlet-temperature PI controller that adjusts the inner controller's bed-mean temperature set-point |
k_out | Real | 1 | 1 | Outer controller proportional gain; used only when use_cascade = true |
Ti_out | SI.Time | s | 200 | Outer controller integral time; used only when use_cascade = true |
dT_bed_max | SI.TemperatureDifference | K | 100 | Symmetric limit on the outer controller's bed-mean set-point offset; used only when use_cascade = true |
dT_bed_start | SI.TemperatureDifference | K | 0 | Initial output of the outer controller and initial bed-mean set-point offset; used only when use_cascade = true |
| Name | Direction | Interface | Unit | Description |
|---|---|---|---|---|
T_meas | Input | RealInput | K | Measured temperature. It is compared directly with T_out_target when cascade control is disabled; when enabled it is the outer outlet-temperature feedback signal. |
Q_ff | Conditional input | RealInput | W | Optional feed-forward heat-flow demand, available when use_Q_ff = true |
heatPorts[N] | Thermal interface | HeatPort_a array | W, K | One heat-flow port per reactor segment. Positive prescribed heat flow supplies heat to the connected segment. |
The model regulates electric heat supplied to an ammonia-cracker bed. A bounded PI controller requests non-negative heater power up to q_max. Depending on the selected options, that request can include a feed-forward term, pass through a first-order startup filter, and be distributed across the segment heat ports according to heatWeights.
With use_cascade = false, T_meas closes the heater PI loop directly against T_out_target. With use_cascade = true, an outer PI loop compares T_meas with T_out_target and produces a bounded offset. This offset is added to T_out_target to form the bed-mean temperature set-point. The inner heater PI loop then compares that set-point with the arithmetic mean of heatPorts.T.
When useHeatFilter = true, the heater command is first filtered from an initial output of zero, then multiplied by heatWeights[i]/sum(heatWeights) for each segment. This preserves the total commanded heat flow for weights whose sum is nonzero. When useHeatFilter = false, the filter and distribution gains are absent and the full PI output is connected to every segment port; consequently, the sum of segment heat flows can be N times the controller output. In this mode heatWeights and T_heatFilter do not affect the model.
0 <= PI_heater.y <= q_max
T_bedMean = sum(heatPorts[i].T for i in 1:N)/N
use_cascade = false: PI_heater set-point = T_out_target, measurement = T_meas
use_cascade = true: T_bedSet = T_out_target + outerPI.y
outerPI: set-point = T_out_target, measurement = T_meas
PI_heater: set-point = T_bedSet, measurement = T_bedMean
useHeatFilter = true: Q_segment[i] = heatFilter.y*heatWeights[i]/sum(heatWeights)
useHeatFilter = false: Q_segment[i] = PI_heater.y
The feed-forward input is enabled independently of cascade mode and is combined by the LimPID block before the heater output limiter. The heat filter and heat distribution are enabled together by useHeatFilter. Ensure that N matches the heatWeights vector length when distribution is enabled, and that the weights have a nonzero sum.
No signal output connectors are declared. Heat is delivered through heatPorts[N]. For monitoring, PI_heater.y is the limited heater command before optional filtering and distribution; when cascade control is enabled, outerPI.y is the bed-mean set-point offset and T_bedMean.y is the mean segment temperature.