Hi Arthur,
Here is an answer to Question 1 about the battery model.
The battery power (P) equation for manual dispatch looks like this:
P = inverter_efficiency * max_scheduled_rate * voltage * qmax
...for any time that the following is true:
max_scheduled_rate * qmax >= q - qmax * min_soc * 0.01
Where
qmax is typically referred to as
q_full in the C++ source code code, and is equivalent to 100% SOC (state of charge), not the maximum SOC specified on the Battery Dispatch input page.
For example, for a Lithium-ion battery with four hours of usable energy (four hours between maximum SOC and minimum SOC), the maximum discharge power based on the rate would remain the same for all four hours. Your equation, on the other hand, assumes that SAM pro-rates the power as the capacity decreases.
Some of the code that regulates this is here:
github.com/NREL/ssc/blob/ca964fc280268b4e4efe686dc66c3c01ad555430/shared/lib_battery_dispatch_manual.cpp#L233
The code that enforces the SOC limits is here:
github.com/NREL/ssc/blob/ca964fc280268b4e4efe686dc66c3c01ad555430/shared/lib_battery_dispatch.cpp#L165
Best regards,
Paul.