Can HOMER Pro model a system that uses energy storage (batteries, pumped hydro, etc.) for peak shaving?
Peak shaving requires the Advanced Grid module. Some rate structures include a demand charge based on the highest power you purchase from the grid. Reducing the highest peak(s) of grid purchases can reduce the demand charge. You can set up peak shaving in a model with a grid, battery, load and any other components. Start with just a grid, battery, and load.
In the grid component menu, in real time rates or scheduled rates mode, you can enter values for the purchase capacity into your search space. The default is a very large purchase capacity (i.e. 1 GW). Start by running your model without changing this value. Look at the simulation results (double click a row in the optimization table) and go to the "Grid" tab. Notice the column in the table for "Peak Demand (kW) and note the values (the overall annual value is at the bottom of the table).
Now return to the grid menu and enter several values for purchase capacity, starting with the peak demand you noted, and going lower. This will cut off the demand peaks to the level you specify here. HOMER Pro will try each value that you enter, so you can enter a range of values. If a purchase capacity is too low, HOMER Pro won't be able to meet the load and the system will be infeasible. If all of the values you enter are too low, you might get no feasible solutions when you click Calculate.
Another useful option is in the Demand Rates tab. You can double click on a rate in the table on the left, and check the box for "Override system dispatch strategy" and then select "Charge battery as much as possible". This option will force the battery to stay full if possible, in order to save all its energy for peak shaving. You can set this for all of the rates, and it will improve the battery banks performance. You can try Calculate with and without this option, and see if it improves your best system's NPC.
Click calculate, and HOMER Pro will try simulations for each value you enter. Values of purchase capacity that are too low may not be able to meet the load (which may produce an infeasible result), or may turn on a generator if you have any. If the demand charges are high enough and the battery wear costs are low enough, the lowest feasible purchase capacity will be the optimal solution. Adjust the search space to find the lowest feasible purchase capacity, thus minimizing the demand charge.
You can also include a search space on the number of batteries to investigate the cost tradeoff between more batteries and a lower purchase capacity (thus lower demand charge), and fewer batteries and a higher purchase capacity (higher demand charge but less cost of batteries).
See the attached .homer file for an example model.