# Energy Management of a Multi-Source Power System
## 3 Methodology
### Mathematical Model
#### 3.1.2 Model Formulation
\[\tau\ =\ \text{RC} \tag{8}\]  
\[V_{k}^{C}=V_{s}\Big{(}1-e^{\frac{-k\text{M}}{\tau}}\Big{)}ch_{k}^{C}\ \ \forall k \tag{9}\]  
When the super capacitor is supplying the system, the voltage is calculated using Equation (10). \[V_{k}^{C}=V_{k-1}^{C}\ e^{\frac{-k\text{M}}{\tau}}S_{k}^{C}\ \ \forall k \tag{10}\]  
If the capacitor is left idle, the voltage remains the same as shown in Equation (11). \[SOC_{k}^{B_{j}}=\Delta t\frac{-1}{C_{C}}I_{k}^{B_{j}}\Big{(}S_{k}^{B_{j}}-ch_{ k}^{B_{j}}\Big{)}+\ SOC_{k}^{B_{j}}((k-1))\ \ \forall k \tag{2}\]0  
The current of the super capacitor is calculated using the following Equation (12). \[SOC_{k}^{B_{j}}=\Delta t\frac{-1}{C_{C}}I_{k}^{B_{j}}\Big{(}S_{k}^{B_{j}}-ch_{ k}^{B_{j}}\Big{)}+\ SOC_{k}^{B_{j}}((k-1))\ \ \forall k \tag{2}\]1  
The power provided by the super capacitor is calculated using Equation (13) and the state-of-charge (\(SOC\)) of the super capacitor is calculated continuously as the system runs using Equation (14). \[SOC_{k}^{B_{j}}=\Delta t\frac{-1}{C_{C}}I_{k}^{B_{j}}\Big{(}S_{k}^{B_{j}}-ch_{ k}^{B_{j}}\Big{)}+\ SOC_{k}^{B_{j}}((k-1))\ \ \forall k \tag{2}\]2  
\[SOC_{k}^{B_{j}}=\Delta t\frac{-1}{C_{C}}I_{k}^{B_{j}}\Big{(}S_{k}^{B_{j}}-ch_{ k}^{B_{j}}\Big{)}+\ SOC_{k}^{B_{j}}((k-1))\ \ \forall k \tag{2}\]3  
The sizing of the super capacitor is based on the rush of current needed during spikes in the energy demand. As an example for the case of considering a drone needing to suddenly navigate to a higher altitude compared to its present altitude, a spike in the drone's demand can occur due to a sudden increase in the drone's traveling altitude. Therefore, the size of the super capacitor needed can be found as follows:  
The energy \(E\) needed to raise an object of mass m to a height \(h\) is:  
\[SOC_{k}^{B_{j}}=\Delta t\frac{-1}{C_{C}}I_{k}^{B_{j}}\Big{(}S_{k}^{B_{j}}-ch_{ k}^{B_{j}}\Big{)}+\ SOC_{k}^{B_{j}}((k-1))\ \ \forall k \tag{2}\]4where \(g\) is the gravitational acceleration. By definition, 1 joule is equal to 1 volt multiplied by 1 coulomb. Therefore:  
\[SOC_{k}^{B_{j}}=\Delta t\frac{-1}{C_{C}}I_{k}^{B_{j}}\Big{(}S_{k}^{B_{j}}-ch_{ k}^{B_{j}}\Big{)}+\ SOC_{k}^{B_{j}}((k-1))\ \ \forall k \tag{2}\]5  
where \(Q\) is the charge of the super capacitor in coulombs and \(V\) is the voltage in volts. Additionally, the charge of the capacitor is dependent on the capacitance and voltage:  
\[SOC_{k}^{B_{j}}=\Delta t\frac{-1}{C_{C}}I_{k}^{B_{j}}\Big{(}S_{k}^{B_{j}}-ch_{ k}^{B_{j}}\Big{)}+\ SOC_{k}^{B_{j}}((k-1))\ \ \forall k \tag{2}\]6  
where \(C\) is the capacitance in Farads. Therefore, by using Equations (15)-(17) the following Equation (18) can be used to determine the size of the super capacitor need. Considering the example of drone flight, a safety factor could also be considered to ensure that the super capacitor can handle any spikes in demand resulting from turbulences encountered during the flight,  
\[SOC_{k}^{B_{j}}=\Delta t\frac{-1}{C_{C}}I_{k}^{B_{j}}\Big{(}S_{k}^{B_{j}}-ch_{ k}^{B_{j}}\Big{)}+\ SOC_{k}^{B_{j}}((k-1))\ \ \forall k \tag{2}\]7  
Constraints (19) ensures that the super capacitor is either charging, supplying, or unused at each time step \(k\). \[SOC_{k}^{B_{j}}=\Delta t\frac{-1}{C_{C}}I_{k}^{B_{j}}\Big{(}S_{k}^{B_{j}}-ch_{ k}^{B_{j}}\Big{)}+\ SOC_{k}^{B_{j}}((k-1))\ \ \forall k \tag{2}\]8  
Please note that the capacitor sizing is not constrained to the type of problem, i.e., if the problem is not of drone flight, but of supplying power to an islanded micro grid; then instead of considering the height \(h\) in (15), one can simply calculate the energy needed to supply such a spike in demand. Then equating such a spike to the stored energy in a supercapacitor, can trivially give the size of the capacitor necessary. Photovoltaic Cell Model  
The power profile of the photovoltaic cell, \(PV(k)\), is uploaded into the system via a controller and its output is determined using Equation (20). The photovoltaic cell can either be supplying the demand of the system or charging one of the batteries.