Exemple #1
0
def run_eval(t_end, params_pf, params_simu, params_bess_vsc):

    N_v = params_pf[0].N_nodes_v
    N_i = params_pf[0].N_nodes_i
    N_x = params_simu[0].N_x
    t_ini = params_simu[0]['t_ini']
    N_nodes = int(N_v + N_i)
    N_steps = int(np.ceil((t_end - t_ini) / params_simu[0].Dt))
    T = np.zeros((N_steps, 1), dtype=np.float64)  # time ouput
    V_nodes = np.zeros((N_steps, N_nodes),
                       dtype=np.complex128)  # voltages ouputs
    I_nodes = np.zeros((N_steps, N_nodes),
                       dtype=np.complex128)  # currents ouputs
    X = np.zeros((N_steps, N_x), dtype=np.float64)  # currents ouputs
    for it in range(N_steps):
        t = params_simu[0].Dt * it
        f_eval(t, params_pf, params_simu, params_bess_vsc)
        # ode solver
        params_simu[0].x[:] += params_simu[0].Dt * params_simu[0].f

        # update elements outputs:
        bess_vsc_eval(t, 4, params_bess_vsc, params_pf, params_simu)

        # update power flow
        V_node, I_node = pf_eval(params_pf)

        # outputs update
        T[it, 0] = t + params_simu[0]['t_ini']
        V_nodes[it, :] = V_node[:, 0]
        I_nodes[it, :] = I_node[:, 0]
        X[it, :] = params_simu[0].x[:, 0]
    params_simu[0].N_steps = N_steps
    params_simu[0]['t_ini'] = t_end
    return T, V_nodes, I_nodes, X
Exemple #2
0
def f_eval(t, params_pf, params_simu, params_bess_vsc):

    # update elements derivatives:
    bess_vsc_eval(t, 2, params_bess_vsc, params_pf, params_simu)
Exemple #3
0
def ini_eval(t, params_pf, params_simu, params_bess_vsc):

    params_simu[0]['t_ini'] = t
    # bess_vsc
    bess_vsc_eval(t, 1, params_bess_vsc, params_pf, params_simu)
Exemple #4
0
def ini_eval(t, params_pf, params_simu, params_bess_vsc):

    # bess_vsc
    bess_vsc_eval(t, 1, params_bess_vsc, params_pf, params_simu)