NICTA / SmartGridToolbox

Smart Grid Simulation Library (C++14)
http://nicta.github.io/SmartGridToolbox
24 stars 10 forks source link

Matpower tests #37

Closed dexterurbane closed 8 years ago

dexterurbane commented 8 years ago

If we switch on flat start, then the tests appear to fail due to non-convergence in some problems in an unpredictable manner.

dexterurbane commented 8 years ago

nesta_case189_edin.m is the smallest example that fails. Some of the voltage angles look quite big (~20 deg).

dexterurbane commented 8 years ago

Setting branch charging to zero in nesta_case189_edin.m appears to restore convergence. So something to do with branch charging? But note, we do get convergence for a warm start, which suggests that the equations used are correct and it is just a radius of convergence problem.

dexterurbane commented 8 years ago
function make_test(in_prefix, out_prefix) 
    mpc = loadcase([in_prefix, '.m']);
    define_constants;

    mpc.bus(:, GS) = 0; mpc.bus(:, BS) = 0; % No bus shunts.
    mpc.bus(:, VM) = 1; % Flat start.
    mpc.bus(:, VA) = 0; % Flat start.
    mpc.gen(:, VG) = 1; % V setpoints at 1.

    savecase([out_prefix, '.m'], mpc)

    % Change per unit system.
    for i = 1:size(mpc.branch, 1)
        mpc.branch(i, BR_R) /= mpc.baseMVA;
        mpc.branch(i, BR_X) /= mpc.baseMVA;
        mpc.branch(i, BR_B) *= mpc.baseMVA;
    end
    mpc.baseMVA = 1;
    mpc.bus(:, BASE_KV) = 1;

    savecase([out_prefix, '_mod.m'], mpc);
end

_mod allows us to emulate per unit in SGT.

dexterurbane commented 8 years ago

Might need to accept this as limitation of rectangular NR method.

dexterurbane commented 8 years ago

Written a polar solver and did some solver debugging. Rect fails in 8 cases, polar fails in 6, matpower fails in same 6. Updated tests to reflect all of this. Closing the issue.