Week 9 Challenge
The EMS is modelled in Simulink as

The positive power block is modelled as shown below

The power is delivered based on input power requirement.
If power lies withing FC operating area, it gets operated.
If power is less than minimum value of FC, either battery or UC gets operated based on SOC.
If power is greater than maximum value of FC, either battery or UC gets operated based on SOC along with FC.
The negative power block is modelled as shown below

Either battery or ultra capacitor gets charged based on SOC.
The input power signal is given as

The ouput is obtained as

The output clealy illustrates all the cases, i.e, UC charging, UC discharging, Battery charging, Battery discharging, Fuel cell on and Fuel cell standby.