There are 3 Matlab Function blocks in the model, the first one is the 'calculate_capacitor' function: it gives the output of the required capacitor amount as 'capacitor_var', with the inputs of the system's active power, instantaneous power factor value and target power factor value. Since the reactive power is variable, it is necessary to write an algorithm that decides which capacitor will be activated at which moment. The purpose of the system is to meet the reactive power generated by the loads with capacitors and to keep the power factor above 0.95. In this design, there is a 3-phase source, 4 three phase loads (defined as their active power is constant, their reactive power is changed randomly every 3 seconds), 6 three phase breakers and 6 capacitors connected to them.
I am designing a power factor correction system from Matlab Simulink.