The Modelica implementation of "Dynamic modeling and modification of ternary semicontinuous distillation without a middle vessel for improved controllability and energy performance" paper.
https://www.sciencedirect.com/science/article/abs/pii/S0255270124003593
Feel free to use this code or adapt it to your purpose, and please give credit by citing the above paper.