API
Types and functions documentation in ePowerSim.
Module Index
ePowerSim.Ac_A_gen_avr
ePowerSim.Ac_A_gen_gov
ePowerSim.Ac_S_gen_avr
ePowerSim.Ac_S_gen_gov
ePowerSim.Ac_gen_avr
ePowerSim.Ax_A_A_avr_t0_cb
ePowerSim.Ax_A_A_avr_t1_cb
ePowerSim.Ax_A_A_avr_t1_cb_sauer
ePowerSim.Ax_A_A_gov_ieee_tgov1_cb
ePowerSim.Ax_A_A_gov_t0_cb
ePowerSim.Ax_A_A_gov_t1_cb
ePowerSim.Ax_A_A_gov_t1_cb_sauer
ePowerSim.Ax_A_S_avr_t0_cb
ePowerSim.Ax_A_S_avr_t1_cb
ePowerSim.Ax_A_S_avr_t1_cb_sauer
ePowerSim.Ax_A_S_gov_ieee_tgov1_cb
ePowerSim.Ax_A_S_gov_t0_cb
ePowerSim.Ax_A_S_gov_t1_cb
ePowerSim.Ax_A_S_gov_t1_cb_sauer
ePowerSim.Ax_A_Sgen_avr_t0_cb
ePowerSim.Ax_A_Sgen_avr_t1_cb
ePowerSim.Ax_A_Sgen_avr_t1_cb_sauer
ePowerSim.Ax_A_Sgen_gov_ieee_tgov1_cb
ePowerSim.Ax_A_Sgen_gov_t0_cb
ePowerSim.Ax_A_Sgen_gov_t1_cb
ePowerSim.Ax_A_Sgen_gov_t1_cb_sauer
ePowerSim.Ax_S_A__gov_t0_cb
ePowerSim.Ax_S_A_avr_t0_cb
ePowerSim.Ax_S_A_avr_t1_cb
ePowerSim.Ax_S_A_avr_t1_cb_sauer
ePowerSim.Ax_S_A_gov_ieee_tgov1_cb
ePowerSim.Ax_S_A_gov_t1_cb
ePowerSim.Ax_S_A_gov_t1_cb_sauer
ePowerSim.Bx_A_avr_t0_cb
ePowerSim.Bx_A_avr_t1_cb
ePowerSim.Bx_A_avr_t1_cb_sauer
ePowerSim.Bx_A_gov_ieee_tgov1_cb
ePowerSim.Bx_A_gov_t0_cb
ePowerSim.Bx_A_gov_t1_cb
ePowerSim.Bx_A_gov_t1_cb_sauer
ePowerSim.Cx_A_avr_t0_cb
ePowerSim.Cx_A_avr_t1_cb
ePowerSim.Cx_A_avr_t1_cb_sauer
ePowerSim.Cx_A_gov_ieee_tgov1_cb
ePowerSim.Cx_A_gov_t0_cb
ePowerSim.Cx_A_gov_t1_cb
ePowerSim.Cx_A_gov_t1_cb_sauer
ePowerSim.DAE_BoolVector
ePowerSim.DAE_MassMatrix
ePowerSim.PiModel
ePowerSim.Qmax_Qmin_limit_violation
ePowerSim.SC_Ax_gen_S_avr_A
ePowerSim.SC_Ax_gen_S_avr_S
ePowerSim.SC_Ax_gen_S_gov_A
ePowerSim.SC_Ax_gen_S_gov_S
ePowerSim.SM_Ax_gen_S_avr_A
ePowerSim.SM_Ax_gen_S_avr_S
ePowerSim.SM_Ax_gen_S_gov_A
ePowerSim.SM_Ax_gen_S_gov_S
ePowerSim.Sbus
ePowerSim.SbusC
ePowerSim.Scenario
ePowerSim.Sevf
ePowerSim.Sf
ePowerSim.St
ePowerSim.ThermalGenerator
ePowerSim.V_C2R
ePowerSim.V_R2C
ePowerSim.VΘ_to_u
ePowerSim.WindGenerator
ePowerSim.Z_dq
ePowerSim.anonymus_func
ePowerSim.cartesian_to_polar
ePowerSim.cb_fun_affect_anti_windup_lower_lim!
ePowerSim.center_of_intertia
ePowerSim.conj_x_from_xr_xi
ePowerSim.convert_dataframe_selected_cols_types
ePowerSim.convert_to_consecutive_idxs
ePowerSim.convert_to_non_consecutive_idxs
ePowerSim.create_avr_parameters_lib
ePowerSim.create_dynamic_components_parameters_libs_json
ePowerSim.create_generators_dynamic_parameters_lib
ePowerSim.create_gov_parameters_lib
ePowerSim.create_idxs
ePowerSim.create_offsets
ePowerSim.create_pss_parameters_lib
ePowerSim.create_size_offset_Idx
ePowerSim.create_u_idxs
ePowerSim.create_x_dst_idxs
ePowerSim.create_x_src_idxs
ePowerSim.created_csv_cases_data_folders
ePowerSim.dict_reverse_keys_values_pair
ePowerSim.disaggregate_sta_pf_keywords_parameter
ePowerSim.driver_extract_matpower_case_name
ePowerSim.driver_extract_matpower_scalar
ePowerSim.driver_parse_matpower_data_as_csv
ePowerSim.driver_parse_matpower_data_header
ePowerSim.dynamic_nodal_current_balance
ePowerSim.edges_current_partial_sum
ePowerSim.eighth
ePowerSim.exciter_saturation_function
ePowerSim.exciter_saturation_function
ePowerSim.exciter_saturation_function
ePowerSim.export_maptpower_cases_to_csv
ePowerSim.export_maptpower_data_to_csv
ePowerSim.extract_matpower_case_name
ePowerSim.extract_matpower_scalar
ePowerSim.fifth
ePowerSim.find_V_idx_in_sparse_matrix_IJV
ePowerSim.find_dst
ePowerSim.find_node_incident_edges
ePowerSim.find_src
ePowerSim.flat_reals_to_complex
ePowerSim.fourth
ePowerSim.gS
ePowerSim.generate_labels_by_nodes_idxs_and_vars
ePowerSim.generate_net_bus_volts_labels
ePowerSim.gens_and_non_gens_u_Idx_in_ranges
ePowerSim.get_Cbn_by_orientations
ePowerSim.get_Cnb_by_orientations
ePowerSim.get_Dyn_Nodes_Branches_data_from_json_file
ePowerSim.get_StructTypes_exclude_fieldnames
ePowerSim.get_Y_aug_matrices
ePowerSim.get_Ybus
ePowerSim.get_Ybus_and_related_matrices
ePowerSim.get_Ybus_from_Ynet
ePowerSim.get_Ynet
ePowerSim.get_Ynet_and_related_vectors
ePowerSim.get_Ynet_real_imag_Idxs_wt_rows_Idxs_in_flattend
ePowerSim.get_Ynet_sp_sh
ePowerSim.get_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_edges_data
ePowerSim.get_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_edges_data
ePowerSim.get_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_generic
ePowerSim.get_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_generic
ePowerSim.get_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_generic
ePowerSim.get_Ynet_wt_nodes_idx_wt_adjacent_nodes_diff
ePowerSim.get_Yπ_net
ePowerSim.get_Yπ_net_and_related_vectors
ePowerSim.get_a_flattend_vars_or_paras_and_Idx
ePowerSim.get_a_flattened_by_per_vars_or_paras
ePowerSim.get_a_gen_dyn_idq
ePowerSim.get_a_gen_dyn_idq
ePowerSim.get_a_gen_dyn_idq
ePowerSim.get_a_gen_dyn_idq
ePowerSim.get_a_gen_ph
ePowerSim.get_a_gen_qh
ePowerSim.get_a_gen_vd
ePowerSim.get_a_gen_vq
ePowerSim.get_a_model_integrated_intra_dyn_current_balance_pf_ΔI_idq_mismatch
ePowerSim.get_a_n2s_dict
ePowerSim.get_a_n2s_net_group
ePowerSim.get_a_namedtuple_dict_types_dyn_or_output_func
ePowerSim.get_a_node_state_algb_vars_indices_in_syms
ePowerSim.get_a_node_state_algb_vars_indices_in_system
ePowerSim.get_a_node_states_indices_in_system
ePowerSim.get_a_node_states_vars_syms_in_system
ePowerSim.get_a_node_type_tup_idx_PQ_data_by_generic
ePowerSim.get_a_node_uh_x_conj_∑_ynj_x_vj
ePowerSim.get_a_node_∑_ynj_x_vj_by_Ybus
ePowerSim.get_a_status_steady_state_data
ePowerSim.get_absract_type_dict_subsubtypes
ePowerSim.get_abstract_type_dict_subtypes
ePowerSim.get_algebraic_vars_labels
ePowerSim.get_case_data_by_csv
ePowerSim.get_comp_vector_of_nt_by_lens
ePowerSim.get_components_libs_and_case_data
ePowerSim.get_components_properties_by_json
ePowerSim.get_csv2tex
ePowerSim.get_df2tex
ePowerSim.get_dict_first_to_tenth_funs
ePowerSim.get_dict_n2s_streamlined_idx_by_mpc
ePowerSim.get_dict_net_streamlined_idx_by_nodes_type_idxs
ePowerSim.get_dict_net_to_streamlined_idx_by_mpc
ePowerSim.get_dict_nt_params_from_json_lib_file
ePowerSim.get_dict_states_syms_from_json_lib_file
ePowerSim.get_dict_struct_name_type
ePowerSim.get_dict_types_dyn_or_output_func
ePowerSim.get_dyn_V_ref_Tm_vh_id_iq_Idx
ePowerSim.get_dyn_red_vh_θh_idq
ePowerSim.get_dyn_v_ref_p_order_Png_Qng_Pll_Qll_Idx
ePowerSim.get_dyn_vh_id_iq_V_ref_Tm_Idx
ePowerSim.get_dyn_vh_id_iq_ωref0_vref0_porder0_Idx
ePowerSim.get_dyn_δ_ed_dash_eq_dash_Png_Qng_Pll_Qll_Idx
ePowerSim.get_dyn_δ_eq_dash_Png_Qng_Pll_Qll_Idx
ePowerSim.get_dyn_ω_ref_v_ref_p_order_Png_Qng_Pll_Qll_Idx
ePowerSim.get_dyn_ωref0_vref0_porder0_id_iq_vh_Idx
ePowerSim.get_dynamic_components_parameters_libs_from_json
ePowerSim.get_dynamic_comps_init_out_dyn_callback_funcs
ePowerSim.get_dynamic_id_iq_pg_vh_by_ur_ui
ePowerSim.get_dynamic_id_iq_pg_vh_by_ur_ui
ePowerSim.get_dynamic_id_iq_pg_vh_by_vhθh
ePowerSim.get_dynamic_id_iq_pg_vh_by_vhθh
ePowerSim.get_dynamic_idq_ur_ui
ePowerSim.get_dynamic_idq_ur_ui
ePowerSim.get_dynamic_idq_vhθh
ePowerSim.get_dynamic_idq_vhθh
ePowerSim.get_dynamic_idq_vhθh
ePowerSim.get_dynamic_idq_vhθh
ePowerSim.get_dynamic_idq_θ_π_ur_ui
ePowerSim.get_dynamic_idq_θ_π_vhθh
ePowerSim.get_dynamic_idq_θ_π_vhθh
ePowerSim.get_dynamic_idq_θ_π_vhθh
ePowerSim.get_dynamic_pg_from_id_iq
ePowerSim.get_dynamic_pg_from_id_iq
ePowerSim.get_dynamic_ph_by_vhθh_δ_idq
ePowerSim.get_dynamic_ph_by_vhθh_δ_idq
ePowerSim.get_dynamic_qh_by_vhθh_δ_idq
ePowerSim.get_dynamic_qh_by_vhθh_δ_idq
ePowerSim.get_dynamic_τe_from_id_iq
ePowerSim.get_edge_y_data_by_generic
ePowerSim.get_edge_y_line_data_by_generic
ePowerSim.get_edge_y_transformer_data_by_generic
ePowerSim.get_edges_Ybr_by_generic
ePowerSim.get_edges_Ybr_cal_and_edges_orientation_by_generic
ePowerSim.get_edges_orientation
ePowerSim.get_edges_orientation_by_generic
ePowerSim.get_edges_r_x_b_ratio_angle_idx
ePowerSim.get_eigens
ePowerSim.get_flat_full_vh_θh_and_idxs
ePowerSim.get_flat_intg_vh_θh_id_iq_and_idxs
ePowerSim.get_flattened_to_components_vector_var_Idx
ePowerSim.get_gen_node_static_data_tup_by_mpc
ePowerSim.get_gen_nodes_dict_static_data_by_mpc
ePowerSim.get_gen_nodes_static_tup_data_by_mpc
ePowerSim.get_gen_nodes_δ_ω_ed_dash_eq_dash
ePowerSim.get_gen_nodes_δ_ω_ed_dash_eq_dash_views
ePowerSim.get_gen_nodes_ω_ed_dash_eq_dash
ePowerSim.get_gen_nodes_ω_ed_dash_eq_dash_views
ePowerSim.get_gen_plants_gens_properties_by_json
ePowerSim.get_gen_plants_local_load_by_json
ePowerSim.get_gen_sub_static_data_tup_by_mpc
ePowerSim.get_gencost_data_by_mpc
ePowerSim.get_generic_Pg_Png_Qng_Idx
ePowerSim.get_generic_Pg_Qg_Png_Qng_Pll_Qll_Idx
ePowerSim.get_generic_Png_Qng_Pll_Qll_Idx
ePowerSim.get_generic_algebraic_state_sym
ePowerSim.get_generic_electro_mechanical_oscillation_indicies
ePowerSim.get_generic_flat_vh_flat_θh_Idx
ePowerSim.get_generic_flat_vh_flat_θh_Idx
ePowerSim.get_generic_flat_vh_flat_θh_id_iq_Idx
ePowerSim.get_generic_flat_vh_flat_θh_wt_slack_value_Idx
ePowerSim.get_generic_line_loss_outage_wt_or_no_ref_adjs
ePowerSim.get_generic_line_loss_outage_wt_or_no_ref_adjs
ePowerSim.get_generic_namedtuple_per_plant_para_wt_kwd_para
ePowerSim.get_generic_network_vars_labels
ePowerSim.get_generic_nodes_names
ePowerSim.get_generic_scale_Pg_Png_Qng_Idx
ePowerSim.get_generic_scale_Pg_Qg_Png_Qng_Pll_Qll_Idx
ePowerSim.get_generic_stability_static_powerflow
ePowerSim.get_generic_state_sym
ePowerSim.get_generic_system_simulation_parameters
ePowerSim.get_generic_vh_vhf_Idx
ePowerSim.get_generic_vh_vhf_θh_θhf_id_iq_Idx
ePowerSim.get_generic_vh_θh_id_iq_vhf_θhf_Idx
ePowerSim.get_generic_θh_θhf_Idx
ePowerSim.get_gens_dynamic_id_iq_pg_vh_by_ur_ui
ePowerSim.get_gens_dynamic_id_iq_pg_vh_by_vhθh
ePowerSim.get_gens_dynamic_ph_by_vhθh_δ_idq
ePowerSim.get_gens_dynamic_ph_by_vhθh_δ_idq
ePowerSim.get_gens_dynamic_qh_by_vhθh_δ_idq
ePowerSim.get_gens_dynamic_qh_by_vhθh_δ_idq
ePowerSim.get_gens_govs_avrs_states_syms_by_json
ePowerSim.get_gens_govs_avrs_types_by_json
ePowerSim.get_gens_state_vars_idx_in_state
ePowerSim.get_gens_vd
ePowerSim.get_gens_vq
ePowerSim.get_id_iq_pg_vh_Idx
ePowerSim.get_idxs_in_flattened_by_nodes_idx_wt_vars_syms
ePowerSim.get_labels_by_nodes_idxs_and_vec_vec_syms
ePowerSim.get_list_vars_to_plot_by_syms
ePowerSim.get_load_nodes_idx_wt_type_tup_by_mpc
ePowerSim.get_load_nodes_static_tup_data_by_mpc
ePowerSim.get_load_scaling_red_continuation_distributed_slack_pf_ΔPQ_mismatch!
ePowerSim.get_loc_load_tup_idx_PQ_data_by_mpc
ePowerSim.get_mass_matrix_and_bool_dae_vars
ePowerSim.get_matpower_cases_files
ePowerSim.get_matpower_mpc_type_iobuffer_by_case_file
ePowerSim.get_matpower_mpc_type_iobuffer_by_dict
ePowerSim.get_matpower_scalar_as_iobuffer_by_case_file
ePowerSim.get_matpower_scalar_as_iobuffer_by_symbol
ePowerSim.get_model_nodes_types_names
ePowerSim.get_model_syms
ePowerSim.get_n2s_any
ePowerSim.get_namedtuple_dict_types_dyn_or_output_func
ePowerSim.get_namedtuple_of_findnz
ePowerSim.get_nested_nt_from_nt_wt_dict
ePowerSim.get_net_data_by_components_from_json_file
ePowerSim.get_net_nodes_type_idxs_by_json
ePowerSim.get_net_nodes_type_idxs_by_mpc
ePowerSim.get_net_static_data_by_components_by_xlsx
ePowerSim.get_network_vars_labels
ePowerSim.get_node_dst_edges
ePowerSim.get_node_src_edges
ePowerSim.get_nodes_Yshunt_by_generic
ePowerSim.get_nodes_dict_static_data_by_mpc
ePowerSim.get_nodes_idx_and_Yshunt_by_generic
ePowerSim.get_nodes_idx_and_Yshunt_non_zero
ePowerSim.get_nodes_incident_edges_by_orientations
ePowerSim.get_nodes_incident_edges_to_or_fro
ePowerSim.get_nodes_state_algb_vars_indices_in_system
ePowerSim.get_nodes_static_tup_data_by_mpc
ePowerSim.get_non_gen_node_tup_idx_PQ_data_by_mpc
ePowerSim.get_non_gen_plants_PQ_and_idx_by_json
ePowerSim.get_non_null_list
ePowerSim.get_non_null_list_and_Idx
ePowerSim.get_nt_additional_data
ePowerSim.get_nt_components_data
ePowerSim.get_nt_components_type
ePowerSim.get_nt_vec_wt_vec_vec_per_paras
ePowerSim.get_ntuple_status_steady_state_data
ePowerSim.get_ode_flat_para_Idxs_in_Idxs
ePowerSim.get_ode_gens_generic_para
ePowerSim.get_only_adjacent_nodes_idx
ePowerSim.get_opf_net_optimisation_parameters
ePowerSim.get_opf_streamedlined_simulation_parameters
ePowerSim.get_participation_factors
ePowerSim.get_per_node_flat_idxs
ePowerSim.get_per_node_flat_para_and_idxs
ePowerSim.get_per_node_para_to_per_vars_or_paras
ePowerSim.get_per_node_per_vars_or_paras_flat_idxs
ePowerSim.get_per_node_per_vars_or_paras_flat_para_and_idxs
ePowerSim.get_per_vars_or_paras_flat_idxs
ePowerSim.get_per_vars_or_paras_flat_para_and_idxs
ePowerSim.get_per_vars_or_paras_per_node_flat_idxs
ePowerSim.get_per_vars_or_paras_per_node_flat_para_and_idxs
ePowerSim.get_per_vars_or_paras_to_per_node
ePowerSim.get_pf_dyn_idq
ePowerSim.get_pf_dyn_idq
ePowerSim.get_pf_dyn_idq
ePowerSim.get_pf_dyn_idq_net
ePowerSim.get_pf_dyn_idq_net
ePowerSim.get_pf_dyn_idq_θ_π_vhθh
ePowerSim.get_pf_dyn_idq_θ_π_vhθh
ePowerSim.get_pf_dyn_idq_θ_π_vhθh
ePowerSim.get_pf_dynamic_idq_θ_π_vhθh
ePowerSim.get_pf_dynamic_idq_θ_π_vhθh
ePowerSim.get_pf_dynamic_idq_θ_π_vhθh
ePowerSim.get_pf_streamedlined_simulation_parameters
ePowerSim.get_pf_transformed_idxs
ePowerSim.get_pf_vh_θh_idx_and_idx2Idx
ePowerSim.get_plants_states_syms
ePowerSim.get_plants_states_syms_and_labels
ePowerSim.get_plants_states_syms_wt_labels_wt_names
ePowerSim.get_renewable_energy_net_optimisation_parameters
ePowerSim.get_scaling_red_continuation_distributed_slack_pf_ΔPQ_mismatch!
ePowerSim.get_selected_avrs_ode_para_by_json
ePowerSim.get_selected_comp_properties_by_lens
ePowerSim.get_selected_comps_ode_para_by_json
ePowerSim.get_selected_comps_properties_by_lens
ePowerSim.get_selected_edges_data_by_json
ePowerSim.get_selected_vec_nt_as_nt_vec_by_lens
ePowerSim.get_selected_vec_nt_to_vec_vec
ePowerSim.get_selected_vec_nt_to_vec_vec
ePowerSim.get_sense_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_edges_data
ePowerSim.get_sense_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_generic
ePowerSim.get_shunt_data_by_mpc
ePowerSim.get_similar_collection_diff
ePowerSim.get_size_Ybus
ePowerSim.get_size_Ynet_wt_nodes_idx_wt_adjacent_nodes
ePowerSim.get_size_Yπ_net_Yshunt_wt_nodes_idx_wt_adjacent_nodes
ePowerSim.get_slack_gens_vh_θh_gens_vh_non_slack_gens_vh
ePowerSim.get_state_algebraic_vars_Idx_in_state
ePowerSim.get_state_algebraic_vars_wt_fault_Idx_in_state
ePowerSim.get_state_and_algebraic_vars_Idx_in_state
ePowerSim.get_state_labels
ePowerSim.get_state_vars_and_i_dq_Idx_in_state
ePowerSim.get_state_vars_and_i_dq_wt_fault_Idx_in_state
ePowerSim.get_state_vars_idx
ePowerSim.get_states_Idx_syms_wt_functions
ePowerSim.get_states_idx_by_nodes_idx_wt_vars_syms
ePowerSim.get_static_Idx_and_syms
ePowerSim.get_static_load_nodes_json_data_storage_format
ePowerSim.get_static_loc_loads_json_data_storage_format
ePowerSim.get_static_transmission_nodes_json_data_storage_format
ePowerSim.get_status_steady_state_parameters
ePowerSim.get_sub_components_libs_dir
ePowerSim.get_sub_components_libs_files
ePowerSim.get_subsubtype
ePowerSim.get_system_net_data_wt_static_parameters
ePowerSim.get_system_net_static_data
ePowerSim.get_system_simulation_parameters
ePowerSim.get_system_simulation_parameters
ePowerSim.get_transmission_nodes_static_tup_data_by_mpc
ePowerSim.get_ur_ui_Idx_in_state
ePowerSim.get_vars_idxs_in_range_Idxs
ePowerSim.get_vars_or_paras_Idxs_in_flattend
ePowerSim.get_ωref0_vref0_porder0_id_iq_vh_Idx
ePowerSim.idx_containing
ePowerSim.init_im_plants_system_matrices_views!
ePowerSim.init_plants_system_matrices_views!
ePowerSim.init_plants_system_stability_matrices_views!
ePowerSim.invZ_dq
ePowerSim.limit_violation
ePowerSim.loc_load_exist_bool_by_mpc
ePowerSim.machine_to_network_ref_frame
ePowerSim.make_a_component_state_no_callback_paras
ePowerSim.make_csv_from_sols
ePowerSim.make_plots_with_names
ePowerSim.namedtuple_nested_selection
ePowerSim.network_to_machine_ref_frame
ePowerSim.nineth
ePowerSim.no_limit_violation
ePowerSim.parse_matpower_data_as_csv
ePowerSim.parse_matpower_data_header
ePowerSim.pertubation_by_itegrator
ePowerSim.pf_dynamic_nodal_current_balance
ePowerSim.polar_to_cartesian
ePowerSim.recursive_dict_to_namedtuple
ePowerSim.recursive_nested_namedtuple_wt_dict
ePowerSim.round_up_Ynet
ePowerSim.save_matpower_data_as_csv
ePowerSim.save_matpower_scalar_as_csv
ePowerSim.save_sols
ePowerSim.scale_demand
ePowerSim.scale_generator_cost
ePowerSim.second
ePowerSim.seventh
ePowerSim.simulate_cases
ePowerSim.sixth
ePowerSim.swap_yπ_diagonal_elements
ePowerSim.syms_containing
ePowerSim.tenth
ePowerSim.thermal_cost_function
ePowerSim.third
ePowerSim.threshold_limits
ePowerSim.u_from_ur_ui
ePowerSim.u_to_VΘ
ePowerSim.u_to_ΘV
ePowerSim.update_padded_vec_of_vec_from_comp_axis!
ePowerSim.update_vec_of_vec_from_comp_axis!
ePowerSim.update_vec_of_vec_from_flattened!
ePowerSim.update_vec_of_vec_from_vec_vec!
ePowerSim.ur_ui_to_u
ePowerSim.ur_ui_to_ΘV
ePowerSim.write_vector_or_matrix_to_tex
ePowerSim.x_from_xr_xi
ePowerSim.xr_xi_to_x
ePowerSim.z2y
Detailed API
ePowerSim.Ac_A_gen_avr
— MethodGen state vars coupling to imalgebraicvars of avr
ePowerSim.Ac_A_gen_gov
— MethodGen state vars coupling to imalgberaicvars of gov
ePowerSim.Ac_S_gen_avr
— MethodGen state vars coupling to state of avr
ePowerSim.Ac_S_gen_gov
— MethodGen state vars coupling to state vars of gov
ePowerSim.Ac_gen_avr
— MethodGen state vars coupling to state of avr
ePowerSim.Ax_A_A_avr_t0_cb
— MethodAlgebraic variables of avr avr_t0_cb
v_ref vr1_hat vf
v_ref -1 0 0
vr1_hat 0 -1 0
vf 0 0 -1
ePowerSim.Ax_A_A_avr_t1_cb
— MethodAlgebraic variables of avr avr_t1_cb
v_ref vf
v_ref -1 0
vf 0 -1
ePowerSim.Ax_A_A_avr_t1_cb_sauer
— MethodAlgebraic variables of avr avr_t1_cb_sauer
v_ref vf
v_ref -1 0
vf 0 -1
ePowerSim.Ax_A_A_gov_ieee_tgov1_cb
— MethodAlgebraic variables of gov gov_ieee_tgov1
τm_tilade ω_ref
τm_tilade -1 Dt/ωs
ω_ref 0 -1
ePowerSim.Ax_A_A_gov_t0_cb
— MethodAlgebraic variables of gov gov_t0_cb
τm_tilade #ω_ref phat_in p_in
τm_tilade -1 0 0 0
#ω_ref 0 -1 0 0
phat_in 0 1/(R*ωs) (-1) 0
p_in 0 0 1 (-1)
ePowerSim.Ax_A_A_gov_t1_cb
— MethodAlgebraic variables of gov gov_t1_cb
τm_tilade #ω_ref phat_in
τm_tilade -1 0 0
#ω_ref 0 -1 0
phat_in 0 0 -1
ePowerSim.Ax_A_A_gov_t1_cb_sauer
— MethodAlgebraic variables of gov gov_t1_cb_sauer
#ω_ref τm_tilade
ω_ref -1 0
τm_tilade 0 -1
ePowerSim.Ax_A_S_avr_t0_cb
— MethodCoupling between algebraic variables and state variables of avr avr_t0_cb
vm vr1 vr2 vf_tilade
v_ref 0 0 0 0
vr1_hat 0 1 0 0
vf 0 0 0 1
ePowerSim.Ax_A_S_avr_t1_cb
— MethodCoupling between algebraic variables and state variables of avr avr_t1_cb
vm vr1 vr2 vf_tilade
0 0 0 0
v_ref
vf 0 0 0 1
ePowerSim.Ax_A_S_avr_t1_cb_sauer
— MethodCoupling between algebraic variables and state variables of avr avr_t1_cb_sauer
vr1 vr2 vf_tilade
v_ref 0 0 0
vf 0 0 1
ePowerSim.Ax_A_S_gov_ieee_tgov1_cb
— MethodCoupling between algebraic variables and state variables of gov gov_ieee_tgov1
xg1 xg2
τm_tilade T2/T3 1
ω_ref 0 0
ePowerSim.Ax_A_S_gov_t0_cb
— MethodCoupling between algebraic variables and state variables of gov gov_t0_cb
xg1 xg2 xg3
τm_tilade (T4/T5)* (T3/Tc) T4/T5 1
ω_ref 0 0 0
phat_in 0 0 0
p_in 0 0 0
ePowerSim.Ax_A_S_gov_t1_cb
— MethodCoupling between algebraic variables and state variables of gov gov_t1_cb
xg1 xg2 xg3
τm_tilade (T4/T5)* (T3/Tc) T4/T5 1
ω_ref 0 0 0
phat_in 0 0 0
ePowerSim.Ax_A_S_gov_t1_cb_sauer
— MethodCoupling between algebraic variables and state variables of gov gov_t1_cb_sauer
xg1 xg2
ω_ref 0 0
τm_tilade 0 1
ePowerSim.Ax_A_Sgen_avr_t0_cb
— MethodCoupling between algebraic variables of avr avr_t0_cb
, and state equations of generator
δ u_gen_ω e_d_dash e_q_dash
v_ref 0 0 0 0
vr1_hat 0 0 0 0
vf 0 0 0 0
ePowerSim.Ax_A_Sgen_avr_t1_cb
— MethodCoupling between algebraic variables of avr avr_t1_cb
, and state equations of generator
δ u_gen_ω e_d_dash e_q_dash
v_ref 0 0 0 0
vf 0 0 0 0
ePowerSim.Ax_A_Sgen_avr_t1_cb_sauer
— MethodCoupling between algebraic variables of avr avr_t1_cb_sauer
and state equations of generator
δ u_gen_ω e_d_dash e_q_dash
v_ref 0 0 0 0
vf 0 0 0 0
ePowerSim.Ax_A_Sgen_gov_ieee_tgov1_cb
— MethodCoupling between algebraic variables of gov gov_ieee_tgov1
, and state equations of generator
δ u_gen_ω e_d_dash e_q_dash
τmtilade 0 (-Dt/ωref0) 0 0
ω_ref 0 0 0 0
ePowerSim.Ax_A_Sgen_gov_t0_cb
— MethodCoupling between algebraic variables of gov gov_t0_cb
, and state equations of generator
δ u_gen_ω e_d_dash e_q_dash
τm_tilade 0 0 0 0
ω_ref 0 0 0 0
phat_in 0 -1/(R*ω) 0 0
p_in 0 0 0 0
ePowerSim.Ax_A_Sgen_gov_t1_cb
— MethodCoupling between algebraic variables of gov gov_t1_cb
, and state equations of generator
δ u_gen_ω e_d_dash e_q_dash
τm_tilade 0 0 0 0
#ω_ref 0 0 0 0
phat_in 0 -1/(R*ωs) 0 0
ePowerSim.Ax_A_Sgen_gov_t1_cb_sauer
— MethodCoupling between algebraic variables of gov gov_t1_cb_sauer
, and state equations of generator
δ u_gen_ω e_d_dash e_q_dash
ω_ref 0 0 0 0
τm_tilade 0 0 0 0
ePowerSim.Ax_S_A__gov_t0_cb
— MethodCoupling between state variables and algebraic variables of gov gov_t0_cb
τm_tilade ω_ref phat_in p_in
xg1 0 0 1/Ts 0
xg2 0 0 0 0
xg3 0 0 0 0
ePowerSim.Ax_S_A_avr_t0_cb
— MethodCoupling between state variables and algebraic variables of avr avr_t0_cb!
v_ref vr1_hat vf
vm 0 0 0
vr1 0 0 0
vr2 0 0 0
vf_tilade 0 1/Te 0
ePowerSim.Ax_S_A_avr_t1_cb
— MethodCoupling between state variables and algebraic variables of avr avr_t1_cb!
v_ref vf
vm 0 0
vr1 0 0
vr2 0 0
vf_tilade 0 0
ePowerSim.Ax_S_A_avr_t1_cb_sauer
— MethodCoupling between state variables and algebraic variables of avr avr_t1_cb_sauer
v_ref vf
vr1 0 0
vr2 0 0
vf_tilade 0 0
ePowerSim.Ax_S_A_gov_ieee_tgov1_cb
— MethodCoupling between state variables and algebraic variables of gov gov_ieee_tgov1
τm_tilade #ω_ref
xg1 0 1/(R * ω_ref0)
xg2 0 0
ePowerSim.Ax_S_A_gov_t1_cb
— MethodCoupling between state variables and algebraic variables of gov gov_t1_cb
τm_tilade #ω_ref phat_in
xg1 0 0 1
xg2 0 0 0
xg3 0 0 0
ePowerSim.Ax_S_A_gov_t1_cb_sauer
— MethodCoupling between state variables and algebraic variables of gov gov_t1_cb_sauer
ω_ref τm_tilade
xg1 1/(R * ω_ref0) 0
xg2 0 0
ePowerSim.Bx_A_avr_t0_cb
— MethodCoupling between algebraic variables of avr avr_t0_cb
, and network
id iq pg vh
v_ref 0 0 0 0
vr1_hat 0 0 0 0
vf 0 0 0 0
ePowerSim.Bx_A_avr_t1_cb
— MethodCoupling between algebraic variables of avr avr_t1_cb
, and network
id iq pg vh
v_ref 0 0 0 0
vf 0 0 0 0
ePowerSim.Bx_A_avr_t1_cb_sauer
— MethodCoupling between algebraic variables of avr avr_t1_cb_sauer
, and network
id iq pg vh
v_ref 0 0 0 0
vf 0 0 0 0
ePowerSim.Bx_A_gov_ieee_tgov1_cb
— MethodCoupling between algebraic variables of gov gov_ieee_tgov1
, and network injections id, iq, ph, vh,
id iq ph vh
τm_tilade 0 0 0 0
ω_ref 0 0 0 0
ePowerSim.Bx_A_gov_t0_cb
— MethodCoupling between algebraic variables of gov gov_t0_cb
, and network injections id, iq, ph, vh,
id iq ph vh
τm_tilade 0 0 0 0
#ω_ref 0 0 0 0
phat_in 0 0 0 0
p_in 0 0 0 0
ePowerSim.Bx_A_gov_t1_cb
— MethodCoupling between algebraic variables of gov gov_t1_cb
, and network injections id, iq, ph, vh,
id iq ph vh
τm_tilade 0 0 0 0
#ω_ref 0 0 0 0
phat_in 0 0 0 0
ePowerSim.Bx_A_gov_t1_cb_sauer
— MethodCoupling between algebraic variables of gov gov_t1_cb_sauer
, and network
id iq pg vh
ω_ref 0 0 0 0
τm_tilade 0 0 0 0
ePowerSim.Cx_A_avr_t0_cb
— MethodCoupling between algebraic variables of avr avr_t0_cb
, and set points
ωs ω_ref0 v_ref0 p_order0
v_ref 0 0 1 0
vr1_hat 0 0 0 0
vf 0 0 0 0
ePowerSim.Cx_A_avr_t1_cb
— MethodCoupling between algebraic variables of avr avr_t1_cb
, and set points
ωs ω_ref0 v_ref0 p_order0
v_ref 0 0 1 0
vf 0 0 0 0
ePowerSim.Cx_A_avr_t1_cb_sauer
— MethodCoupling between algebraic variables of avr avr_t1_cb_sauer
, and set points
ωs ω_ref0 v_ref p_order0
v_ref 0 0 1 0
vf 0 0 0 0
ePowerSim.Cx_A_gov_ieee_tgov1_cb
— MethodCoupling between algebraic variables of gov gov_ieee_tgov1
, and set points ωs, ωref0, vref0, p_order0
ωs ω_ref0 v_ref0 p_order0
τm_tilade 0 Dt/(ωs) 0 0
ω_ref 0 1 0 0
ePowerSim.Cx_A_gov_t0_cb
— MethodCoupling between algebraic variables of gov gov_t0_cb
, and set points ωs, ωref0, vref0, p_order0
ωs #ω_ref0 v_ref0 p_order0
τm_tilade 0 0 0 0
#ω_ref 0 1 0 0
phat_in 0 1/(R*ωs) 0 1
p_in 0 0 0 0
ePowerSim.Cx_A_gov_t1_cb
— MethodCoupling between algebraic variables of gov gov_ieee_tgov1
, and set points ωs, ωref0, vref0, p_order0
ωs ω_ref0 v_ref0 p_order0
τm_tilade 0 0 0 0
#ω_ref 0 1 0 0
phat_in 0 1/(R*ωs) 0 1
ePowerSim.Cx_A_gov_t1_cb_sauer
— MethodCoupling between algebraic variables of gov gov_t1_cb_sauer
, and set points
ωs ω_ref0 v_ref0 p_order0
#ω_ref 0 1 0 0
τm_tilade 0 0 0 0
ePowerSim.DAE_BoolVector
— MethodDAE_BoolVector(
state_size, algebraic_size )
Returns the boolean vector for a differential algebraic equations
ePowerSim.DAE_MassMatrix
— MethodDAE_MassMatrix(
state_size, algebraic_size )
Returns the mass matrix for a differential algebraic equations
ePowerSim.PiModel
— MethodPiModel(
y, y_shunt_km, y_shunt_mk, t_km, t_mk )
Returns a PiModel for a line.
ePowerSim.Qmax_Qmin_limit_violation
— MethodQmax_Qmin_limit_violation(
genQ, gen_Qmax, gen_Qmin)
Returns lists of Qmax_limit_violation
and Qmim_limit_violation
ePowerSim.SC_Ax_gen_S_avr_A
— MethodGen state vars coupling to imalgebraicvars of avr
ePowerSim.SC_Ax_gen_S_avr_S
— MethodGen state vars coupling to state of avr
ePowerSim.SC_Ax_gen_S_gov_A
— MethodGen state vars coupling to imalgberaicvars of gov
ePowerSim.SC_Ax_gen_S_gov_S
— MethodGen state vars coupling to state vars of gov
ePowerSim.SM_Ax_gen_S_avr_A
— MethodGen state vars coupling to imalgebraicvars of avr
ePowerSim.SM_Ax_gen_S_avr_S
— MethodGen state vars coupling to state of avr
ePowerSim.SM_Ax_gen_S_gov_A
— MethodGen state vars coupling to imalgberaicvars of gov
ePowerSim.SM_Ax_gen_S_gov_S
— MethodGen state vars coupling to state vars of gov
ePowerSim.Sbus
— MethodSbus(V, Ybus)
Returns complex power at nodes.
ePowerSim.SbusC
— MethodSbusC(V, Ybus)
Returns complex power at nodes.
ePowerSim.Scenario
— MethodThis was taken from JuMP tutoria:
ePowerSim.Sevf
— MethodSevf(Ae, Be, vf_tilade)
Returns an excitation.
ePowerSim.Sf
— MethodSf(V, Ct, Yt)
Returns complex power from
nodes.
ePowerSim.St
— MethodSt(V, Ct, Yt)
Returns complex power to
nodes.
ePowerSim.ThermalGenerator
— MethodThis was taken from JuMP tutoria:
ePowerSim.V_C2R
— MethodV_C2R(V)
Returns a tuple of a vector of voltage magnitudes and a vector of voltage angles for a given vector of complex voltage.
ePowerSim.V_R2C
— MethodV_R2C(V)
Returns a vector of complex voltage for a given concatenated flattened vector of voltage magnitudes and voltage angles.
ePowerSim.VΘ_to_u
— MethodVΘ_to_u(VΘ)
Returns a complex value for a given list of angle and magnitude.
ePowerSim.WindGenerator
— MethodThis was taken from JuMP tutoria:
ePowerSim.Z_dq
— MethodZ_dq(ra, X_d_dash, X_q_dash)
Returns Z_dq matrix transform for a generator.
ePowerSim.anonymus_func
— Functionanonymus_func(x)
Returns a place holder for an anonymus function that produce nothing.
It is needed in struct that do not have some functions implemented.
ePowerSim.cartesian_to_polar
— Methodcartesian_to_polar(ur_ui)
Returns the polar values for a cartesian complex values.
ePowerSim.cb_fun_affect_anti_windup_lower_lim!
— MethodNote that the plantsswitches is a vector of vectors plantsswitches = [[0], [0], [0]]
Each vector in plants_switches
ePowerSim.center_of_intertia
— Methodcenter_of_intertia(
vec_H, vec_ω, vec_δ, ωs )
Returns center of inertial for δ_coi
, ω_coi
, M_T
, vec_M
.
ePowerSim.conj_x_from_xr_xi
— Methodconj_x_from_xr_xi(ur_ui)
Returns the complex conjugate for a list containing real part and imaginary part of a complex voltage.
ePowerSim.convert_dataframe_selected_cols_types
— Methodconvert_dataframe_selected_cols_types(
df, cols_types, cols_names )
Converts a selected columns to specific types in a dataframe.
The function was created because of the challenges of getting is_slack
column as a Bool in dyn_plant.csv
ePowerSim.convert_to_consecutive_idxs
— Methodconvert_to_consecutive_idxs(
flat_vh_flat_θh_Idx )
Converts non consecutive idxs to a consecutive idxs.
ePowerSim.convert_to_non_consecutive_idxs
— Methodconvert_to_non_consecutive_idxs(
flat_vh_idx_flat_θh_idx_in_flat_vh_θh )
Converts consecutive idxs to non consecutive idxs.
ePowerSim.create_avr_parameters_lib
— Methodcreate_avr_parameters_lib
Crerates a json file that contains parameters of dynamic models of avr. Values of some parameters of some avr are already defined in the function. This can be extended by adding parameters values and symbolic name of the avr type.
It creates a dictionary that associates the symbolic name of a avr type with its dyanamic parameters. The dictionary is subsequently written to a json file for persistence.
ePowerSim.create_dynamic_components_parameters_libs_json
— Methodcreate_dynamic_components_parameters_libs_json
Creates a json file that contains parameters of dynamic models of generators, automatic-voltage regulator, governors, powers sytems stabiliers in some appropriate folders under components_libs_dir
.
Assistant functions:
get_sub_components_libs_dir
: get_sub_components_libs_files
create_generators_dynamic_parameters_lib
create_gov_parameters_lib
create_avr_parameters_lib
create_pss_parameters_lib
ePowerSim.create_generators_dynamic_parameters_lib
— Methodcreate_generators_dynamic_parameters_lib
Crerates a json file that contains parameters of dynamic models of generators. Values of some parameters of some generators are already defined in the function. This can be extended by adding parameters values and symbolic name of the generator type.
It creates a dictionary that associates the symbolic name of a generator type with its dyanamic parameters. The dictionary is subsequently written to a json file for persistence.
ePowerSim.create_gov_parameters_lib
— Methodcreate_gov_parameters_lib
Crerates a json file that contains parameters of dynamic models of governors. Values of some parameters of some governors are already defined in the function. This can be extended by adding parameters values and symbolic name of the governor type.
It creates a dictionary that associates the symbolic name of a governor type with its dyanamic parameters. The dictionary is subsequently written to a json file for persistence.
ePowerSim.create_idxs
— Methodcreate_idxs(offs, dims)
Create indexes for stacked array of dimensions dims using the offsets offs
ePowerSim.create_offsets
— Methodcreate_offsets(
dims;
counter=0)::Vector{Int}
Create offsets for stacked array of dimensions dims.
ePowerSim.create_pss_parameters_lib
— Methodcreate_pss_parameters_lib(
Crerates a json file that contains parameters of dynamic models of pss. Values of some parameters of some pss are already defined in the function. This can be extended by adding parameters values and symbolic name of the pss type.
It creates a dictionary that associates the symbolic name of a pss type with its dyanamic parameters. The dictionary is subsequently written to a json file for persistence.
ePowerSim.create_size_offset_Idx
— Methodcreate_size_dims_offset_Idx(comps_dims)
Create indexes of dimensions dims.
ePowerSim.create_u_idxs
— Methodcreate_u_idxs(offs)
Create indexes of ur and ui for stacked array of dimensions dims using the offsets offs
ePowerSim.create_x_dst_idxs
— Methodcreate_x_dst_idxs(offs)
Create indexes of dst-end (h) flow in an edge, xkr and xki for stacked array of dimensions dims using the offsets offs
ePowerSim.create_x_src_idxs
— Methodcreate_i_src_idxs(offs)
Create indexes of src-end (h) flow in an edge, xhr and xhi for stacked array of dimensions dims using the offsets offs
ePowerSim.created_csv_cases_data_folders
— Methodcreated_csv_cases_data_folders
Creates csv files for matpower cases in associated cases folders.
ePowerSim.dict_reverse_keys_values_pair
— Methoddict_reverse_keys_values_pair(
a_dict)
Returns a reverse pair of a dictionary.
ePowerSim.disaggregate_sta_pf_keywords_parameter
— Methoddisaggregate_sta_pf_keywords_parameter(
pf_kw_para)
Returns disaggregated constituent of pfkwpara.
ePowerSim.driver_extract_matpower_case_name
— MethodTest drives extract_matpower_case_name
ePowerSim.driver_extract_matpower_scalar
— MethodTest drives extract_matpower_scalar
ePowerSim.driver_parse_matpower_data_as_csv
— MethodTest drives parse_matpower_data_as_csv
ePowerSim.driver_parse_matpower_data_header
— MethodTest drives parse_matpower_data_header
ePowerSim.dynamic_nodal_current_balance
— Methoddynamic_nodal_current_balance(
x_s, x_d)
Returns dynamic nodal current balance at a node.
ePowerSim.edges_current_partial_sum
— Methodedges_current_partial_sum(
ih_or_ik )
Returns sum of current from source or destination edges connected to a node.
ePowerSim.eighth
— Methodeighth(elements_container)
Returns the eighth element in a list.
ePowerSim.exciter_saturation_function
— Methodexciter_saturation_function(
K_e, V_R_max, S_E_max, S_E0_75max)
Returns an exciter saturation parameters A_x
, and B_x
.
ePowerSim.exciter_saturation_function
— Methodexciter_saturation_function(
(K_e, V_R_max), S_E_max, S_E0_75max)
Returns an exciter saturation parameters A_x
, and B_x
.
ePowerSim.exciter_saturation_function
— Methodexciter_saturation_function(
( efd_1, S_E_1 ), ( efd_2, S_E_2 ) )
Returns an exciter saturation parameters A_x
, and B_x
.
Power system modeling, computation and control.
page:243
ePowerSim.export_maptpower_cases_to_csv
— Methodexport_maptpower_cases_to_csv
Exports all matpower case files in a given directory to csv files in associated cases folders.
ePowerSim.export_maptpower_data_to_csv
— Methodexport_maptpower_data_to_csv
Exports contents of sections of a matpower file as csv files to a specified directory.
ePowerSim.extract_matpower_case_name
— Methodextract_matpower_case_name
Returns the case name of a MATPOWER file.
The first line of every matpower file contains function name for the file, e.g. "function mpc = case5".
ePowerSim.extract_matpower_scalar
— Methodextract_matpower_scalar
Breaks up matlab strings of the form 'name = value;'
ePowerSim.fifth
— Methodfifth(elements_container)
Returns the fifth element in a list.
ePowerSim.find_V_idx_in_sparse_matrix_IJV
— Method find_V_idx_in_sparse_matrix_IJV(
row_idx,
col_idx,
sparse_row_idxs,
sparse_col_idxs )
Returns an index in V of a sparse matrix, where sparse_row_idxs[idx] = row_idx && sparse_col_idxs[idx] = col_idx
.
ePowerSim.find_dst
— Methodfind_dst(row)
Returns destination nodes.
ePowerSim.find_node_incident_edges
— Methodfind_node_incident_edges(row)
Returns a node incident edges.
ePowerSim.find_src
— Methodfind_src(row)
Returns source nodes.
ePowerSim.flat_reals_to_complex
— Methodflat_reals_to_complex(
P_flat, Q_flat )
Returns a vector of complex values for a list of real part and a list of imaginary part.
ePowerSim.fourth
— Methodfourth(elements_container)
Returns the fourth element in a list.
ePowerSim.gS
— MethodgS(V, p)
Returns complex power injections at nodes.
ePowerSim.generate_labels_by_nodes_idxs_and_vars
— Methodgenerate_labels_by_nodes_idxs_and_vars(
nodes_idxs,
nodes_vars_syms;
label_prefix = "bus" )
Return labels for nodes variables.
Example
tgensnodes_idx = [1, 2, 3]
tstatevarssymsinternal_mode = [:δ, :ω]
generatelabelsbynodesidxsandvars( tgensnodesidx, tstatevarssymsinternalmode)
ePowerSim.generate_net_bus_volts_labels
— Methodgenerate_net_bus_volts_labels(
network_bus_names)
Returns buses voltage labels for real part and imaginary part od buses voltages.
ePowerSim.gens_and_non_gens_u_Idx_in_ranges
— Methodgens_and_non_gens_u_Idx_in_ranges(
all_nodes_idx,
gens_nodes_idx,
non_gens_nodes_idx,
nodes_u_Idx_in_ranges )
Returns generators and non-geenrators voltage indices in form of ranges.
ePowerSim.get_Cbn_by_orientations
— Methodget_Cbn_by_orientations(edges_collection)
Returns branches to nodes connectivity matrix Cbn
.
ePowerSim.get_Cnb_by_orientations
— Methodget_Cnb_by_orientations(edges_collection)
Returns nodes to branches connectivity matrix Cnb
.
ePowerSim.get_Dyn_Nodes_Branches_data_from_json_file
— MethodThis function get_Dyn_Nodes_Branches_data_from_json_file
is not fully implented and tested.
ePowerSim.get_StructTypes_exclude_fieldnames
— Methodget_StructTypes_exclude_fieldnames
Returns a set of properties (fieldnames) of a structure that are not in non-excluded list.
ePowerSim.get_Y_aug_matrices
— Methodget_Y_aug_matrices(
pf_PQ_param,
vh;
y_aug_kw_para =
y_aug_kw_para )
Returns reduced order matrices.
ePowerSim.get_Ybus
— Methodget_Ybus(
edge_data_from_json,
shunt_data_from_json;
basekV = 1.0,
baseMVA = 1.0,
line_data_in_pu = true )
Returns network sparse admittance matrix.
ePowerSim.get_Ybus_and_related_matrices
— Methodget_Ybus_and_related_matrices(
edge_data_from_json,
shunt_data_from_json;
basekV = 1.0,
baseMVA = 1.0,
line_data_in_pu = true )
Returns constituent objects for building Ybus
.
ePowerSim.get_Ybus_from_Ynet
— Methodget_Ybus_from_Ynet(
Ynet, nodes_node_idx_and_incident_edges_other_node_idx
)
Converts Ynet to Ybus
ePowerSim.get_Ynet
— Methodget_Ynet(
edge_data_from_json,
shunt_data_from_json;
baseMVA = 1.0,
basekV = 1.0,
baseShunt = 1.0,
line_data_in_pu = true)
Returns a namedtuple of network admitance vectors and network nodes neigbouhood vectors.
ePowerSim.get_Ynet_and_related_vectors
— Methodget_Ynet_and_related_vectors(
edge_data_from_json,
shunt_data_from_json;
basekV = 1.0,
baseMVA = 1.0,
line_data_in_pu = true )
Returns constituent objects for building Ynet
.
ePowerSim.get_Ynet_real_imag_Idxs_wt_rows_Idxs_in_flattend
— Methodget_Ynet_real_imag_Idxs_wt_rows_Idxs_in_flattend(
Ynet)
Returns namedtuples of Ynet_rows_Idxs_in_flattend
, and Ynet_real_imag_Idxs_in_flattend
.
ePowerSim.get_Ynet_sp_sh
— Methodget_Ynet(
edge_data_from_json,
shunt_data_from_json;
baseMVA = 1.0,
basekV = 1.0,
baseShunt = 1.0,
line_data_in_pu = true)
Returns a namedtuple of network admitance vectors and network nodes neigbouhood vectors.
ePowerSim.get_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_edges_data
— Methodget_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_edges_data(
edges_r, edges_x, edges_b,
edges_ratio, edges_angle,
Gs, Bs;
edges_fbus,
edges_tbus,
edges_type,
all_nodes_idx,
n2s_all_nodes_idx,
baseMVA=1.0,
basekV=1.0,
line_data_in_pu = true)
Returns a namedtuple of network admitance vectors and network nodes neigbouhood vectors.
ePowerSim.get_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_edges_data
— Methodget_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_edges_data(
;edges_fbus, edges_tbus,
edges_type,
edges_r, edges_x, edges_b,
edges_ratio, edges_angle,
Gs, Bs,
all_nodes_idx,
n2s_all_nodes_idx,
baseMVA=1.0,
basekV=1.0,
line_data_in_pu = true)
Returns a namedtuple of network admitance vectors and network nodes neigbouhood vectors.
ePowerSim.get_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_generic
— Methodget_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_generic(
branches_fbus,
branches_tbus,
r,
x,
b,
ratio,
angle,
edge_type,
Gs,
Bs;
all_nodes_idx,
n2s_all_nodes_idx,
baseMVA = 1.0,
basekV = 1.0,
baseShunt = 1.0 )
Returns a namedtuple of network admitance vectors and network nodes neigbouhood vectors.
ePowerSim.get_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_generic
— Methodget_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_generic(
branches_fbus,
branches_tbus,
r, x, b,
ratio, angle,
edge_type,
buses_idx,
Gs, Bs;
baseMVA = 1.0,
basekV = 1.0,
baseShunt = 1.0 )
Returns a namedtuple of network admitance vectors and network nodes neigbouhood vectors.
ePowerSim.get_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_generic
— Methodget_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_generic(
branches_fbus,
branches_tbus,
r,
x,
b,
ratio,
angle,
Gs,
Bs;
edges_type,
all_nodes_idx,
n2s_all_nodes_idx,
baseMVA = 1.0,
basekV = 1.0,
baseShunt = 1.0 )
Returns a namedtuple of network admitance vectors and network nodes neigbouhood vectors.
ePowerSim.get_Ynet_wt_nodes_idx_wt_adjacent_nodes_diff
— Methodget_Ynet_wt_nodes_idx_wt_adjacent_nodes_diff(
Ynet_wt_nodes_idx_wt_adjacent_nodes_1,
Ynet_wt_nodes_idx_wt_adjacent_nodes_2)
Returns the difference between two Ynetwtnodesidxwtadjacentnodes data structure.
ePowerSim.get_Yπ_net
— Methodget_Yπ_net(
edge_data_from_json,
shunt_data_from_json;
# all_nodes_idx,
# n2s_all_nodes_idx,
baseMVA = 1.0,
basekV = 1.0,
baseShunt = 1.0,
line_data_in_pu = true,
orientated_bool = false )
Returns nodes incident edges elementary admittance matrices yπ
.
swapyπdiagonal_elements is used to ensure a proper orientation of elementary yπ
based on an edge orientation (i,j)
i.e (from, to). Since an edge is connected to two nodes; node i and node k, a primary node checks if the first index in (i,j)
is the same as its index. if from idx is the same as the index of the primary node, yπ
is accepted, otherwise, values in the diagonal of yπ
are swapped. This is important for branches element whose elementaray admittance yπ
matrix are not symetrix
A primary node is the first node in each row of nodes_idx_with_adjacent_nodes_idx
ePowerSim.get_Yπ_net_and_related_vectors
— Methodget_Yπ_net_and_related_vectors(
edge_data_from_json,
shunt_data_from_json;
all_nodes_idx,
n2s_all_nodes_idx,
basekV = 1.0,
baseMVA = 1.0,
baseShunt = 1.0,
line_data_in_pu = true,
orientated_bool = true )
Returns constituent objects for building Yπ_net
.
ePowerSim.get_a_flattend_vars_or_paras_and_Idx
— Methodget_a_flattend_vars_or_paras_and_Idx(
vec_of_vec_var )
Returns indices in a flattened vectors for a vector of vectors.
d = [ [1,2], [3,4], [5,6]]
e = [[10,11,12], [13,14,15], [16,17,18]]
testdata2 = [d, e]
dimsvarsorparastypes = length.([first(d), first(e) ] )
teste = getpervarsorparastopernode( testdata2 )
testt = getpernodeparatopervarsorparas( teste, dimsvarsorparastypes )
ePowerSim.get_a_flattened_by_per_vars_or_paras
— Methodget_a_flattened_by_per_vars_or_paras(
list_vars_or_paras )
Returns for a vector of vectors list_vars_or_paras
a flattened vector.
ePowerSim.get_a_gen_dyn_idq
— Methodget_a_gen_dyn_idq(
vh, θh,
δ_ω_ed_eq,
ra_Xd_dash_Xq_dash )
Returns a generator direct current id
and quadrature current iq
in network reference frame.
ePowerSim.get_a_gen_dyn_idq
— Methodget_a_gen_dyn_idq(
vh, θh,
δ, ed_dash, eq_dash,
ra, X_d_dash, X_q_dash )
Returns a generator direct current id
and quadrature current iq
in network reference frame.
ePowerSim.get_a_gen_dyn_idq
— Methodget_a_gen_dyn_idq(
vh, θh,
δ, ω, ed_dash, eq_dash,
ra, X_d_dash, X_q_dash )
Returns a generator direct current id
and quadrature current iq
in network reference frame.
ePowerSim.get_a_gen_dyn_idq
— Methodget_a_gen_dyn_idq(
vh_θh,
δ_ω_ed_eq,
ra_X_d_dash_X_q_dash )
Returns a generator direct current id
and quadrature current iq
in network reference frame.
ePowerSim.get_a_gen_ph
— Methodget_a_gen_ph(
vd, vq ,id ,iq)
Returns a generator active power.
ePowerSim.get_a_gen_qh
— Methodget_a_gen_qh(
vd, vq ,id ,iq)
Returns a generator reactive power.
ePowerSim.get_a_gen_vd
— Method get_a_gen_vd(
gen_δ, gen_vh, gen_θh)
Returns a generator directive axis voltage.
ePowerSim.get_a_gen_vq
— Method get_a_gen_vq(
gen_δ, gen_vh, gen_θh)
Returns a generator quardrature axis voltage.
ePowerSim.get_a_model_integrated_intra_dyn_current_balance_pf_ΔI_idq_mismatch
— MethodIgilocloadrealB = ( idi * sin(δi) + iqi * cos(δ_i) )
IgilocloadimagB = ( iqi * sin(δi) - idi * cos(δ_i) )
IgilocloadrealA = ( Ploci * cos(θi) + Qloci * sin(θi) ) / vhi
IgilocloadimagA = ( Ploci * sin(θi) - Qloci * cos(θi)) / vhi
IgilocloadrealC = sum( vhk * Yik * cos( θk + α_ik ) )
IgilocloadrealC = -sum( vhk * Yik * sin( θk + α_ik ) )
ePowerSim.get_a_n2s_dict
— Methodget_a_n2s_dict(a_type_idxs )
Returns "indices to ordinal" dictionaries of indices of a list.
Example
atypeidx = Union{Symbol,String,Int64}[1,2,"dayo", :yusuff]
n2satype = getan2sdict(atype_idx )
ePowerSim.get_a_n2s_net_group
— Methodget_a_n2s_net_group(
a_net_group_idxs;
loc_load_exist = false,
transmission_group = false )
Returns streamlined idxs conversion dictionary
n2s_gens_idx =
get_a_n2s_net_group(gens_nodes_idx)
n2s_transmission_idxs =
get_a_n2s_net_group(transmission_nodes_idx;
transmission_group = true)
n2s_gens_with_loc_load_idxs =
get_a_n2s_net_group(gens_with_loc_load_idx;
loc_load_exist = true)
ePowerSim.get_a_namedtuple_dict_types_dyn_or_output_func
— Methodget_a_namedtuple_dict_types_dyn_or_output_func(
types_func,
dae_or_ode_type)
It return a singleton namedtuple. The property of the namedtuple is the type of modelling, which could either be :ode
or :dae
, while the property value is a dictionary of component models and their specific associated functions.
ePowerSim.get_a_node_state_algb_vars_indices_in_syms
— Methodget_a_node_state_algb_vars_indices_in_syms(
; node_syms_labels = node_syms_labels,
bus_name = bus_name, vars = [:ω, :δ])
Returns indices of state_algebraic variables of a node in the node syms list.
It is meant to extract the indices in sol.
ePowerSim.get_a_node_state_algb_vars_indices_in_system
— Methodget_a_node_state_algb_vars_indices_in_system(
; network_vars_labels = network_vars_labels,
bus_name = bus_name,
vars = [:ω, :δ])
Returns indices of state_algebraic variables of a node in the systems.
It is meant to extract the indices in sol.
ePowerSim.get_a_node_states_indices_in_system
— Methodget_a_node_states_indices_in_system(
; network_vars_labels = network_vars_labels,
bus_name = bus_name,
vars = [:δ, :ed_dash, :eq_dash])
Returns indices of a list of state variables vars
of a plant in the network state.
ePowerSim.get_a_node_states_vars_syms_in_system
— Methodget_a_node_states_vars_syms_in_system(
; network_vars_labels = network_vars_labels,
bus_name = bus_name,
vars = [:δ, :ed_dash, :eq_dash])
Returns labels of a list of state variables vars
of a plant in the network state labels.
ePowerSim.get_a_node_type_tup_idx_PQ_data_by_generic
— Methodget_a_node_type_tup_idx_PQ_data_by_generic(
idx, Pd, Qd;
baseMVA = 1.0,
node_type = :load )
Returns a tuple of (idx, Bus, P, Q, node_type)
for non-generation node.
ePowerSim.get_a_node_uh_x_conj_∑_ynj_x_vj
— MethodThe first element of nthnodeidxandadjnodesidx is the idx of the node
ePowerSim.get_a_node_∑_ynj_x_vj_by_Ybus
— MethodColumns are used because Julia access matrix via cols. It does not make any diffence, because Ybus is symetric.
Ybus_nth_col = Ybus[:,nth] == Ybus_nth_row = Ybus[nth,:]
Ybus_nth_col' * (vh .* exp.( im * θh ))
getanode∑ynjxvjbyYbus( vh, θh, Ybus[:,1] )
ePowerSim.get_a_status_steady_state_data
— Methodget_a_status_steady_state_data(
system_status;
<keyword arguments>)
It is used to simplify generation of parameters or data of a system that are needed for simulation.
Arguments
net_data_by_components_file
: the network data filecomponents_libs_dir
: the components library folderbasekV
: the base voltageuse_pu_in_PQ
: the boolean variable that determines if PQ should be in pu.line_data_in_pu
: the boolean variable that informs if line data are in pu,
use_init_u0
: the boolean variable that determines if initial state u0 should be used in a power flow. use_nlsolve
: the boolean variable that determines if nlsolve
should be used in power flow. pf_alg
: power flow solver abstol
: the absolute error tolerance reltol
: the relative error tolerance on_fault_time
: the on fault time clear_fault_time
: the clear fault time list_fault_point_from_node_a::Vector{Float64}=[0.3]
: the list containing a ratio of the fault point from the source (from) orientation of lines list_fault_resistance::Vector{Float64} = [0.001]
: the list containing fault resistances of each fault in the network. list_no_line_circuit::Vector{Float64} = [4]
: the list containing the number of circuits per faulted lines list_edges_to_have_fault::Vector{Int64} = [2]
: the list containing indices of lines that should have a fault. clear_fault_selection_list::Vector{Int64} = [1]
: the list containing indices of faulted lines to be cleared in list_edges_to_have_fault
. ode_alg
: the ode solver. daealg: the dae solver. dt: the solve interval. `withfaults::Bool=false`: a legacy boolean variable.
system_status
: can take the form of the following:pre_fault_state
:fault_state
:post_fault_state
ePowerSim.get_absract_type_dict_subsubtypes
— Methodget_absract_type_dict_subsubtypes(
absract_type )
Returns a dictionary of symbol to subsubtypes of an abstract types, e,g. AbstractPowerSystemComponent
. This is used to translate a symbol of a type to type
Example
get_absract_type_dict_subsubtypes(
absract_type )
dictsymboltypes = getabsracttypedictsubsubtypes( AbstractPowerSystemComponent )
dict_symbol_types[:pss_t2_cb]
will return pss_t2_cb
ePowerSim.get_abstract_type_dict_subtypes
— Methodget_abstract_type_dict_subtypes(
absract_type )
Returns a dictionary of concrete subtypes of absract_type.
The set of abstract types currently defined in the package are:
SdAvr, SdBranchElement, SdGen, SdGenPlant, SdGov, SdNonGen, SdNonGenPlant, SdPss.
They are subtypes of
AbstractPowerSystemComponent
ePowerSim.get_algebraic_vars_labels
— Methodget_algebraic_vars_labels(
dyn_pf_fun_kwd_net_idxs;
label_prefix = "bus" )
Return plants algebraic variable symbols or lables for all generator plants in a flattened vector.
Arguments
dyn_pf_fun_kwd_net_idxs
: the namedtuple of node's type indices.label_prefix::String="bus"
: the label that should be used as a prefix.
ePowerSim.get_case_data_by_csv
— Methodget_case_data_by_csv(
case_name;
<keyword arguments> )
Returns selected static parameters and dynamic types of components from network model csv files.
ePowerSim.get_comp_vector_of_nt_by_lens
— Methodget_comp_vector_of_namedtuple_by_lens
This functions uses a lens function for filtering.
The inputs are a lens_func
and a collection of namedtuple data
ePowerSim.get_components_libs_and_case_data
— Methodget_components_libs_and_case_data(
case_name;
<keyword arguments> )
Returns selected static parameters and dynamic types of components from network model csv files.
ePowerSim.get_components_properties_by_json
— Methodget_components_properties_by_json(
plant_generators_data_from_json;
<keyword arguments>)
Returns a vector of properties of components selected by the variables sequence_order
and selection
.
Arguments
sequence_order::Tuple{Symbol}=(:components_data, :gen)
: the selection order of components data.selections::Tuple{Symbol}=(:P, :Q)
: the tuple of parameters data to be selected.
ePowerSim.get_csv2tex
— Methodget_csv2tex(
csv_file;
wt_new_header_bool = false,
wt_selected_colums_bool = false,
new_header = nothing,
delim = ',',
normalizenames = true,
selected_colums = [] )
Converts a csv data to tex table.
ePowerSim.get_df2tex
— Method get_df2tex(df)
Converts a dataframe to a tex table.
ePowerSim.get_dict_first_to_tenth_funs
— Methodget_dict_first_to_tenth_funs(
no_nth_funcs)
Returns a dictionary of n numbers of functions first
, second
... tenth
.
ePowerSim.get_dict_n2s_streamlined_idx_by_mpc
— Methodget_dict_n2s_streamlined_idx_by_mpc(mpc_bus)
Returns "indices to ordinal" dictionaries of indices of various type of nodes in a network.
ePowerSim.get_dict_net_streamlined_idx_by_nodes_type_idxs
— Methodget_dict_net_streamlined_idx_by_nodes_type_idxs(
net_nodes_type_idxs)
Returns "indices to ordinal" dictionaries of indices of various type of nodes in a network.
These are:
n2s_slack_gens_idx, n2s_non_slack_gens_idx, n2s_gens_idx, n2s_non_gens_idx, n2s_load_idx, n2s_gens_with_loc_load_idxs, n2s_transmission_idxs, n2s_all_nodes_idx, n2s_nodes_with_demands_idx
It aligns indices of node types with the indices of parameters of node types.
Consider a 14 nodes network, where 6 nodes are generator nodes, 1 node is a transmission node, and 7 nodes are load nodes.
The indices of generator nodes in the network are gennodesidx = [1,2,3,6,8]. The size of gen_nodes_idx
is 5.
Lets define an array for reactive power, Qg = [-0.169, 0.42, 0.234, 0.122, 0.174]
How do we access the reactive power of the fifth generator, whose index in the network is 8? It is evident that Qg[8] will throw an error.
A way out is to use a dictionary
n2stypeidx = OrderedDict( idx => ord for (idx, ord) in zip(gennodesidx, collect(1:length(gennodesidx)) ))
i.e n2stypeidx = Dict(1=>1, 2=>2, 3=3, 6=>4, 8=5)
The reactive power of the fifth generator can be subsequently accessed as :
Qg[ n2stypeidx[ 8 ] ]
Note n2stypeidx[ 8 ] will produced 5.
The beauty of this is that, indices of nodes are not resticted to numbers. Strings, symbols can be used as indices.
If gennodesidx had been,
gennodesidx = ["node-gauteng","node-limpopo","node-wc","node-ec", "node-nw"]
n2stypeidx = OrderedDict( idx => ord for (idx, ord) in zip(gennodesidx, collect(1:length(gennodesidx)) ))
Qg[ n2stypeidx[ "node-nw" ] ] will produce, the reactive power of the fifth generator,
A generic function could be defined
function getn2sany( anetgroup_idxs)
return OrderedDict{Union{Symbol,String,Int64},Int64}(
net_idx =>idx
for (net_idx, idx) in zip(
a_net_group_idxs,
collect(1:length(
a_net_group_idxs )) ) )
end
ePowerSim.get_dict_net_to_streamlined_idx_by_mpc
— Methodget_dict_net_to_streamlined_idx_by_mpc(mpc_bus)
Returns "indices to ordinal" dictionaries of indices of various type of nodes in a network.
ePowerSim.get_dict_nt_params_from_json_lib_file
— Methodget_dict_nt_params_from_json_lib_file(
json_nt_params_libs_file )
Returns a dictionary of namedtuples of components parameters from a json library file
ePowerSim.get_dict_states_syms_from_json_lib_file
— Methodget_dict_states_syms_from_json_lib_file(
json_states_syms_lib_file)
Converts values read from json_states_syms_lib_file
to symbols
ePowerSim.get_dict_struct_name_type
— Methodget_dict_struct_name_type(
list_struct_sym_types)
Returns a mapping of data structure symbolic names to data structures.
ePowerSim.get_dict_types_dyn_or_output_func
— Methodget_dict_types_dyn_or_output_func(
types_func)
It converts a list of functions into a dictionaly of functions. A key in the dictionary is a type of a model of component, and the value is a specific function that is applicable to the component.
ePowerSim.get_dyn_V_ref_Tm_vh_id_iq_Idx
— Methodget_dyn_vh_id_iq_V_ref_Tm_Idx(
gens_nodes_idx)
Returns indices of V_ref
, Tm
, vh
, id
, iq
in a flattened vector V_ref_Tm_vh_id_iq
.
ePowerSim.get_dyn_red_vh_θh_idq
— Methodget_dyn_red_vh_θh_idq(
uh,
δ_ω_ed_dash_eq_dash_view;
<keywords arguments> )
Arguments
- gens_vh
- raXddashXqdash_view
- redvhθh_idx
- n2sgensidx
- n2snongens_idx
- gensnodesidx
- nodes_size
Returns [ red_vh_θh; gens_idq_flat ]
.
ePowerSim.get_dyn_v_ref_p_order_Png_Qng_Pll_Qll_Idx
— Methodget_dyn_v_ref_p_order_Png_Qng_Pll_Qll_Idx(
dyn_pf_fun_kwd_net_idxs)
Returns indices of v_ref
, p_order
, Png
, Qng
, Pll
, Qll
in a flattened vector v_ref_p_order_Png_Qng_Pll_Qll
.
ePowerSim.get_dyn_vh_id_iq_V_ref_Tm_Idx
— Methodget_dyn_vh_id_iq_V_ref_Tm_Idx(
gens_nodes_idx;
reverse_idx = false)
Returns indices of vh
, id
, iq
, V_ref
, Tm
in a flattened vector vh_id_iq_V_ref_Tm
.
ePowerSim.get_dyn_vh_id_iq_ωref0_vref0_porder0_Idx
— Methodget_dyn_vh_id_iq_ωref0_vref0_porder0_Idx(
gens_nodes_idx;
reverse_idx = false)
Returns indices of vh
, id
, iq
, ωref0
, vref0
, porder0
in a flattened vector vh_id_iq_ωref0_vref0_porder0
.
ePowerSim.get_dyn_δ_ed_dash_eq_dash_Png_Qng_Pll_Qll_Idx
— Methodget_dyn_δ_ed_dash_eq_dash_Png_Qng_Pll_Qll_Idx(
dyn_pf_fun_kwd_net_idxs)
Returns indices of δ
, ed_dash
, eq_dash
, Png
, Qng
, Pll
, Qll
in a flattened vector δ_ed_dash_eq_dash_Png_Qng_Pll_Qll
.
ePowerSim.get_dyn_δ_eq_dash_Png_Qng_Pll_Qll_Idx
— Methodget_dyn_δ_eq_dash_Png_Qng_Pll_Qll_Idx(
dyn_pf_fun_kwd_net_idxs)
Returns indices of δ
, eq_dash
, Png
, Qng
, Pll
, Qll
in a flattened vector δ_eq_dash_Png_Qng_Pll_Qll
.
ePowerSim.get_dyn_ω_ref_v_ref_p_order_Png_Qng_Pll_Qll_Idx
— Methodget_dyn_ω_ref_v_ref_p_order_Png_Qng_Pll_Qll_Idx(
dyn_pf_fun_kwd_net_idxs)
Returns indices of ω_ref
, v_ref
, p_order
, Png
, Qng
, Pll
, Qll
in a flattened vector v_ref_p_order_Png_Qng_Pll_Qll
.
ePowerSim.get_dyn_ωref0_vref0_porder0_id_iq_vh_Idx
— Methodget_dyn_ωref0_vref0_porder0_id_iq_vh_Idx(
gens_nodes_idx)
Returns indices of ωref0
, vref0
, porder0
, id
, iq
, vh
in a flattened vector ωref0_vref0_porder0_id_iq_vh
.
ePowerSim.get_dynamic_components_parameters_libs_from_json
— Methodget_dynamic_components_parameters_libs_from_json
Returns parameters of dynamic devices in the package parameters library.
The function is a dual of create_dynamic_components_parameters_libs_json
requires,
ePowerSim.get_dynamic_comps_init_out_dyn_callback_funcs
— Methodget_dynamic_comps_init_out_dyn_callback_funcs(
gens_govs_avrs_types)
Returns namedtuples of dynamic components functions comps_callback_paras_funs
, comps_init_funs
, comps_output_funs
, ode_comps_dyn_funs
, dae_comps_dyn_funs
, comps_dyn_funs
.
Arguments
- `
gens_govs_avrs_states_syms
: the namedtuple of states variables symbols of generators, governors and automatic voltage regulators.
ePowerSim.get_dynamic_id_iq_pg_vh_by_ur_ui
— Methodget_dynamic_id_iq_pg_vh_by_ur_ui(
u_r, u_i, δ,
ed_dash,
eq_dash,
ra,
X_d_dash,
X_q_dash )
Returns a list of id
, iq
, pg
and vh
for a given vh
, θh
, δ
, ed_dash
, eq_dash
, ra
, X_d_dash
, X_q_dash
.
ePowerSim.get_dynamic_id_iq_pg_vh_by_ur_ui
— Methodget_dynamic_id_iq_pg_vh_by_ur_ui(
u_r, u_i, δ, ω, ed_dash, eq_dash,
ra, X_d_dash, X_q_dash )
Returns a list of id
, iq
, pg
and vh
for a given vh
, θh
, δ
, ed_dash
, eq_dash
, ra
, X_d_dash
, X_q_dash
.
ePowerSim.get_dynamic_id_iq_pg_vh_by_vhθh
— Methodget_dynamic_id_iq_pg_vh_by_vhθh(
vh, θh, δ, ed_dash, eq_dash, ra,
X_d_dash, X_q_dash )
Returns a list of id
, iq
, pg
and vh
for a given vh
, θh
, δ
, ed_dash
, eq_dash
, ra
, X_d_dash
, X_q_dash
.
ePowerSim.get_dynamic_id_iq_pg_vh_by_vhθh
— Methodget_dynamic_id_iq_pg_vh_by_vhθh(
vh, θh, δ, ω, ed_dash, eq_dash,
ra, X_d_dash, X_q_dash )
Returns a list of id
, iq
, pg
and vh
for a given vh
, θh
, δ
, ed_dash
, eq_dash
, ra
, X_d_dash
, X_q_dash
.
ePowerSim.get_dynamic_idq_ur_ui
— Methodget_dynamic_idq_ur_ui(
u_r, u_i, δ_ω_ed_eq, ra_X_d_dash_X_q_dash)
Returns a generator direct current id
and quadrature current iq
in network reference frame.
ePowerSim.get_dynamic_idq_ur_ui
— Methodget_dynamic_idq_ur_ui(
u_r, u_i, δ, ed_dash, eq_dash,
ra, X_d_dash, X_q_dash)
Returns a generator direct current id
and quadrature current iq
in network reference frame.
ePowerSim.get_dynamic_idq_vhθh
— Methodget_dynamic_idq_vhθh(
vh,
θh,
δ_ω_ed_eq,
ra_Xd_dash_Xq_dash )
Returns a generator direct current id
and quadrature current iq
.
ePowerSim.get_dynamic_idq_vhθh
— Methodget_dynamic_idq_vhθh(
vh,
θh,
δ,
ed_dash,
eq_dash,
ra,
X_d_dash,
X_q_dash )
Returns a generator direct current id
and quadrature current iq
.
ePowerSim.get_dynamic_idq_vhθh
— Methodget_dynamic_idq_vhθh(
vh,
θh,
δ,
ω,
ed_dash,
eq_dash,
ra,
X_d_dash,
X_q_dash )
Returns a generator direct current id
and quadrature current iq
.
ePowerSim.get_dynamic_idq_vhθh
— Methodget_dynamic_idq_vhθh(
vh_θh,
δ_ω_ed_eq,
ra_X_d_dash_X_q_dash )
Returns a generator direct current id
and quadrature current iq
.
ePowerSim.get_dynamic_idq_θ_π_ur_ui
— Methodget_dynamic_idq_θ_π_ur_ui(
u_r, u_i, δ_ω_ed_eq,
ra_X_d_dash_X_q_dash)
Returns a generator direct current id
and quadrature current iq
in network reference frame.
ePowerSim.get_dynamic_idq_θ_π_vhθh
— Methodget_dynamic_idq_θ_π_vhθh(
vh,
θh,
δ_ω_ed_eq,
ra_X_d_dash_X_q_dash )
Returns a generator direct current id
and quadrature current iq
.
ePowerSim.get_dynamic_idq_θ_π_vhθh
— Methodget_dynamic_idq_θ_π_vhθh(
vh, θh,
δ, ω, ed_dash, eq_dash,
ra, X_d_dash, X_q_dash )
Returns a generator direct current id
and quadrature current iq
.
ePowerSim.get_dynamic_idq_θ_π_vhθh
— Methodget_dynamic_idq_θ_π_vhθh(
vh_θh,
δ_ω_ed_eq,
ra_X_d_dash_X_q_dash )
Returns a generator direct current id
and quadrature current iq
.
ePowerSim.get_dynamic_pg_from_id_iq
— Methodget_dynamic_pg_from_id_iq(
id, iq, δ, ed_dash, eq_dash, ra,
X_d_dash, X_q_dash)
Returns a generator active power for a given id
, iq
, δ
, ed_dash
, eq_dash
, ra
, X_d_dash
, X_q_dash
.
ePowerSim.get_dynamic_pg_from_id_iq
— Methodget_dynamic_pg_from_id_iq(
id, iq, δ, ω, ed_dash, eq_dash,
ra, X_d_dash, X_q_dash)
Returns a generator active power for a given id
, iq
, δ
, ed_dash
, eq_dash
, ra
, X_d_dash
, X_q_dash
.
ePowerSim.get_dynamic_ph_by_vhθh_δ_idq
— Methodget_dynamic_ph_by_vhθh_δ_idq(
vh, θh, δ, id, iq )
Returns a generator active power for a given vh
, θh
, δ
, id
, and iq
.
ePowerSim.get_dynamic_ph_by_vhθh_δ_idq
— Methodget_dynamic_ph_by_vhθh_δ_idq(
vh, θh, δ, ω, ed_dash,
eq_dash, id, iq )
Returns a generator active power for a given vh
, θh
, δ
, ω
, ed_dash
, eq_dash
, id
, and iq
.
ePowerSim.get_dynamic_qh_by_vhθh_δ_idq
— Methodget_dynamic_qh_by_vhθh_δ_idq(
vh, θh, δ, id, iq )
Returns a generator reactive power for a given vh
, θh
, δ
, id
, and iq
.
ePowerSim.get_dynamic_qh_by_vhθh_δ_idq
— Methodget_dynamic_qh_by_vhθh_δ_idq(
vh, θh, δ, ω, ed_dash,
eq_dash, id, iq )
Returns a generator active power for a given vh
, θh
, δ
, ω
, ed_dash
, eq_dash
, id
, and iq
.
ePowerSim.get_dynamic_τe_from_id_iq
— Methodget_dynamic_τe_from_id_iq(
id, iq, δ, ed_dash, eq_dash, ra,
X_d_dash, X_q_dash)
Returns a generator torque for a given id
, iq
, δ
, ed_dash
, eq_dash
, ra
, X_d_dash
, X_q_dash
.
ePowerSim.get_edge_y_data_by_generic
— Methodget_edge_y_data_by_generic(
fbus, tbus,
r, x, b,
ratio, angle,
status,
baseMVA, basekV)
Returns per unit π parameters for branches admittances.
ePowerSim.get_edge_y_line_data_by_generic
— Methodget_edge_y_line_data_by_generic(
fbus, tbus,
r, x, b,
ratio, angle,
status,
baseMVA, basekV)
Returns per unit π parameters for branches admittances.
ePowerSim.get_edge_y_transformer_data_by_generic
— Methodget_edge_y_transformer_data_by_generic(
fbus, tbus,
r, x, b,
ratio, angle,
status,
baseMVA, basekV)
Returns per unit π parameters for transformers admittances.
ePowerSim.get_edges_Ybr_by_generic
— Methodget_edges_Ybr_by_generic(
r, x, b,
ratio, angle,
edge_type,
Gs, Bs;
baseMVA = 1.0,
basekV = 1.0 )
Returns a list of per unit π admittance matrices for branches.
ePowerSim.get_edges_Ybr_cal_and_edges_orientation_by_generic
— Methodget_edges_Ybr_cal_and_edges_orientation_by_generic(
branches_fbus,
branches_tbus,
r, x, b,
ratio, angle,
edge_type,
Gs, Bs;
baseMVA = 1.0, basekV = 1.0 )
Returns namedtuple of branches π admittance matrices and branches orientations.
ePowerSim.get_edges_orientation
— Methodget_edges_orientation(edges_collection)
Returns edges orientation (src, dst)
.
ePowerSim.get_edges_orientation_by_generic
— Methodget_edges_orientation_by_generic(
branches_fbus,
branches_tbus )
Returns branches orientations in form of a list of tuples (src, dst)
.
ePowerSim.get_edges_r_x_b_ratio_angle_idx
— Methodget_edges_r_x_b_ratio_angle_idx(
edges_size)
Returns indices of r
, x
, b
, ratio
and angle
in a flattened vector edges_r_x_b_ratio_angle
.
ePowerSim.get_eigens
— Methodget_eigens(system_matrix)
This function returns eigen values, left and right eigen vectors.
ePowerSim.get_flat_full_vh_θh_and_idxs
— Methodget_flat_full_vh_θh_and_idxs(
vh, θh)
Returns a flattened concatenated full_vh_θh
and indices in the flattened vector.
ePowerSim.get_flat_intg_vh_θh_id_iq_and_idxs
— Methodget_flat_intg_vh_θh_id_iq_and_idxs(
vh, θh, gens_i_d_0, gens_i_q_0 )
Returns a flattened concatenated vec_intg_vh_θh_id_iq
and indices in the flattened vector.
ePowerSim.get_flattened_to_components_vector_var_Idx
— Methodget_flattened_to_components_vector_var_Idx(
vec_of_vec_var )
Returns indices in a flattened vector for each vector in a vector of vector.
ePowerSim.get_gen_node_static_data_tup_by_mpc
— Methodget_gen_node_static_data_tup_by_mpc(
idx,
vmax,vmin,
Pg,Qg,
Vg,
Qmax, Qmin,
Pmax, Pmin;
mpc_baseMVA = 1.0 )
Returns a generator's index and static parameters as a tuple of index and namedtuple of static parameters.
ePowerSim.get_gen_nodes_dict_static_data_by_mpc
— Methodget_gen_nodes_dict_static_data_by_mpc(
mpc_bus,
mpc_gen;
mpc_baseMVA = 1.0 )
Returns an OrderedDict of static data indexed by generators indices.
ePowerSim.get_gen_nodes_static_tup_data_by_mpc
— Methodget_gen_nodes_static_tup_data_by_mpc(
mpc_bus,
mpc_gen;
mpc_baseMVA=1.0 )
Returns a list of static parameters for single or multi generators per node for all generation nodes.
ePowerSim.get_gen_nodes_δ_ω_ed_dash_eq_dash
— Methodget_gen_nodes_δ_ω_ed_dash_eq_dash(
state, nodes_δ_ω_ed_dash_eq_dash_Idxs )
Returns a flattened vector of gensδ, gensω, genseddash, genseqdash based on nodesδωeddasheqdash_Idxs.
ePowerSim.get_gen_nodes_δ_ω_ed_dash_eq_dash_views
— Methodget_gen_nodes_δ_ω_ed_dash_eq_dash_views(
state, nodes_δ_ω_ed_dash_eq_dash_Idxs )
Returns a flattened view of gensδ, gensω, genseddash, genseqdash based on nodesδωeddasheqdash_Idxs.
ePowerSim.get_gen_nodes_ω_ed_dash_eq_dash
— Methodget_gen_nodes_ω_ed_dash_eq_dash(
state, nodes_ω_ed_dash_eq_dash_Idxs )
Returns a flattened vector of gensω, genseddash, genseqdash based on nodesωeddasheqdash_Idxs.
ePowerSim.get_gen_nodes_ω_ed_dash_eq_dash_views
— Methodget_gen_nodes_ω_ed_dash_eq_dash_views(
state, nodes_ω_ed_dash_eq_dash_Idxs )
Returns a flattend view of gensω, genseddash, genseqdash based on nodesωeddasheqdash_Idxs.
ePowerSim.get_gen_plants_gens_properties_by_json
— MethodThis function returns a vector of properties of generator nodes, selected by the variables sequence_order
and selection
.
ePowerSim.get_gen_plants_local_load_by_json
— MethodThis function returns a vector of local loads of generators otherwise, it returns an empty vector.
ePowerSim.get_gen_sub_static_data_tup_by_mpc
— Methodget_gen_sub_static_data_tup_by_mpc(
idx,
n2s_gens_idx,
mpc_gen )
Returns a tuple of static parameters for a generator.
ePowerSim.get_gencost_data_by_mpc
— Methodget_gencost_data_by_mpc(
mpc_gencost;
mpc_baseMVA =
1.0)
Returns a dict Dict{:cost_type,:startup,:shutdown,:n,:c_n_1,:c_1,:c_0 }
for generators operation cost.
ePowerSim.get_generic_Pg_Png_Qng_Idx
— Methodget_generic_Pg_Png_Qng_Idx(
dyn_pf_fun_kwd_net_idxs)
Returns indices of generator nodes active power generation Pg
, generator nodes reactive power generation Qg
, non-generator nodes active power demand Png
, non-generator nodes reactive power demand Qng
in a flattened Pg_Png_Qng
vector.
ePowerSim.get_generic_Pg_Qg_Png_Qng_Pll_Qll_Idx
— Methodget_generic_Pg_Qg_Png_Qng_Pll_Qll_Idx(
dyn_pf_fun_kwd_net_idxs)
Returns indices of generator nodes active power generation Pg
, generator nodes reactive power generation Qg
, non-generator nodes active power demand Png
, non-generator nodes reactive power demand Qng
, generator nodes local active power demand Pll
, generator nodes local reactive power demand Qll
in a flattened Pg_Qg_Png_Qng_Pll_Qll
vector.
ePowerSim.get_generic_Png_Qng_Pll_Qll_Idx
— Methodget_generic_Png_Qng_Pll_Qll_Idx(
dyn_pf_fun_kwd_net_idxs)
Returns indices of non-generator nodes active power demand Png
, non-generator nodes reactive power demand Qng
, generator nodes local active power demand Pll
, generator nodes local reactive power demand Qll
in a flattened Png_Qng_Pll_Qll
vector.
ePowerSim.get_generic_algebraic_state_sym
— Methodget_generic_algebraic_state_sym(
gens_nodes_idx,
all_nodes_idx)
Returns algebraic variables symbols.
ePowerSim.get_generic_electro_mechanical_oscillation_indicies
— Methodget_generic_electro_mechanical_oscillation_indicies(
pf_P_gens, pf_Q_gens,
vh, gens_vh, gens_θh, ωs;
kwd_para =
inm_electro_mech_oscill_kwd_para )
Returns a nampedruple of (;Yint, Yred, δg, Eg, Cinm, Dinm, Aω_matrix, A_matrix)
.
ePowerSim.get_generic_flat_vh_flat_θh_Idx
— Methodget_generic_flat_vh_flat_θh_Idx(
gens_nodes_idx,
all_nodes_idx)
Returns a flattend vector of indices of nodes voltages magnitude and nodes voltages angle.
ePowerSim.get_generic_flat_vh_flat_θh_Idx
— Methodget_generic_flat_vh_flat_θh_Idx(
all_nodes_idx)
Returns a flattend vector of indices of nodes voltages magnitude and nodes voltages angle.
ePowerSim.get_generic_flat_vh_flat_θh_id_iq_Idx
— Methodget_generic_flat_vh_flat_θh_id_iq_Idx(
gens_nodes_idx,
all_nodes_idx)
Returns a flattend vector of indices of nodes voltages magnitude vh
, nodes voltages angle θh
, generators direct-axis currents id
, generators quadrature axix currents iq
.
ePowerSim.get_generic_flat_vh_flat_θh_wt_slack_value_Idx
— Methodget_generic_flat_vh_flat_θh_wt_slack_value_Idx(
all_nodes_idx)
Returns a flattend vector of indices of nodes voltages magnitude vh
, nodes voltages angle θh
, and slack
variable`.
ePowerSim.get_generic_line_loss_outage_wt_or_no_ref_adjs
— Methodget_generic_line_loss_outage_wt_or_no_ref_adjs(
outage_type,
ntuple_status_steady_state_data,
line_outage_time,
generation_adjustment_time;
<keywords arguments> )
Returns dynamic solution of a network with line outage.
Arguments
outage_type
:line_outage_wt_pref_adjs
:line_outage_wt_vpref_adjs
:line_outage
ntuple_status_steady_state_data
line_outage_time
generation_adjustment_time
sim_timespan = (0.0, 20)
pf_alg = NewtonRaphson()
dae_alg = IDA()
ode_alg = Rodas4()
abstol = 1e-12
reltol = 1e-12
nt_system_dynamics_fun_type =
(;system_dynamics_fun_type = :dae_line_loss_pre_fault_post_pf_funcs, system_dynamics_fun = line_loss_generic_dynamics_wt_pre_fault_post_by_dae_pf_funcs!)
nt_system_dynamics_fun_type
is a namedtuple of dynamic function type symbol and a dynamic function.
The list of function types are given below:
dae funs symbols denoted by system_dynamics_fun_type
- :daegenericprefaultpostpffuncs
- :daeYnetprefaultpostpffuncs
- :daelinelossprefaultpostpf_funcs
- :daelineoutageprefaultpostpf_funcs
- :daeYnetprepostpf_funcs
functions denoted by systemdynamicsfun
- genericdynamicswtprefaultpostbydaepf_funcs!
- Ynetgenericdynamicswtprefaultpostbydaepffuncs!
- linelossgenericdynamicswtprefaultpostbydaepf_funcs!
line_outage_generic_dynamics_wt_pre_post_fault_by_dae_pf_funcs!
Ynet_generic_dynamics_wt_pre_post_fault_by_dae_pf_funcs!
mm ode funs symbols denoted by system_dynamics_fun_type
- :mmgenericprefaultpostpffuncs
- :mmYnetprefaultpostpffuncs
- :mmlinelossprefaultpostpf_funcs
- :mmlineoutageprefaultpostpf_funcs
- :mmYnetprepostpf_funcs
functions denoted by systemdynamicsfun
mm_generic_dynamics_wt_pre_fault_post_by_ode_pf_funcs!
mm_Ynet_generic_dynamics_wt_pre_fault_post_by_ode_pf_funcs!
mm_line_loss_generic_dynamics_wt_pre_fault_post_by_ode_pf_funcs!
mm_line_outage_generic_dynamics_wt_pre_post_fault_by_ode_pf_funcs!
mm_Ynet_generic_dynamics_wt_pre_post_fault_by_ode_pf_funcs!
ePowerSim.get_generic_line_loss_outage_wt_or_no_ref_adjs
— Methodget_generic_line_loss_outage_wt_or_no_ref_adjs(
outage_type,
on_fault_time,
clear_fault_time,
line_outage_time,
generation_adjustment_time,
net_data_by_components_file;
<keywords arguments> )
Returns dynamic solution of a network with line outage.
Arguments
outage_type
:line_outage_wt_pref_adjs
:line_outage_wt_vpref_adjs
:line_outage
on_fault_time
clear_fault_time
net_data_by_components_file
components_libs_dir
data_dir
line_outage_time
generation_adjustment_time
sim_timespan = (0.0, 20)
pf_alg = NewtonRaphson()
dae_alg = IDA()
ode_alg = Rodas4()
abstol = 1e-12
reltol = 1e-12
nt_system_dynamics_fun_type =
(;system_dynamics_fun_type = :dae_line_loss_pre_fault_post_pf_funcs, system_dynamics_fun = line_loss_generic_dynamics_wt_pre_fault_post_by_dae_pf_funcs!)
nt_system_dynamics_fun_type
is a namedtuple of dynamic function type symbol and a dynamic function.
The list of function types are given below:
dae funs symbols denoted by system_dynamics_fun_type
- :daegenericprefaultpostpffuncs
- :daeYnetprefaultpostpffuncs
- :daelinelossprefaultpostpf_funcs
- :daelineoutageprefaultpostpf_funcs
- :daeYnetprepostpf_funcs
functions denoted by systemdynamicsfun
- genericdynamicswtprefaultpostbydaepf_funcs!
- Ynetgenericdynamicswtprefaultpostbydaepffuncs!
- linelossgenericdynamicswtprefaultpostbydaepf_funcs!
line_outage_generic_dynamics_wt_pre_post_fault_by_dae_pf_funcs!
Ynet_generic_dynamics_wt_pre_post_fault_by_dae_pf_funcs!
mm ode funs symbols denoted by system_dynamics_fun_type
- :mmgenericprefaultpostpffuncs
- :mmYnetprefaultpostpffuncs
- :mmlinelossprefaultpostpf_funcs
- :mmlineoutageprefaultpostpf_funcs
- :mmYnetprepostpf_funcs
functions denoted by systemdynamicsfun
mm_generic_dynamics_wt_pre_fault_post_by_ode_pf_funcs!
mm_Ynet_generic_dynamics_wt_pre_fault_post_by_ode_pf_funcs!
mm_line_loss_generic_dynamics_wt_pre_fault_post_by_ode_pf_funcs!
mm_line_outage_generic_dynamics_wt_pre_post_fault_by_ode_pf_funcs!
mm_Ynet_generic_dynamics_wt_pre_post_fault_by_ode_pf_funcs!
ePowerSim.get_generic_namedtuple_per_plant_para_wt_kwd_para
— Methodget_generic_namedtuple_per_plant_para_wt_kwd_para(
ωref0_vref0_porder0_id_iq_vh;
kwd_para = plants_kwd_para )
Returns namedtuples of parameters per plant. It is used in generating a namedtuple consisting of data struture needed to simulate a generator plant. A generator plant can consist of a generator, gov, avr, etc.
Arguments
ωref0_vref0_porder0_id_iq_vh
: the flattend vector consisting concatenation ofωref0
,vref0
,porder0
,id
,iq
, andvh
- plantskwdpara:
ePowerSim.get_generic_network_vars_labels
— Methodget_generic_network_vars_labels(
plants_states_syms,
dyn_pf_fun_kwd_net_idxs,
dyn_pf_fun_kwd_n2s_idxs
;label_prefix = "bus",
plants_states_by_per_comp = false,
plants_states_by_per_plant = false
)
Returns namedtuples of state_labels
, algebraic_vars_labels
, network_vars_labels
.
Arguments
plants_states_syms
: the plants states variables symbols per plant for all generator plants.dyn_pf_fun_kwd_net_idxs
: the namedtuple of node's type indices.dyn_pf_fun_kwd_n2s_idxs
: the namedtuple of node's type indices translation dictionaries.
ePowerSim.get_generic_nodes_names
— Methodget_generic_nodes_names(
dyn_pf_fun_kwd_net_idxs,
n2s_all_nodes_idx)
Returns namedtuples of nodes types names all_nodes_names
, gens_nodes_names
, non_gens_nodes_names
.
Arguments
dyn_pf_fun_kwd_net_idxs
: the namedtuple of node's type indices.dyn_pf_fun_kwd_n2s_idxs
: the namedtuple of node's type indices translation dictionaries.
ePowerSim.get_generic_scale_Pg_Png_Qng_Idx
— Methodget_generic_scale_Pg_Png_Qng(
dyn_pf_fun_kwd_net_idxs)
Returns indices of scale variable scale
, generator nodes active power generation Pg
, non-generator nodes active power demand Png
, non-generator nodes reactive power demand Qng
in a flattened scale_Pg_Qg_Png_Qng
vector.
ePowerSim.get_generic_scale_Pg_Qg_Png_Qng_Pll_Qll_Idx
— Methodget_generic_scale_Pg_Qg_Png_Qng_Pll_Qll_Idx(
dyn_pf_fun_kwd_net_idxs)
Returns indices of scale variable scale
, generator nodes active power generation Pg
, generator nodes reactive power generation Qg
, non-generator nodes active power demand Png
, non-generator nodes reactive power demand Qng
, generator nodes local active power demand Pll
, generator nodes local reactive power demand Qll
in a flattened scale_Pg_Qg_Png_Qng_Pll_Qll
vector.
ePowerSim.get_generic_stability_static_powerflow
— Methodget_generic_stability_static_powerflow(
pf_PQ_param ;
kwd_para =
stability_static_powerflow_kwd_para)
Returns a tuple of (vh, θh, pf_P_gens, pf_Q_gens)
based on powerflow.
ePowerSim.get_generic_state_sym
— Methodget_generic_state_sym(
gens_govs_avrs_states_syms,
gens_nodes_idx;
label_prefix = "bus")
Return plants states variables symbols or lables for all generator plants in a flattened vector.
A generator plant consist of a generator, automatic voltage regulator, governor etc.
ePowerSim.get_generic_system_simulation_parameters
— Methodget_generic_system_simulation_parameters(
net_data_by_components_file;
<keyword arguments>)
It is used to simplify generation of parameters or data of a system that are needed for simulation.
Arguments
net_data_by_components_file
: the network data filecomponents_libs_dir
: the components library folderbasekV
: the base voltageuse_pu_in_PQ
: the boolean variable that determines if PQ should be in pu.line_data_in_pu
: the boolean variable that informs if line data are in pu,
use_init_u0
: the boolean variable that determines if initial state u0 should be used in a power flow. use_nlsolve
: the boolean variable that determines if nlsolve
should be used in power flow.
pf_alg
: power flow solver ode_alg
: ode solverdae_alg`: dae solver
ePowerSim.get_generic_vh_vhf_Idx
— Methodget_generic_vh_vhf_Idx(
all_nodes_idx;
no_lines_fault = 1)
Returns a flattend vector of indices of nodes voltages magnitude vh
, and fault node voltages magnitude vhf
.
ePowerSim.get_generic_vh_vhf_θh_θhf_id_iq_Idx
— Methodget_generic_vh_vhf_θh_θhf_id_iq_Idx(
gens_nodes_idx,
all_nodes_idx;
no_lines_fault = 1)
Returns a flattend vector of indices of nodes voltages magnitude vh
, nodes voltages angle θh
, generators direct-axis currents id
, generators quadrature axix currents iq
, fault node voltages magnitude vhf
, fault nodes voltage angle θhf
.
ePowerSim.get_generic_vh_θh_id_iq_vhf_θhf_Idx
— Methodget_generic_vh_θh_id_iq_vhf_θhf_Idx(
gens_nodes_idx,
all_nodes_idx;
no_lines_fault = 1)
Returns a flattend vector of indices of nodes voltages magnitude vh
, nodes voltages angle θh
, generators direct-axis currents id
, generators quadrature axix currents iq
, fault node voltages magnitude vhf
, fault nodes voltage angle θhf
.
ePowerSim.get_generic_θh_θhf_Idx
— Methodget_generic_θh_θhf_Idx(
all_nodes_idx;
no_lines_fault = 1)
Returns a flattend vector of indices of nodes voltages angle θh
, fault nodes voltage angle θhf
.
ePowerSim.get_gens_dynamic_id_iq_pg_vh_by_ur_ui
— Methodget_gens_dynamic_id_iq_pg_vh_by_ur_ui(
gens_ur_ui_post_pf,
gen_nodes_δ_ω_ed_dash_eq_dash_views,
gen_nodes_ra_Xd_dash_Xq_dash_view )
Returns a list of id
, iq
, pg
and vh
for a given vh
, θh
, δ
, ed_dash
, eq_dash
, ra
, X_d_dash
, X_q_dash
.
ePowerSim.get_gens_dynamic_id_iq_pg_vh_by_vhθh
— Methodget_gens_dynamic_id_iq_pg_vh_by_vhθh(
gens_vh_θh_post_pf,
gen_nodes_δ_ω_ed_dash_eq_dash_views,
gen_nodes_ra_Xd_dash_Xq_dash_view )
Returns a list of id
, iq
, pg
and vh
for a given vh
, θh
, δ
, ed_dash
, eq_dash
, ra
, X_d_dash
, X_q_dash
.
ePowerSim.get_gens_dynamic_ph_by_vhθh_δ_idq
— Methodget_gens_dynamic_ph_by_vhθh_δ_idq(
gens_vh, gens_θh,
gens_δ,
gens_id, gens_iq )
Returns generators active power.
ePowerSim.get_gens_dynamic_ph_by_vhθh_δ_idq
— Methodget_gens_dynamic_ph_by_vhθh_δ_idq(
gens_vh_θh,
gens_nodes_δ_ω_ed_dash_eq_dash,
gens_id_iq )
Returns generators active power.
ePowerSim.get_gens_dynamic_qh_by_vhθh_δ_idq
— Methodget_gens_dynamic_qh_by_vhθh_δ_idq((
gens_vh, gens_θh,
gens_δ,
gens_id, gens_iq )
Returns generators active power.
ePowerSim.get_gens_dynamic_qh_by_vhθh_δ_idq
— Methodget_gens_dynamic_qh_by_vhθh_δ_idq(
gens_vh_θh,
gens_nodes_δ_ω_ed_dash_eq_dash,
gens_id_iq )
Returns generators active power.
ePowerSim.get_gens_govs_avrs_states_syms_by_json
— Method get_gens_govs_avrs_states_syms_by_json(
net_data_by_components_file;
components_libs_dir =
components_libs_dir )
Retrives states variables symbols gens_govs_avrs_states_syms
, gens_govs_avrs_types
for different types of gens, govs, and avrs from the library of state symbols.
Arguments
net_data_by_components_file::String
: the path to network json file.components_libs_dir::String
: the path to components library folder.
This information is stored in :
- componentslibsdir: - states-syms - gens - govs - avrs
ePowerSim.get_gens_govs_avrs_types_by_json
— Methodget_gens_govs_avrs_types_by_json(
plant_generators_data_from_json)
It selects :gen
, :gov
, :avr
as a tuple from :components_type
property of a plant.
:components_type
property of a plant contains other properties such as :loc_load
.
ePowerSim.get_gens_state_vars_idx_in_state
— Methodget_gens_state_vars_idx_in_state(
network_vars_labels,
# all_nodes_idx,
dyn_pf_fun_kwd_net_idxs,
n2s_all_nodes_idx;
selected_gens_state_vars_syms =
(:δ, :ed_dash, :eq_dash) )
Returns state variables indices in the state for a selected set of variables in selected_gens_state_vars_syms
.
Arguments
network_vars_labels
: the system variables labels.dyn_pf_fun_kwd_net_idxs
: the namedtuple of node's type indices.selected_gens_state_vars_syms::Tuple{Symbol}=(:δ, :ed_dash, :eq_dash)
: the selected state variables.
ePowerSim.get_gens_vd
— Methodget_gens_vd(
gens_δ, vh, θh;
gens_nodes_idx)
Returns generators direct axis voltage.
ePowerSim.get_gens_vq
— Methodget_gens_vq(
gens_δ, vh, θh;
gens_nodes_idx)
Returns generators quardrature axis voltage.
ePowerSim.get_id_iq_pg_vh_Idx
— Methodget_id_iq_pg_vh_Idx(
gens_nodes_idx)
Returns indices of id
, iq
, pg
, vh
in a flattened vector id_iq_pg_vh
.
ePowerSim.get_idxs_in_flattened_by_nodes_idx_wt_vars_syms
— Methodget_idxs_in_flattened_by_nodes_idx_wt_vars_syms(
list_state_vars_syms,
gens_nodes_idx )
Returns Idxs of variables per node based on a list of variables.
Example
tgensnodes_idx = [1, 2, 3]
tliststatevarssyms = [:δ, :ω, :eqdash, :Efd]
getidxsinflattenedbynodesidxwtvarssyms( tliststatevarssyms, tgensnodesidx )
Vector{UnitRange{Int64}}:
1:4 5:8 9:12
ePowerSim.get_labels_by_nodes_idxs_and_vec_vec_syms
— Methodget_labels_by_nodes_idxs_and_vec_vec_syms(
nodes_idxs,
plants_states_syms;
label_prefix = "bus" )
Returns labels for state variables for a list of nodes in nodes_idxs
.
Arguments
nodes_idxs
: the list of nodes indices.plants_states_syms
: the state variables symbols per plant for all plants.
ePowerSim.get_list_vars_to_plot_by_syms
— MethodThis function returns a vector of strings from a list of list of symbols of variables to be plotted.
listselectedsymslist = [[:ω, :δ, :eddash, :eqdash], [:xg1, :xg2, :xg3, :τmtilade], [:vm, :vr1, :vr2, :vftilade], [:phatin, :v_ref]]
listofplotnames = getvarstoplotbysyms( listoflistsselectedsyms)
ePowerSim.get_load_nodes_idx_wt_type_tup_by_mpc
— Method get_load_nodes_idx_wt_type_tup_by_mpc(
mpc_load_type_data )
Returns tuple of load nodes indices, load nodes types and static data.
ePowerSim.get_load_nodes_static_tup_data_by_mpc
— Methodget_load_nodes_static_tup_data_by_mpc(
mpc_bus;
mpc_baseMVA = 1.0)
Returns tuple of load nodes indices and static data.
ePowerSim.get_load_scaling_red_continuation_distributed_slack_pf_ΔPQ_mismatch!
— MethodWorked for powerflow and continuation powerflow.
ePowerSim.get_loc_load_tup_idx_PQ_data_by_mpc
— Methodget_loc_load_tup_idx_PQ_data_by_mpc(
idx, Pd, Qd;
mpc_baseMVA = 1.0)
Returns a tuple of (idx, Bus, loc_P, loc_Q, node_type)
for generation node local load.
ePowerSim.get_mass_matrix_and_bool_dae_vars
— Methodget_mass_matrix_and_bool_dae_vars(
state_labels,
algebraic_vars_labels)
Returnsfor a system and generator mass matrices and dae boolean variables model_mass_matrix
, model_bool_dae_vars
, ode_gens_mass_matrix
, ode_gens_bool_dae_vars
.
ePowerSim.get_matpower_cases_files
— Methodget_matpower_cases_files
Returns all matpower files in a folder
ePowerSim.get_matpower_mpc_type_iobuffer_by_case_file
— Methodget_matpower_mpc_type_iobuffer_by_case_file
An utility function to get matpower mpc type (section) based on a given string type_key
.
ePowerSim.get_matpower_mpc_type_iobuffer_by_dict
— Methodget_matpower_mpc_type_iobuffer_by_dict
An utility function to get matpower mpc type (section) based on a given string type_key
.
ePowerSim.get_matpower_scalar_as_iobuffer_by_case_file
— Methodget_matpower_scalar_as_iobuffer_by_case_file
An utility function to get matpower scalar based on a given string type_key_string
.
ePowerSim.get_matpower_scalar_as_iobuffer_by_symbol
— Methodget_matpower_scalar_as_iobuffer_by_symbol
An utility function to get matpower scalar based on a given symbol type_key_sym
.
ePowerSim.get_model_nodes_types_names
— Methodget_model_nodes_types_names(
dyn_pf_fun_kwd_net_idxs,
dyn_pf_fun_kwd_n2s_idxs )
Returns nodes labels for generator buses, non-generator buses and all buses.
Arguments
dyn_pf_fun_kwd_net_idxs
: the namedtuple of node's type indices.dyn_pf_fun_kwd_n2s_idxs
: the namedtuple of node's type indices translation dictionaries.
ePowerSim.get_model_syms
— Methodget_model_syms(
state_labels,
dyn_pf_fun_kwd_net_idxs;
label_prefix = "bus")
Return a system model symbols or labels for state and algebraic variables in a flattened vector.
Arguments
state_labels
: the system state variables labels.dyn_pf_fun_kwd_net_idxs
: the namedtuple of node's type indices.label_prefix::String="bus"
: the label that should be used as a prefix.
ePowerSim.get_n2s_any
— Methodget_n2s_any(
a_net_group_idxs;
nothing_bool= false)
Returns "indices to ordinal" dictionaries of indices of any type of nodes in a network.
ePowerSim.get_namedtuple_dict_types_dyn_or_output_func
— Methodget_namedtuple_dict_types_dyn_or_output_func(
ode_types_func,
dae_types_func;
ode_type = :ode,
dae_type = :dae )
Return a namedtuple of dictionaries for ode and dae functions.
ePowerSim.get_namedtuple_of_findnz
— Methodget_namedtuple_of_findnz(
Ybus)
Returns a namedtuple of rows indices, columns indices and non-zero values of a sparse matrix.
ePowerSim.get_nested_nt_from_nt_wt_dict
— Methodget_nested_nt_from_nt_wt_dict(
a_nested_nt )
Converts a dict in a namedtuple to a namedtuple.
Example
tt = (plant_type = "plant_cb_v6",
components_type = Dict{Symbol, Any}(
:gen => "SM_2axis_cb_v6",
:avr => "avr_t1_cb_sauer",
:gov => "gov_t1_cb_sauer"),
idx = 1)
get_a_plant_data_json_to_nt(
json_a_plant;
in_components_type_sym = true)
get_nested_nt_from_nt_wt_dict( tt )
ePowerSim.get_net_data_by_components_from_json_file
— Methodget_net_data_by_components_from_json_file(
net_data_by_components_file;
in_components_type_sym = false )
Returns namedtuples of dynamic network data plant_generators_data_from_json
, plant_loads_data_from_json
, plant_transmission_data_from_json
, edge_data_from_json
, shunt_data_from_json
, baseMVA_data_from_json
, gencost_data_from_json
.
Arguments
net_data_by_components_file::String
: the path to network json file.in_components_type_sym::Bool=false
: the variable that determines how plants data are stored in json network file.
ePowerSim.get_net_nodes_type_idxs_by_json
— Methodget_net_nodes_type_idxs_by_json(
plant_generators_data_from_json,
plant_loads_data_from_json,
plant_transmission_data_from_json )
Returns list of indices of various type of nodes in a network.
These are:
`slackbusidx, gensidx, slackgensnodesidx, nonslackgensnodesidx, gensnodesidx,
genswithlocloadidx, gensnodeswithlocloads_idx,
locloadexist, loadnodesidx, transmissionnodesidx, nongensnodesidx, allnodesidx, nonslackgensandnongensidx, nodeswithdemandsidx`
ePowerSim.get_net_nodes_type_idxs_by_mpc
— Methodget_net_nodes_type_idxs_by_mpc( mpc_bus )
Returns list of indices of various type of nodes in a network.
ePowerSim.get_net_static_data_by_components_by_xlsx
— Methodget_net_static_data_by_components_by_xlsx(
; case_name
data_dir,
by_components )
Returns selected static parameters and dynamic types of components from network model xlsx file.
ePowerSim.get_network_vars_labels
— Methodget_network_vars_labels(
gens_govs_avrs_states_syms,
dyn_pf_fun_kwd_net_idxs;
label_prefix = "bus",
plants_states_by_per_comp = false,
plants_states_by_per_plant = true )
Return a system network states and algebraic variables label in a flatted.
Arguments
gens_govs_avrs_states_syms
: the namedtuple of states variables symbols of generator, governors and automatic voltage regulator.dyn_pf_fun_kwd_net_idxs
: the namedtuple of node's type indices.label_prefix::String="bus"
: the label that should be used as a prefix.
ePowerSim.get_node_dst_edges
— Methodget_node_dst_edges((node_number::Int64, Cnb)
Returns a node destination edges, they are edges whose the node is a destination node.
ePowerSim.get_node_src_edges
— Methodget_node_src_edges(node_number::Int64, Cnb)
Returns a node source edges, they are edges whose the node is a source node.
ePowerSim.get_nodes_Yshunt_by_generic
— Methodget_nodes_Yshunt_by_generic(
buses_Gs,
buses_Bs;
baseMVA = 1.0 )
Returns a list of per unit nodes shunt admittance.
ePowerSim.get_nodes_dict_static_data_by_mpc
— Methodget_nodes_dict_static_data_by_mpc(
mpc_bus,
mpc_gen;
mpc_baseMVA = 1.0 )
Returns an OrderedDict of static data indexed by generators indices.
ePowerSim.get_nodes_idx_and_Yshunt_by_generic
— Methodget_nodes_idx_and_Yshunt_by_generic(
buses_idx,
buses_Gs,
buses_Bs;
baseMVA = 1.0 )
Returns a list of tuples of nodes indices and nodes shunt admittances.
ePowerSim.get_nodes_idx_and_Yshunt_non_zero
— Methodget_nodes_idx_and_Yshunt_non_zero(
buses_Gs,
buses_Bs;
baseMVA = 1.0 )
Returns namedtuples y_sh_shunt_exist
, nz_y_sh_idxs
, nz_y_sh
for nodes non-zero shunt admittances.
ePowerSim.get_nodes_incident_edges_by_orientations
— Methodget_nodes_incident_edges_by_orientations(
edges_orientations )
Returns nodes incident edges.
ePowerSim.get_nodes_incident_edges_to_or_fro
— Methodget_nodes_incident_edges_to_or_fro(
to_or_fro_edges_current )
Returns sum of injection currents at a node by its source or destination edges.
ePowerSim.get_nodes_state_algb_vars_indices_in_system
— Methodget_nodes_state_algb_vars_indices_in_system(
; network_vars_labels =
network_vars_labels,
nodes_name = ["bus1", "bus2"],
vars = [:ω, :δ])
Returns indices of state_algebraic variables of specified nodes in the systems.
It is meant to extract the indices in sol.
ePowerSim.get_nodes_static_tup_data_by_mpc
— Methodget_nodes_static_tup_data_by_mpc(
mpc_bus,
mpc_gen;
mpc_baseMVA = 1.0 )
Returns tuples of static data indexed by generating and non-generating plants indices.
ePowerSim.get_non_gen_node_tup_idx_PQ_data_by_mpc
— Methodget_non_gen_node_tup_idx_PQ_data_by_mpc(
idx, Pd, Qd;
mpc_baseMVA = 1.0)
Returns a tuple of (idx, Bus, P, Q)
for non-generation node.
ePowerSim.get_non_gen_plants_PQ_and_idx_by_json
— MethodThis function returns a vector of properties of non generator nodes, selected by the variable selection
.
ePowerSim.get_non_null_list
— Methodget_non_null_list(list_of_lists)
return [ a_list for a_list in
list_of_lists
if a_list != []]
Returns non empty lists.
ll_1 = [[9,2], [4,5,7,3], [3,6,8,4]]
getnonnulllist(ll1)
ll_2 = [[9,2], [], [3,6,8,4]]
getnonnulllist(ll2)
ePowerSim.get_non_null_list_and_Idx
— Methodget_non_null_list_and_Idx(
list_of_lists)
Returns non empty lists and their indices.
ll_1 = [[9,2], [4,5,7,3], [3,6,8,4]]
getnonnulllistandIdx(ll1)
ll_2 = [[9,2], [], [3,6,8,4]]
getnonnulllistandIdx(ll2)
ePowerSim.get_nt_additional_data
— Methodget_nt_additional_data(
additional_data)
Returns additional data as namedtuple.
ePowerSim.get_nt_components_data
— Methodget_nt_components_data(
components_data)
Returns namedtuples of components names and parameters or data.
ePowerSim.get_nt_components_type
— Methodget_nt_components_type(
components_type)
Returns namedtuple of components property names and symbols for a component type.
ePowerSim.get_nt_vec_wt_vec_vec_per_paras
— Methodget_nt_vec_wt_vec_vec_per_paras(
vec_vec_per_node;
nt_syms = (:nothing, ),
vec_datatype = Float64 )
Convert vec_namedtuple
to nt_vector, vector of namedtuples to namedtuples of vector per parameters.
ePowerSim.get_ntuple_status_steady_state_data
— Methodget_ntuple_status_steady_state_data(
;<keyword arguments>)
Returns namedtuples of data for network status in list_network_status
. The network status in the list are :pre_fault_state
, :fault_state
, :post_fault_state
.
Arguments
net_data_by_components_file
: the network data filecomponents_libs_dir
: the components library folderbasekV
: the base voltageuse_pu_in_PQ
: the boolean variable that determines if PQ should be in pu.line_data_in_pu
: the boolean variable that informs if line data are in pu,
pf_alg
: power flow solver abstol
: the absolute error tolerance reltol
: the relative error tolerance on_fault_time
: the on fault time clear_fault_time
: the clear fault time list_fault_point_from_node_a::Vector{Float64}=[0.3]
: the list containing a ratio of the fault point from the source (from) orientation of lines list_fault_resistance::Vector{Float64} = [0.001]
: the list containing fault resistances of each fault in the network. list_no_line_circuit::Vector{Float64} = [4]
: the list containing the number of circuits per faulted lines list_edges_to_have_fault::Vector{Int64} = [2]
: the list containing indices of lines that should have a fault. clear_fault_selection_list::Vector{Int64} = [1]
: the list containing indices of faulted lines to be cleared in list_edges_to_have_fault
. with_faults::Bool=false
: a legacy boolean variable. timespan
: the simulation time. list_network_status
: the list of network status.
ePowerSim.get_ode_flat_para_Idxs_in_Idxs
— Methodget_ode_flat_para_Idxs_in_Idxs(
gens_vh_θh,
gens_nodes_ωs_ωref0_vref0_porder0,
gens_dynamic_id_iq_pg_vh )
Returns namedtuples of gens_nodes_vh_θh_idx_in_Idx
, gens_nodes_ωs_ωref0_vref0_porder0_idx_in_Idx
, gens_nodes_id_iq_pg_vh_idx_in_Idx
.
ePowerSim.get_ode_gens_generic_para
— Method get_ode_gens_generic_para(
plant_generators_data_from_json;
sequence_order =
gens_generic_sequence_order,
selections =
ode_gens_generic_selections)
Returns a namedtuple of selected parameters of devices from plant_generators_data_from_json
.
Arguments
sequence_order::Tuple{Symbol}
: the selection order of components data.selections::Tuple{Symbol}
: the tuple of parameters data to be selected.
It is used in get_ode_gens_generic_para, get_generic_gens_avr_gov_para
ePowerSim.get_only_adjacent_nodes_idx
— Methodget_only_adjacent_nodes_idx(
nodes_idx_with_adjacent_nodes_idx)
Returns only adjacent nodes indicies from nodesidxwithadjacentnodes_idx.
It does not consider the first entry in each row of nodesidxwithadjacentnodes_idx.
ePowerSim.get_opf_net_optimisation_parameters
— Methodget_opf_net_optimisation_parameters(
case_file )
Returns network optimisation parameters for optimal power flow, unit commitment or economic dispatch
ePowerSim.get_opf_streamedlined_simulation_parameters
— Methodget_opf_streamedlined_simulation_parameters(
net_data_by_components_file;
<keyword arguments>)
It is used to simplify generation of parameters or data of a system that are needed for optimal power flow analyses.
Arguments
net_data_by_components_file
: the network data filecomponents_libs_dir
: the components library folderbasekV
: the base voltageuse_pu_in_PQ
: the boolean variable that determines if PQ should be in pu.line_data_in_pu
: the boolean variable that informs if line data are in pu,
use_init_u0
: the boolean variable that determines if initial state u0 should be used in a power flow. use_nlsolve
: the boolean variable that determines if nlsolve
should be used in power flow.
pf_alg
: power flow solver
ePowerSim.get_participation_factors
— Methodget_participation_factors(
system_matrix )
Returns the participation factor matrix.
ePowerSim.get_per_node_flat_idxs
— Methodget_per_node_flat_idxs(
list_vars_or_paras )
Returns for a vector of vectors list_vars_or_paras
a per sub vector indices as per_node_vars_or_paras_Idx
.
ePowerSim.get_per_node_flat_para_and_idxs
— Methodget_per_node_flat_para_and_idxs(
list_vars_or_paras )
Returns for a vector of vectors list_vars_or_paras
a flattened vector, per sub vector indices as flattend_per_node_vars_or_paras
, and per_node_vars_or_paras_Idx
respectively.
ePowerSim.get_per_node_para_to_per_vars_or_paras
— Methodget_per_node_para_to_per_vars_or_paras(
list_per_node_vars_or_paras,
dims_vars_or_paras_types )
Converts vars or paras given in per node format to per vars or paras format.
The dimension of each of the per vars or paras should be supplied in a list dims_vars_or_paras_types
ePowerSim.get_per_node_per_vars_or_paras_flat_idxs
— Methodget_per_node_per_vars_or_paras_flat_idxs(
list_vars_or_paras )
Returns for a vector of vectors list_vars_or_paras
per sub vector indices and sub vector indices in the flattened vector as per_node_per_vars_or_paras_Idxs
and per_node_vars_or_paras_Idx
respectively.
ePowerSim.get_per_node_per_vars_or_paras_flat_para_and_idxs
— Methodget_per_node_per_vars_or_paras_flat_para_and_idxs(
list_vars_or_paras )
Returns for a vector of vectors list_vars_or_paras
a flattened vector, per sub vector indices and sub vector indices in the flattened vector as flattend_per_node_vars_or_paras
, per_node_vars_or_paras_Idx
, per_node_per_vars_or_paras_Idxs
respectively.
ePowerSim.get_per_vars_or_paras_flat_idxs
— Methodget_per_vars_or_paras_flat_idxs(
list_vars_or_paras )
Returns indices per parameter or variable per_vars_or_paras_Idx
for a flattened vector of vectors.
ePowerSim.get_per_vars_or_paras_flat_para_and_idxs
— Methodget_per_vars_or_paras_flat_para_and_idxs(
list_vars_or_paras )
Returns for a vector of vectors a flattened vector and and per sub vector indices as flattend_per_vars_or_paras
, and per_vars_or_paras_Idx
respectively.
ePowerSim.get_per_vars_or_paras_per_node_flat_idxs
— Methodget_per_vars_or_paras_per_node_flat_idxs(
list_vars_or_paras )
Returns namedtuple per_vars_or_paras_Idx
, and per_vars_or_paras_per_node_Idx
ePowerSim.get_per_vars_or_paras_per_node_flat_para_and_idxs
— Methodget_per_vars_or_paras_per_node_flat_para_and_idxs(
list_vars_or_paras )
Returns namedtuples of flattend_per_vars_or_paras
, per_vars_or_paras_Idx
, and per_vars_or_paras_per_node_Idx
.
ePowerSim.get_per_vars_or_paras_to_per_node
— Methodget_per_vars_or_paras_to_per_node(
list_vars_or_paras)
Converts vars or paras given in per vars or paras format to per node format.
ePowerSim.get_pf_dyn_idq
— Methodget_pf_dyn_idq(
vh, θh,
δ_ω_ed_eq,
ra_Xd_dash_Xq_dash )
Returns a generator direct current id
and quadrature current iq
in network reference frame.
ePowerSim.get_pf_dyn_idq
— Methodget_pf_dyn_idq(
vh, θh, δ, ω,
ed_dash, eq_dash,
ra, X_d_dash, X_q_dash )
Returns a generator direct current id
and quadrature current iq
in network reference frame.
ePowerSim.get_pf_dyn_idq
— Methodget_pf_dyn_idq(
vh_θh,
δ_ω_ed_eq,
ra_X_d_dash_X_q_dash )
Returns a generator direct current id
and quadrature current iq
in network reference frame.
ePowerSim.get_pf_dyn_idq_net
— Methodget_pf_dyn_idq_net( id, iq, δ )
Returns a generator direct current id
and quadrature current iq
in network reference frame.
ePowerSim.get_pf_dyn_idq_net
— Methodget_pf_dyn_idq_net( idq, δ )
Returns a generator direct current id
and quadrature current iq
in network reference frame.
ePowerSim.get_pf_dyn_idq_θ_π_vhθh
— Methodget_pf_dyn_idq_θ_π_vhθh(
vh, θh,
δ_ω_ed_eq,
ra_Xd_dash_Xq_dash )
Returns a generator direct current id
and quadrature current iq
.
ePowerSim.get_pf_dyn_idq_θ_π_vhθh
— Methodget_pf_dyn_idq_θ_π_vhθh(
vh, θh,
δ, ω, ed_dash, eq_dash,
ra, X_d_dash, X_q_dash )
Returns a generator direct current id
and quadrature current iq
.
ePowerSim.get_pf_dyn_idq_θ_π_vhθh
— Methodget_pf_dyn_idq_θ_π_vhθh(
vh_θh,
δ_ω_ed_eq,
ra_X_d_dash_X_q_dash )
Returns a generator direct current id
and quadrature current iq
.
ePowerSim.get_pf_dynamic_idq_θ_π_vhθh
— Methodget_pf_dynamic_idq_θ_π_vhθh(
vh, θh, δ_ω_ed_eq, ra_Xd_dash_Xq_dash )
Returns a generator direct current id
and quadrature current iq
.
ePowerSim.get_pf_dynamic_idq_θ_π_vhθh
— Methodget_pf_dynamic_idq_θ_π_vhθh(
vh, θh,
δ, ω, ed_dash, eq_dash,
ra, X_d_dash, X_q_dash )
Returns a generator direct current id
and quadrature current iq
.
ePowerSim.get_pf_dynamic_idq_θ_π_vhθh
— Methodget_pf_dynamic_idq_θ_π_vhθh(
vh_θh, δ_ω_ed_eq, ra_X_d_dash_X_q_dash )
Returns a generator direct current id
and quadrature current iq
.
ePowerSim.get_pf_streamedlined_simulation_parameters
— Methodget_pf_streamedlined_simulation_parameters(
net_data_by_components_file;
<keyword arguments>)
It is used to simplify generation of parameters or data of a system that are needed for power flow analyses.
Arguments
net_data_by_components_file
: the network data filecomponents_libs_dir
: the components library folderbasekV
: the base voltageuse_pu_in_PQ
: the boolean variable that determines if PQ should be in pu.line_data_in_pu
: the boolean variable that informs if line data are in pu,
use_init_u0
: the boolean variable that determines if initial state u0 should be used in a power flow. use_nlsolve
: the boolean variable that determines if nlsolve
should be used in power flow.
pf_alg
: power flow solver
ePowerSim.get_pf_transformed_idxs
— Methodget_pf_transformed_idxs(
;slack_gens_nodes_idx,
non_slack_gens_nodes_idx,
gens_nodes_idx,
non_gens_nodes_idx,
gens_with_loc_load_idx,
all_nodes_idx,
n2s_slack_gens_idx,
n2s_non_slack_gens_idx,
n2s_gens_idx,
n2s_non_gens_idx,
n2s_gens_with_loc_load_idxs,
n2s_all_nodes_idx )
Returns transformed indices of nodes types.
ePowerSim.get_pf_vh_θh_idx_and_idx2Idx
— Methodget_pf_vh_θh_idx_and_idx2Idx(
dyn_pf_fun_kwd_net_idxs,
dyn_pf_fun_kwd_n2s_idxs)
Returns indices of vh
, θh
, and indices transformation dictionaries.
Arguments
dyn_pf_fun_kwd_net_idxs
: the namedtuple of node's type indices.dyn_pf_fun_kwd_n2s_idxs
: the namedtuple of node's type indices translation dictionaries.
ePowerSim.get_plants_states_syms
— Methodget_plants_states_syms(
gens_govs_avrs_states_syms)
Return plants states variables symbols per plant for all generator plants in a vector of vectors.
A generator plant consist of a generator, automatic voltage regulator, governor etc.
ePowerSim.get_plants_states_syms_and_labels
— Methodget_plants_states_syms_and_labels(
gens_govs_avrs_states_syms,
dyn_pf_fun_kwd_net_idxs,
dyn_pf_fun_kwd_n2s_idxs)
Return a system namedtuple of state_vars_idx
, vec_comp_states_Idx
, plants_states_syms
, generic_state_sym
, state_labels
, algebraic_vars_labels
, and network_vars_labels
.
Arguments
gens_govs_avrs_states_syms
: the namedtuple of states variables symbols of generator, governors and automatic voltage regulator.dyn_pf_fun_kwd_net_idxs
: the namedtuple of node's type indices.dyn_pf_fun_kwd_n2s_idxs
: the namedtuple of node's type indices translation dictionaries.
ePowerSim.get_plants_states_syms_wt_labels_wt_names
— Methodget_plants_states_syms_wt_labels_wt_names(
gens_govs_avrs_states_syms,
dyn_pf_fun_kwd_net_idxs,
dyn_pf_fun_kwd_n2s_idxs)
Return a system namedtuple of state_vars_idx
, vec_comp_states_Idx
, plants_states_syms
, generic_state_sym
, state_labels
, algebraic_vars_labels
, network_vars_labels
, model_syms
, nodes_names
, gens_nodes_names
, non_gens_nodes_names
, SM_gens_nodes_names
, and SC_gens_nodes_names
.
Arguments
gens_govs_avrs_states_syms
: the namedtuple of states variables symbols of generator, governors and automatic voltage regulator.dyn_pf_fun_kwd_net_idxs
: the namedtuple of node's type indices.dyn_pf_fun_kwd_n2s_idxs
: the namedtuple of node's type indices translation dictionaries.
ePowerSim.get_renewable_energy_net_optimisation_parameters
— Methodget_renewable_energy_net_optimisation_parameters(
case_file,
wind_gens_cost_scale,
solar_gens_cost_scale,
wind_gens_capacity_scale,
solar_gens_capacity_scale,
active_power_demand_deviation_scale,
reactive_power_demand_deviation_scale)
Return renewable energy network optimisation parameters for optimal power flow, unit commitment or economic dispatch
ePowerSim.get_scaling_red_continuation_distributed_slack_pf_ΔPQ_mismatch!
— MethodWorked for powerflow but did not work for continuation powerflow.
ePowerSim.get_selected_avrs_ode_para_by_json
— Methodget_selected_avrs_ode_para_by_json
is more generic compared to
get_avrs_ode_para_by_json_generic
, get_avrs_ode_para_by_json
ePowerSim.get_selected_comp_properties_by_lens
— Methodget_selected_comp_properties_by_lens
This is an utility function that return a subset of properties determined by selections
as a vector of namedtuple.
It first assets that the selection is a subset of properties of lensed_comp_data
.
lensed_comp_data
is the result of application of lensfunc to compdata.
ePowerSim.get_selected_comps_ode_para_by_json
— Methodget_selected_comps_ode_para_by_json
can be used for any component for a plant.
It is more generic compared to:
get_gens_ra_and_reactances_by_json
,
get_gens_ode_para_by_json
,
get_avrs_ode_para_by_json_generic
,
get_avrs_ode_para_by_json
,
get_selected_avrs_ode_para_by_json
, and
get_govs_ode_para_by_json
ePowerSim.get_selected_comps_properties_by_lens
— Methodget_selected_comps_properties_by_lens
This is an utility function that return a subset of properties determined by selections
as a vector of namedtuple.
selectedgensparas = getselectedcompspropertiesbylens( getgendynparasinnet, plantgenerators; selections = genstaticparaselections )
selectedgensparas = [ (P = 72.3, Q = 27.03, vh = 1.04, vmax = 1.1, vmin = 0.9, Qmax = 300, Qmin = -300, Pmax = 250, Pmin = 10, Sn = 390.51248379533274), (P = 72.3, Q = 27.03, vh = 1.04, vmax = 1.1, vmin = 0.9, Qmax = 300, Qmin = -300, Pmax = 250, Pmin = 10, Sn = 390.51248379533274), (P = 72.3, Q = 27.03, vh = 1.04, vmax = 1.1, vmin = 0.9, Qmax = 300, Qmin = -300, Pmax = 250, Pmin = 10, Sn = 390.51248379533274)]
It is like using a map on
get_selected_comp_properties_by_lens
selectedgensparas = getselectedcomppropertiesbylens.( getgendynparasinnet, plantgenerators; selections = genstaticparaselections )
selectedgensparas = map((y) -> getselectedcomppropertiesbylens( getgendynparasinnet, y; selections = genstaticparaselections), plantgenerators )
ePowerSim.get_selected_edges_data_by_json
— Methodget_selected_edges_data_by_json(
edge_data_from_json;
sequence_order =
(:components_data, ) ,
selections =
(:r, :x, :b, :ratio,
:angle) )
Returns a vector of properties of edges selected by the variables sequence_order
and selection
.
ePowerSim.get_selected_vec_nt_as_nt_vec_by_lens
— Methodget_selected_comp_as_nt_vec_by_lens
This is an utility function that return a subset of properties determined by selections
as a namedtuple of vectors.
It first assets that the selection is a subset of properties of lensed_comp_data
.
lensed_comp_data
is the result of application of lensfunc to compdata.
getselectedcompasntvecby_lens(
getgendynparasin_net,
plant_generators;
selections =
genstaticpara_selections,
vec_datatype = Float64 )
selectedcompasntvec = (P = [72.3, 72.3, 72.3], Q = [27.03, 27.03, 27.03], vh = [1.04, 1.04, 1.04], vmax = [1.1, 1.1, 1.1], vmin = [0.9, 0.9, 0.9], Qmax = [300.0, 300.0, 300.0], Qmin = [-300.0, -300.0, -300.0], Pmax = [250.0, 250.0, 250.0], Pmin = [10.0, 10.0, 10.0], Sn = [390.512, 390.512, 390.512])
ePowerSim.get_selected_vec_nt_to_vec_vec
— Methodget_selected_vec_nt_to_vec_vec(
vec_namedtuple,
nothing;
selections = (:nothing, ),
vec_datatype = Float64 )
Convert vec_namedtuple
to nt_vector, vector of namedtuples to namedtuples of vector.
ePowerSim.get_selected_vec_nt_to_vec_vec
— Methodget_selected_vec_nt_to_vec_vec(
vec_namedtuple;
selections = (:nothing, ) )
Convert vec_namedtuple
to nt_vector, vector of namedtuples to namedtuples of vector.
ePowerSim.get_sense_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_edges_data
— Methodget_sense_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_edges_data(
;edges_fbus, edges_tbus,
edges_type,
edges_r, edges_x, edges_b,
edges_ratio, edges_angle,
Gs, Bs,
all_nodes_idx,
n2s_all_nodes_idx,
baseMVA=1.0,
basekV=1.0,
line_data_in_pu = true)
Returns a namedtuple of network admitance vectors and network nodes neigbouhood vectors.
ePowerSim.get_sense_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_generic
— Methodget_sense_Ynet_wt_nodes_idx_wt_adjacent_nodes_by_generic(
branches_fbus,
branches_tbus,
r,
x,
b,
ratio,
angle,
Gs,
Bs;
edges_type,
all_nodes_idx,
n2s_all_nodes_idx,
baseMVA = 1.0,
basekV = 1.0,
baseShunt = 1.0 )
Returns a namedtuple of network admitance vectors and network nodes neigbouhood vectors.
ePowerSim.get_shunt_data_by_mpc
— Methodget_shunt_data_by_mpc(
mpc_bus;
mpc_baseMVA =
1.0)
Returns a dict Dict{:shunt_idx,:shunt_Gs,:shunt_Bs }
for network lines shunt parameters.
ePowerSim.get_similar_collection_diff
— Methodget_similar_collection_diff(
collection_1, collection_2)
Returns the difference between two list, tuple, collections.
ePowerSim.get_size_Ybus
— Methodget_size_Ybus(
Ybus)
Returns the memory size of Ybus
.
ePowerSim.get_size_Ynet_wt_nodes_idx_wt_adjacent_nodes
— Methodget_size_Ynet_wt_nodes_idx_wt_adjacent_nodes(
Ynet_wt_nodes_idx_wt_adjacent_nodes)
Returns the memory size of Ynet_wt_nodes_idx_wt_adjacent_nodes
.
ePowerSim.get_size_Yπ_net_Yshunt_wt_nodes_idx_wt_adjacent_nodes
— Methodget_size_Yπ_net_Yshunt_wt_nodes_idx_wt_adjacent_nodes(
Yπ_net_Yshunt_wt_nodes_idx_wt_adjacent_nodes)
Returns the memory size of Yπ_net_Yshunt_wt_nodes_idx_wt_adjacent_nodes
.
ePowerSim.get_slack_gens_vh_θh_gens_vh_non_slack_gens_vh
— Methodget_slack_gens_vh_θh_gens_vh_non_slack_gens_vh(
vh,
θh,
dyn_pf_fun_kwd_net_idxs,
dyn_pf_fun_kwd_n2s_idxs)
Returns slack_gens_vh
, slack_gens_θh
, gens_vh
, and non_slack_gens_vh
.
Arguments
vh
: the network nodes voltage magnitudes.θh
: the network nodes voltage angles.dyn_pf_fun_kwd_net_idxs
: the namedtuple of node's type indices.dyn_pf_fun_kwd_n2s_idxs
: the namedtuple of node's type indices translation dictionaries.
ePowerSim.get_state_algebraic_vars_Idx_in_state
— Methodget_state_algebraic_vars_Idx_in_state(
generic_state_labels,
gens_nodes_idx,
all_nodes_idx)
Returns state variables, and algebraic variables indices in the state.
Arguments
generic_state_labels
: the states variables labels.
ePowerSim.get_state_algebraic_vars_wt_fault_Idx_in_state
— Methodget_state_algebraic_vars_wt_fault_Idx_in_state(
generic_state_labels,
gens_nodes_idx,
all_nodes_idx;
no_lines_fault = 1)
Returns state variables, and algebraic variables with fault nodes algebraic variables indices in the state.
Arguments
generic_state_labels
: the states variables labels.
ePowerSim.get_state_and_algebraic_vars_Idx_in_state
— Methodget_state_and_algebraic_vars_Idx_in_state(
state_labels,
dyn_pf_fun_kwd_net_idxs,
dyn_pf_fun_kwd_n2s_idxs;
no_lines_fault = 1 )
Return indices of state and algebraic variables for a normal system and faulted system states in a flattened vector.
state_vars_and_i_dq_Idx_in_state
, state_vars_and_i_dq_wt_fault_Idx_in_state
, state_algebraic_vars_Idx_in_state
, and state_algebraic_vars_wt_fault_Idx_in_state
.
Arguments
state_labels
: the system state variables labels.dyn_pf_fun_kwd_net_idxs
: the namedtuple of node's type indicesdyn_pf_fun_kwd_n2s_idxs
: the namedtuple of node's type indices translation dictionaries.no_lines_fault::Int64 = 1
: the number of lines faults.
ePowerSim.get_state_labels
— Methodget_state_labels(
gens_govs_avrs_states_syms,
gens_nodes_idx;
label_prefix = "bus",
plants_states_by_per_comp = false,
plants_states_by_per_plant = true )
Return plants states variables symbols or lables for all generator plants in a flattened vector.
A generator plant consist of a generator, automatic voltage regulator, governor etc.
ePowerSim.get_state_vars_and_i_dq_Idx_in_state
— Methodget_state_vars_and_i_dq_Idx_in_state(
generic_state_labels,
gens_nodes_idx,
all_nodes_idx )
Returns state variables, nodes voltage magnitudes, nodes voltage angles, generators direct axix current id, and generators quadrature axis current indices in the state.
Arguments
network_vars_labels
: the system variables labels.dyn_pf_fun_kwd_net_idxs
: the namedtuple of node's type indices.selected_gens_state_vars_syms::Tuple{Symbol}=(:δ, :ed_dash, :eq_dash)
:
ePowerSim.get_state_vars_and_i_dq_wt_fault_Idx_in_state
— Methodget_state_vars_and_i_dq_wt_fault_Idx_in_state(
generic_state_labels,
gens_nodes_idx,
all_nodes_idx;
no_lines_fault = 1)
Returns state variables, nodes voltage magnitudes, nodes voltage angles, generators direct axix current id, and generators quadrature axis current, fault node voltage magnitudes, fault node voltage angles, indices in the state.
Arguments
generic_state_labels
: the states variables labels.
ePowerSim.get_state_vars_idx
— Methodget_state_vars_idx(
gens_govs_avrs_states_syms)
Return indices of states variables in the system in a flatted.
Arguments
gens_govs_avrs_states_syms
: the namedtuple of states variables symbols of generator, governors and automatic voltage regulator.
ePowerSim.get_states_Idx_syms_wt_functions
— Methodget_states_Idx_syms_wt_functions(
net_data_by_components_file,
dyn_pf_fun_kwd_net_idxs,
dyn_pf_fun_kwd_n2s_idxs;
components_libs_dir =
nothing,
no_lines_fault = 1 )
Returns dynamic functions of components, states variables indices, algebraic variables indices, states variables labels, algebraic variables labels and most parameters indices.
Arguments
net_data_by_components_file
: the network data file.dyn_pf_fun_kwd_net_idxs
: the namedtuple of node's type indices.dyn_pf_fun_kwd_n2s_idxs
: the namedtuple of node's type indices translation dictionaries.components_libs_dir
: the components library folder.
ePowerSim.get_states_idx_by_nodes_idx_wt_vars_syms
— Methodget_states_idx_by_nodes_idx_wt_vars_syms(
vec_nodes_states_vars_syms )
Returns indices of state variables provided in vec_nodes_states_vars_syms
in in the network.
ePowerSim.get_static_Idx_and_syms
— Methodget_static_Idx_and_syms(
dyn_pf_fun_kwd_net_idxs,
dyn_pf_fun_kwd_n2s_idxs;
no_lines_fault = 1)
Returns states variables indices, algebraic variables indices, states variables labels, algebraic variables labels and most parameters indices.
Arguments
dyn_pf_fun_kwd_net_idxs
: the namedtuple of node's type indices.dyn_pf_fun_kwd_n2s_idxs
: the namedtuple of node's type indices translation dictionaries.
ePowerSim.get_static_load_nodes_json_data_storage_format
— Methodget_static_load_nodes_json_data_storage_format(
load_nodes_static_tup_data,
load_nodes_idx_wt_type_tup;
plant_type = "plant_PQ_Const_I")
Returns namedtuples of static load nodes data
ePowerSim.get_static_loc_loads_json_data_storage_format
— Methodget_static_loc_loads_json_data_storage_format(
loc_loads_idx_and_locP_locQ_data;
type_loc_load = "loc_Load_t1")
Returns OrderedDict of namedtuples for generators local loads indexed by generators indices.
ePowerSim.get_static_transmission_nodes_json_data_storage_format
— Methodget_static_transmission_nodes_json_data_storage_format(
transmission_nodes_static_tup_data,
load_nodes_idx_wt_type_tup;
plant_type = "plant_Transmission_t2")
Returns namedtuples of static transmission nodes data.
ePowerSim.get_status_steady_state_parameters
— Methodget_status_steady_state_parameters(
net_data_by_components_file;
<keyword arguments>)
It is used to simplify generation of parameters or data of a system that are needed for simulation.
Arguments
components_libs_dir
: the components library folderbasekV
: the base voltageuse_pu_in_PQ
: the boolean variable that determines if PQ should be in pu.line_data_in_pu
: the boolean variable that informs if line data are in pu,
use_init_u0
: the boolean variable that determines if initial state u0 should be used in a power flow. use_nlsolve
: the boolean variable that determines if nlsolve
should be used in power flow.
pf_alg
: power flow solver
abstol
: the absolute error tolerance reltol
: the relative error tolerance
on_fault_time
: the on fault time clear_fault_time
: the clear fault time
list_fault_point_from_node_a::Vector{Float64}=[0.3]
: the list containing a ratio of the fault point from the source (from) orientation of lines list_fault_resistance::Vector{Float64} = [0.001]
: the list containing fault resistances of each fault in the network. list_no_line_circuit::Vector{Float64} = [4]
: the list containing the number of circuits per faulted lines.
list_edges_to_have_fault::Vector{Int64} = [2]
: the list containing indices of lines that should have a fault. clear_fault_selection_list::Vector{Int64} = [1]
: the list containing indices of faulted lines to be cleared in list_edges_to_have_fault
.
with_faults::Bool=false
: a legacy boolean variable.
ePowerSim.get_sub_components_libs_dir
— Methodget_sub_components_libs_dir(
components_libs_dir,
sub_components_strings )
Returns folders where sub-componets are stored.
ePowerSim.get_sub_components_libs_files
— Methodget_sub_components_libs_files(
components_libs_dir,
components_files_string;
ext = "json" )
Returns folders where sub-componets are stored.
ePowerSim.get_subsubtype
— Methodget_subsubtype(AbstractPowerSystemComponent)
It returns the subtypes of subtypes of abstract types of AbstractPowerSystemComponent
. These are the subtypes of SdGen
, SdNonGen
, SdGov
, SdAvr
, SdPss
, SdNonGenPlant
, SdGenPlant
and SdBranchElement
. It is used to get list_components_types
which is a list of components defined in this package.
ePowerSim.get_system_net_data_wt_static_parameters
— Methodget_system_net_data_wt_static_parameters(
case_name;
<keyword arguments>)
It is used to simplify static model parameters or data of a system that are needed for static analyses.
Arguments
-case_name
: the case name
script_dir::String=""
: working folderdata_dir::String=""
: data folder where all cases are storedjson_net_data_by_components_file
: the network data filecomponents_libs_dir
: the components library folderbasekV
: the base voltageuse_pu_in_PQ
: the boolean variable that determines if PQ should be in pu.line_data_in_pu
: the boolean variable that informs if line data are in pu,
pf_alg
: power flow solver
ePowerSim.get_system_net_static_data
— Methodget_system_net_static_data(
case_name;
<keyword arguments>)
It is used to simplify static model parameters or data of a system that are needed for static analyses.
Arguments
-case_name
: the case name
script_dir::String=""
: working folderdata_dir::String=""
: data folder where all cases are storedjson_net_data_by_components_file
: the network data filecomponents_libs_dir
: the components library folderbasekV
: the base voltageuse_pu_in_PQ
: the boolean variable that determines if PQ should be in pu.line_data_in_pu
: the boolean variable that informs if line data are in pu,
use_init_u0
: the boolean variable that determines if initial state u0 should be used in a power flow. use_nlsolve
: the boolean variable that determines if nlsolve
should be used in power flow.
pf_alg
: power flow solver no_lines_fault
: the number of faults
ePowerSim.get_system_simulation_parameters
— Methodget_system_simulation_parameters(
net_data_by_components_file,
nothing;
<keyword arguments>)
It is used to simplify generation of parameters or data of a system that are needed for simulation.
Arguments
net_data_by_components_file
: the network data filecomponents_libs_dir
: the components library folderbasekV
: the base voltageuse_pu_in_PQ
: the boolean variable that determines if PQ should be in pu.line_data_in_pu
: the boolean variable that informs if line data are in pu,
use_init_u0
: the boolean variable that determines if initial state u0 should be used in a power flow. use_nlsolve
: the boolean variable that determines if nlsolve
should be used in power flow.
pf_alg
: power flow solver
abstol
: the absolute error tolerance reltol
: the relative error tolerance
ePowerSim.get_system_simulation_parameters
— Methodget_system_simulation_parameters(
net_data_by_components_file;
<keyword arguments>)
It is used to simplify generation of parameters or data of a system that are needed for simulation.
Arguments
net_data_by_components_file
: the network data filecomponents_libs_dir
: the components library folderbasekV
: the base voltageuse_pu_in_PQ
: the boolean variable that determines if PQ should be in pu.line_data_in_pu
: the boolean variable that informs if line data are in pu,
use_init_u0
: the boolean variable that determines if initial state u0 should be used in a power flow. use_nlsolve
: the boolean variable that determines if nlsolve
should be used in power flow.
pf_alg
: power flow solver
abstol
: the absolute error tolerance reltol
: the relative error tolerance
ePowerSim.get_transmission_nodes_static_tup_data_by_mpc
— Methodget_transmission_nodes_static_tup_data_by_mpc(
mpc_bus;
mpc_baseMVA = 1.0)
Returns tuple of transmission nodes indices and static data.
ePowerSim.get_ur_ui_Idx_in_state
— Methodget_ur_ui_Idx_in_state(
dims, comps_ur_ui_Idx; counter=0 )
Returns indices of ur, ui for a flattend system states.
The input are dims of components state and indices of ur and ui in each component state
Test:
\[\]
compsstatessyms = [[:ur,:ui], [:δ, :ω, :ur, :ui], [:δ,:ur,:ω,:ui]]
comps_states = [[9,2], [4,5,7,3], [3,6,8,4]]
compsflattenedstates = [comps_states...;]
dims = length.(comps_states)
compsuruiIdx = [[1,2], [3,4], [2,4]]
uruiIdxinstate = geturuiIdxinstate(dims, compsurui_Idx; counter=0 )
uruiinstate = [compsflattenedstates[inx] for inx in uruiIdxin_state ]
compsuview = [view(compsflattenedstates, uruiIdxinstate[Ind]) for Ind in collect(1:length( uruiIdxinstate ))]
ePowerSim.get_vars_idxs_in_range_Idxs
— Methodget_vars_idxs_in_range_Idxs(
vec_unit_range,
list_vars_syms )
Returns vectors of idxs as tuples
gensnodesidx = [1,2,3] gensstatevarssyms = [:δ, :ω, :eqdash, :E_fd]
gensstatesIdx = getidxsinflattenedbynodesidxwtvarssyms( gensstatevarssyms, gensnodesidx )
sum( length.( gensstatesIdx ) )
(δidxinstate, ωidxinstate, eqdashidxinstate, Efdidxinstate ) = getvarsidxsinrangeIdxs( gensstatesIdx, gensstatevarssyms )
ePowerSim.get_vars_or_paras_Idxs_in_flattend
— Methodget_vars_or_paras_Idxs_in_flattend(
vars_or_param_list_or_dims;
dims_given = true )
Returns indices of variables or parameters in a flattended vector.
ePowerSim.get_ωref0_vref0_porder0_id_iq_vh_Idx
— Methodget_ωref0_vref0_porder0_id_iq_vh_Idx(
gens_nodes_idx)
Returns indices of ωref0
, vref0
, porder0
, id
, iq
, vh
in a flattened vector ωref0_vref0_porder0_id_iq_vh
.
ePowerSim.idx_containing
— Methodidx_containing(
network_vars_labels,
expr;
syms = true)
Returns the list of indices of variables containing a given expr
in network variable labels.
ePowerSim.init_im_plants_system_matrices_views!
— MethodThis function initialises system matrices views Ax_view, Bx_view, Cx_view
which are in vectors vec_Ax_views, vec_Bx_views, vec_Cx_views
.
These views are created by create_gens_nodes_im_aggregate_system_matrices_Idx_and_views
.
The intialisation is expected to be reflected in aggregate system matrices Ax_matrix, Bx_matrix, Cx_matrix
ePowerSim.init_plants_system_matrices_views!
— MethodThis function initialises system matrices views Ax_view, Bx_view, Cx_view
which are in vectors vec_Ax_views, vec_Bx_views, vec_Cx_views
.
These views are created by create_gens_nodes_aggregate_system_matrices_Idx_and_views
.
The intialisation is expected to be reflected in aggregate system matrices Ax_matrix, Bx_matrix, Cx_matrix
ePowerSim.init_plants_system_stability_matrices_views!
— MethodThis function initialises system stability matrices views stab_Ax_view, stab_Bx_view, stab_Cx_view
which are in vectors vec_stab_Ax_views, vec_stab_Bx_views, vec_stab_Cx_views
.
These views are created by create_gens_nodes_aggregate_system_stability_matrices_Idx_and_views
.
The intialisation is expected to be reflected in aggregate system matrices stab_Ax_matrix, stab_Bx_matrix, stab_Cx_matrix
ePowerSim.invZ_dq
— MethodinvZ_dq(ra, X_d_dash, X_q_dash)
Returns inverse Z_dq matrix transform for a generator.
ePowerSim.limit_violation
— Methodlimit_violation(x, x_max, x_min)
Returns a boolean if x
is outside its min and max range.
ePowerSim.loc_load_exist_bool_by_mpc
— Methodloc_load_exist_bool_by_mpc( mpc_bus )
Returns true
or false
if any of the generators has a local load.
ePowerSim.machine_to_network_ref_frame
— Methodmachine_to_network_ref_frame(x_d, x_q, δ)
Returns a machine reference frame to network reference frame, Sauer page 160
ePowerSim.make_a_component_state_no_callback_paras
— MethodAn event is associated with a state. An event in a state (x1) can affect the state (x1) it occured in or another state (x_2).
A state can have multiple events associated with it.
ePowerSim.make_csv_from_sols
— MethodThis function saves solution of cases in csv files
listsol = [solIEEE5BusplantSMcbidqcntrlandPQConstI, solIEEE5BusplantSMcbv6cntrlandPQConstI, solIEEE5BusplantSMcbidqcntrlandPQConstP, solIEEE5BusplantSMcbv6cntrlandPQConst_P]
listprefix = ["IEEE5BusplantSMcbidqcntrlandPQConstI", "IEEE5BusplantSMcbv6cntrlandPQConstI", "IEEE5BusplantSMcbidqcntrlandPQConstP", "IEEE5BusplantSMcbv6cntrlandPQConst_P"]
makecsvfromsols(csvfolder, listsol, listprefix; suffix = :csv)
ePowerSim.make_plots_with_names
— MethodThis function makes plots for selected symbols for a list of solutions:
networkvarslabels = getnetworkvarslabels(NetworkData(caseIEEE5BusdynamicplantSMcbidqPQConstI()...))
listsol = [solIEEE5BusplantSMcbidqcntrlandPQConstI, solIEEE5BusplantSMcbv6cntrlandPQConstI, solIEEE5BusplantSMcbidqcntrlandPQConstP, solIEEE5BusplantSMcbv6cntrlandPQConst_P]
listprefix = String.(nameof.(listcases))
or
listprefix = ["IEEE5BusplantSMcbidqcntrlandPQConstI", "IEEE5BusplantSMcbv6cntrlandPQConstI", "IEEE5BusplantSMcbidqcntrlandPQConstP", "IEEE5BusplantSMcbv6cntrlandPQConst_P"]
listselectedsymslist = [[:ω, :δ, :eddash, :eqdash], [:xg1, :xg2, :xg3, :τmtilade], [:vm, :vr1, :vr2, :vftilade], [:phatin, :v_ref]]
makeplotswithnames(figfolder, listsol, listprefix, listselectedsymslist, networkvars_labels; tspan = (0.0, 50.0), suffix = :pdf)
ePowerSim.namedtuple_nested_selection
— Methodnamedtuple_nested_selection(
nested_namedtuple;
sequence_order = (:nothing,),
selections = (:nothing,) )
Returns a set of selection at the same level in a nested namedtuple.
Example
some_plant_generators_data_from_json =
[(idx = 1,
plant_type = "plant_wt_loc_load_v6",
components_type =
(gen = "SM_2axis_wt_loc_load_cb_v6",
avr = "avr_t1_cb",
gov = "gov_ieee_tgov1_cb"),
components_data = (
gen = (T_d_dash = 7.4, D = 0, X_d = 0.8979,
vh = 1.06, X_q = 0.646,
ωs = 376.99111843077515,
T_d_2dash = 0.03, Qmin = 0,
Sn = 332.5503871596002,
X_d_dash = 0.2995, T_q_dash = 0.3,
Ωb = 376.99111843077515,
Bus = "bus1", X_q_dash = 0.646,
ra = 0, X_q_2dash = 0.4,
Q = -16.9, Pmax = 332.4,
Pmin = 0, xℓ = 0.2396,
P = 232.4, vmax = 1.06,
H = 5.148, Qmax = 10,
vmin = 0.94, T_q_2dash = 0.033,
X_d_2dash = 0.23), )),
(idx = 2,
plant_type = "plant_wt_loc_load_v6",
components_type =
(loc_load = "loc_Load_t1",
gen = "SM_2axis_wt_loc_load_cb_v6",
avr = "avr_t1_cb",
gov = "gov_ieee_tgov1_cb"),
components_data = (
loc_load = (Bus = "bus2",
loc_P = 21.7,
loc_Q = 12.7),
gen = (T_d_dash = 6.1, D = 0, X_d = 1.05,
vh = 1.045, X_q = 0.98,
ωs = 376.99111843077515,
T_d_2dash = 0.04, Qmin = -40,
Sn = 148.66068747318505,
X_d_dash = 0.185, T_q_dash = 0.3,
Ωb = 376.99111843077515,
Bus = "bus2", X_q_dash = 0.36,
ra = 0.0031, X_q_2dash = 0.13,
Q = 42.4, Pmax = 140, Pmin = 0,
xℓ = 0, P = 40, vmax = 1.06,
H = 6.54, Qmax = 50, vmin = 0.94,
T_q_2dash=0.099,X_d_2dash=0.13),))]
sequence_order = (:components_data, :gen)
selections = (:P, :Q)
namedtuple_nested_selection(
some_plant_generators_data_from_json;
sequence_order = sequence_order,
selections = selections )
2-element Vector{Any}:
(P = 232.4, Q = -16.9)
(P = 40, Q = 42.4)
ePowerSim.network_to_machine_ref_frame
— Methodnetwork_to_machine_ref_frame(x_r, x_i, δ)
Returns a network to machine reference frame. Network reference frame to machine reference frame Sauer page 160
ePowerSim.nineth
— Methodnineth(elements_container)
Returns the nineth element in a list.
ePowerSim.no_limit_violation
— Methodno_limit_violation(x, x_max, x_min)
Returns a boolean if x
is within its min and max range.
ePowerSim.parse_matpower_data_as_csv
— Methodparse_matpower_data_as_csv
Returns a dictionary
Dict( "name" => matrix_name, "columns_header" => columns_header, "matrix_body" => matrix_body_lines, "line_count" => line_count )
for a matpower file section.
ePowerSim.parse_matpower_data_header
— Methodparse_matpower_data_header
Returns matrix_name
, columns_header
, line_count
for a section in matpower file.
ePowerSim.pertubation_by_itegrator
— Methodpertubation_by_itegrator(
var_normal_value,
pertubation_factor,
pertubation_tstop,
var_idx,
system_integrator;
parameter_df =
nothing,
change_in_parameter_dict =
nothing,
target_parameter_sym =
nothing )
These functions are used in generating results for load pertubation, co-simulation, etc.
get_sol_auxilliary_results
, pertubation_by_itegrator
a_parameter_pertubation!
, a_parameter_pertubation_and_step!
save_pertubation_stage_plot
, save_co_sim_stage_plot
,
get_P_or_Q_idx_in_generic_model_dynamics_para
get_make_df_header_generic_model_dynamics_para
ePowerSim.pf_dynamic_nodal_current_balance
— Methodpf_dynamic_nodal_current_balance(
x_s, x_d)
Returns dynamic nodal current balance at a node.
ePowerSim.polar_to_cartesian
— Methodpolar_to_cartesian( v_θ )
Returns the cartesian complex values for a polar values.
ePowerSim.recursive_dict_to_namedtuple
— Methodrecursive_dict_to_namedtuple(
mapping)
Converts recursively a nested dictionary to a nested namedtuple.
Example
dict_values =
Dict{Symbol, Any}(
:V_R_max => 5.2,
:Tf => 0.35,
:Be => 1.555,
:Tr => 0.001,
:Ta => 0.2,
:Ka => 20,
:Te => 0.314,
:Kf => 0.063,
:V_R_min => -4.16,
:Ke => 1,
:gov => Dict{Symbol, Any}(
:p_max => 2.2,
:R => 0.02,
:p_min => 0.1,
:Ts => 0.2,
:Tc => 0.4,
:avr => Dict{Symbol, Any}(
:Tr => 0.001,
:Ta => 0.2,
:Ka => 20,
:Te => 0.314) ))
recursive_dict_to_namedtuple(dict_values)
ePowerSim.recursive_nested_namedtuple_wt_dict
— Methodrecursive_nested_namedtuple_wt_dict(
nested_namedtuple)
Converts recursively a nested dictionary to a nested namedtuple.
Example
nt_values =
(
V_R_max = 5.2,
Tf = 0.35,
Be = 1.555,
Tr = 0.001,
Ta = 0.2,
Ka = 20,
Te = 0.314,
Kf = 0.063,
V_R_min = -4.16,
Ke = 1,
gov = Dict{Symbol, Any}(
:p_max => 2.2,
:R => 0.02,
:p_min => 0.1,
:Ts => 0.2,
:Tc => 0.4,
:avr => Dict{Symbol, Any}(
:Tr => 0.001,
:Ta => 0.2,
:Ka => 20,
:Te => 0.314) ))
recursive_nested_namedtuple_wt_dict(
nt_values)
ePowerSim.round_up_Ynet
— Methodround_up_Ynet(
Ynet;
fractional_digits=4)
Returns a rounded version Ynet
based on fractional_digits
.
ePowerSim.save_matpower_data_as_csv
— Methodsave_matpower_data_as_csv
Saves a matpower section as a csv file. The inputs to this function is a dictionary which is an output of parse_matpower_data_as_csv
Dict( "name" => matrix_name, "columns_header" => columns_header, "matrix_body" => matrix_body_lines, "line_count" => line_count )
and a directory to store the csv file. The name of the csv file is taken from matrix_name
in the dictionary.
ePowerSim.save_matpower_scalar_as_csv
— Methodsave_matpower_scalar_as_csv
Saves a matpower scalar section such as mpc.baseMVA = 100
as a csv
ePowerSim.save_sols
— Methodhttps://docs.sciml.ai/DiffEqDocs/stable/features/io/
ePowerSim.scale_demand
— MethodThis was taken from JuMP tutoria:
ePowerSim.scale_generator_cost
— MethodThis was taken from JuMP tutoria:
ePowerSim.second
— Methodsecond(elements_container)
Returns the second element in a list.
ePowerSim.seventh
— Methodseventh(elements_container)
Returns the seventh element in a list.
ePowerSim.simulate_cases
— Methodsimulate_cases(sd_dyn_sim_func, list_cases; static_case = case_IEEE_5_Bus_static )
This function simulates several cases in of dynamic power models in listcases. The dynamic function for simulation is `sddynsimfunc` .
The static_case is used to obtain power flow for intialisation of the states of the dynamic model.
It returns solution for each of the cases in a list.
listcases = [caseIEEE5BusdynamicplantSMcbidqPQConstI, caseIEEE5BusdynamicplantSMcbv6PQConstI, caseIEEE5BusdynamicplantSMcbidqPQConstP, caseIEEE5BusdynamicplantSMcbv6PQConst_P]
listsol = simulatecases(sddynamicssimulationexternalft, listcases; staticcase = caseIEEE5Bus_static )
ePowerSim.sixth
— Methodsixth(elements_container)
Returns the sixth element in a list.
ePowerSim.swap_yπ_diagonal_elements
— Methodget_nt_components_data( components_data)
Swap the diagonal element of a 2 x 2 matrix.
It is used in get_Yπ_net
to get an appropriate orientation for elementary admittance matrix yπ
.
ePowerSim.syms_containing
— Methodsyms_containing(
network_vars_labels,
expr;
syms = true)
Returns the list of symbols of variables containing a given expr
in network variable labels.
ePowerSim.tenth
— Methodtenth(elements_container)
Returns the tenth element in a list.
ePowerSim.thermal_cost_function
— MethodThis was taken from JuMP tutoria:
thermal_cost_function(g)
A user-defined thermal cost function in pure-Julia! You can include nonlinearities, and even things like control flow.
ePowerSim.third
— Methodthird(elements_container)
Returns the third element in a list.
ePowerSim.threshold_limits
— Methodthreshold_limits(x, x_max, x_min)
Returns x
if it is within its min and max range, else clip it at thresholds..
ePowerSim.u_from_ur_ui
— Methodu_from_ur_ui(ur_ui)
Returns the complex voltage for a list containing real part and imaginary part of a complex voltage.
ePowerSim.u_to_VΘ
— Methodu_to_VΘ(u)
Returns the magnitude and angle for a given complex value.
ePowerSim.u_to_ΘV
— Methodu_to_ΘV(u)
Returns a flatted concatenated nodes voltage angles and nodes voltage magnitudes for a list of nodes complex voltages.
ePowerSim.update_padded_vec_of_vec_from_comp_axis!
— Methodupdate_padded_vec_of_vec_from_comp_axis!(
padded_vec_of_vec,
P_comp, Q_comp,
idxs )
Updates padded_vec_of_vec
, by P_comp
, Q_comp
based on idxs
.
Example
nodes_size = 9
paddedvecofvec = [[0.0, 0.0] for idx in 1:nodessize ]
Pcomp = [1.2, 3.0, 4.0] Qcomp = [2.2, 3.1, 1.0]
idxs = [2,5,9]
ePowerSim.update_vec_of_vec_from_comp_axis!
— Methodupdate_vec_of_vec_from_comp_axis!(
vec_of_vec, P_comp, Q_comp )
Updates vec_of_vec
, by P_comp
, Q_comp
.
Example
a = [[0.0, 0.0], [1.0, 0.0], [0.1,0.2]] tp = [1.2, 3.0, 4.0] tq = [2.2, 3.1, 1.0]
updatevecofvecfromcompaxis!( a , tp , tq )
ePowerSim.update_vec_of_vec_from_flattened!
— Methodupdate_vec_of_vec_from_flattened!(
vec_of_vec, flattened_vec, vec_vec_Idx )
Updates vec_of_vec
, by flattened_vec
based on vec_vec_Idx
.
ePowerSim.update_vec_of_vec_from_vec_vec!
— Methodupdate_vec_of_vec_from_vec_vec!(
vec_of_vec, PQ_vec_vec, idxs )
Updates vec_of_vec
, by PQ_vec_vec
based on idxs
.
Example
a = [[0.0, 0.0], [0.0, 0.0], [0.0,0.0], [0.0,0.0], [0.0,0.0], [0.0,0.0] ]
t_p = [[1.2, 3.0], [4.0, 6.0]]
idxs = [2, 4, 6]
ePowerSim.ur_ui_to_u
— Methodur_ui_to_u(ur_ui)
Returns the complex voltage for a list containing real part and imaginary part of a complex voltage.
ePowerSim.ur_ui_to_ΘV
— Methodur_ui_to_ΘV(ur_ui)
Returns a flatted concatenated nodes voltage angles and nodes voltage magnitudes for a list of list of nodes voltages real and imaginary parts.
ePowerSim.write_vector_or_matrix_to_tex
— Methodwrite_vector_or_matrix_to_tex(
tuple_julia_object,
tex_filename)
Write julia collections in tuple_julia_object
to a tex file.
ePowerSim.x_from_xr_xi
— Methodx_from_xr_xi(ur_ui)
Returns the complex value for a list containing real part and imaginary part of a complex value.
ePowerSim.xr_xi_to_x
— Methodxr_xi_to_x(ur_ui)
Returns the complex value for a list containing real part and imaginary part of a complex value.
ePowerSim.z2y
— Methodz2y(; r =1.0, x = 1.00, G = 0.0, B = 0.0)
Returns a transmission admittance y
for a given r
, x
, G
and B
.