Open Webbah opened 4 years ago
Define states and actions:
states x: f, U, P, Q...?
actions a:
Planned: ODE, which contains f&U-calculations and droop-controller to calculate P&Q depending on f&U (before)
Later:
component power as state or input?
First example:
dtheta = f df = sum(Pk)/(J*f)
While in Pk an offset can be considered and in f-ODE droop is inserted:
df = (p-droop_linear*(freqs-nomFreq))/(J*freqs)
Result for droop inverter 1 = 0, inverter 2 = 1000 W/Hz and no P-offset (standard solver):
Unstable for longer simulations:
p[k] += nomVolt * nomVolt * (-G[k][j]*np.cos(thetas[k] - thetas[j]) + \ B[k][j]*np.sin(thetas[k] - thetas[j]))
)Q-Droop and voltage implemented:
Observations:
droop_linear = np.array([7689, 1000, 0]) # W/Hz
q_droop_linear = np.array([12000, 3000, 0])
When the first value is below 7689 (does not matter how much), the frequency rises, when its 7689 or above, it drops.
continues even for longer simulations. ignore the last value which goes to 0, this is just a programming issue.
The other 2 voltages can be stabilized with the q-droop, but sinve it´s 0 for the load, it reaches 0.
I would have expected it to rise while adjusting (increasing) the load resistance, but this does not seem to have any effect on the resulting voltages?! Increasing it by the factor of 10 or 100 does nothing to it, while decreasing the line impedances results sometimes in numerical issues.
If anyone has a clue how to get a voltage at v3, which does not decrease that fast, feel free to share ideas :-)
Relevant parts of the code, basically equation 8 from Olivers paper:
for k in range(num_nodes):
for j in range(num_nodes): # l works, due to B is symmetric
p[k] += voltages[k] * voltages[j] * (-G[k][j]*np.cos(thetas[k] - thetas[j]) + \
B[k][j]*np.sin(thetas[k] - thetas[j]))
q[k] += voltages[k] * voltages[j] * (-G[k][j]*np.sin(thetas[k] - thetas[j]) + \
B[k][j]*np.cos(thetas[k] - thetas[j]))
Including equation 12 for the return, + an adjusted version for the voltage:
df = (p-droop_linear*(freqs-nomFreq))/(J*freqs)
dv = (q - q_droop_linear * (voltages - nomVolt)) / (J * voltages)
dtheta = freqs * 2 * np.pi
First example: two inverter droop (static?)