High Fidelity Model
The following device types are included in the model:
Multiple 280W photovoltaic arrays
Multiple 3kW wind turbines
Multiple 60kW microturbines
Multiple (1350 Ah for 20 hours) batteries
1 boiler
1 converter
Grid (assume 0.5$/kwH)
Electrical and thermal connections
The below microgrid configuration is assumed.

Electrical, thermal, solar, and wind loads will be applied to the microgrid.
Model Logic:
1. Retrieve electical and thermal load profiles for the system.
2. Calculate the fixed cost of the system
3. for each hourly time period ...
     a. Get the hourly electrical and thermal load
     b. Calculate power from reusable energy sources
     c. If renewables produce an excess of electrical load, store excess in battery
     d. Use microturbines to supply unmet electical load, provide waste heat from microturbines to help satisfy thermal loads.
     e. Charge batteries if extra power is available from microturbines by running them at full speed.
     f. Use Grid to supply unmet electircal load.
     g. Charge batteries with the Grid if the microturbines do not produce enough excess energy
     g. Check if batteries need recharged
     h. Calculate operating and fuel cost of the system for the hour
end of time period
code
Case 1 : Reusables and microturbines supply all needed electrical load (40 PV arrays, 1 Wind Turbine, 1 Microturbine, 1 Battery)
Case 2 : Reusables, microturbines, batteries, and microgrid supply all needed electrical load (40 PV arrays, 1 Wind Turbine, 1 Microturbine, 1 Battery)