Project 1


Key Components of the Model
Inputs:
powerDemand(frompowerDemandData.mat)MinFCPower = 3000MaxFCPower = 8000
States & Transitions:
FCS_Standby_And_BatteryRunning → Battery powers the system when
powerDemand < MinFCPower.FCS_Running → Fuel cell powers the system when
MinFCPower ≤ powerDemand ≤ MaxFCPower.BatteryAssist → Battery helps fuel cell when
powerDemand > MaxFCPower.
Outputs:
fuelCellPower (fuel cell energy supply)
batteryPower (battery energy supply)
fcOperatingState (standby =
0, running =1, battery assist =2)
Now breakdown of the statechart:State Transitions
The system shifts between FCSStandby_And_BatteryRunning, FCS_Running, and BatteryAssist based on power demand conditions.
Transitions happen when
powerDemandcrossesMinFCPowerandMaxFCPower.
Fuel Cell Behavior
Active (
fcOperatingState = 1) whenMinFCPower ≤ powerDemand ≤ MaxFCPower.Off (
fcOperatingState = 0) whenpowerDemand < MinFCPower.
Battery Support
Battery provides full power when
powerDemand < MinFCPower.Battery supplements the fuel cell when
powerDemand > MaxFCPower.Interpretation of Simulation Outputs:

Based on your Stateflow model’s simulation output, here’s how the system performed over 100 seconds:
1. Power Demand Behavior
The power demand fluctuates significantly, starting around 5000 units, peaking near 8000 units, and then stabilizing before dropping towards the end.
These fluctuations trigger transitions in power management between the fuel cell and battery.
2. Fuel Cell Power Response
Fuel Cell supplies power initially (stable at 5000 units).
Around 50 seconds, the fuel cell power drops to zero, indicating a transition to standby mode.
Later, it ramps back up to 5000 units, meaning the fuel cell resumed operation.
3. Battery Power Compensation
Initially, battery does not supply power (operating in standby).
As the fuel cell shuts down at 50s, battery power jumps to 5000 units.
Later, battery power drops back to zero when the fuel cell resumes operation.
4. Fuel Cell Operating State Behavior
Starts in running state (
fcOperatingState = 1).At 50s, transitions to standby (
fcOperatingState = 0), matching the fuel cell shutdown.Then transitions back to running (
fcOperatingState = 1), when the fuel cell resumes.