Stage | MPC software algorithm |
---|---|
1. |
1.1. Get temperature 1.2. Call parameter function 1.3. Calculate Φ and G matrices 1.4. Create Gnf and Gff (nf = near future and ff = far future) dual mode data) 1.5. Calculate E 1.6. Calculate P (matrix for Hildreth QP) 1.7. Build M (constraints vector) 1.8. Start loop – compare xm[0] (SOC) to reference to see if fully charged. If not fully charged, continue, else exit |
2. |
2.1. Calculate F 2.2. Solve -FE-1 (optimal unconstrained Δu from J) 2.3. Build γ (constraints vector) 2.4. Compare: M∆u ≤ γ |
3. |
3.1. False – call Hildreth QP, develop new Δu that meets constraints 3.2. True Goto Stage 4 (4.1) |
4. |
4.1. Calculate the next control signal, next states, and outputs 4.2. Goto Start Loop (1.8) |