Skip to content

Commit

Permalink
v1.5.1. Add option export_full to save_network_Y_matrix functions and…
Browse files Browse the repository at this point in the history
… APIs. Start to add sequential parameters. stepspy is also updated.
  • Loading branch information
changgang committed Feb 2, 2021
1 parent ef7d691 commit e863709
Show file tree
Hide file tree
Showing 29 changed files with 387 additions and 102 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Simulation Toolkit for Electrical Power Systems
- Maintainer: Changgang Li <[email protected]> from School of Electrical Engineering, Shandong University.
- Documentation: [N/A]
- Date of Readme: Jan. 15, 2021
- Date of Readme: Feb. 2, 2021

# Reference
Please cite STEPS with the following paper:
Expand All @@ -15,6 +15,7 @@ Though BPA dat format is supported, it will be supported in the future version i
You are encourage to join us for further development.

## Major versions
- v1.5.1. Add new option export_full to functions of save_network_Y_matrix and APIs. stepspy is also updated. Start to add sequential parameters to STEPS. Released on Feb. 2, 2021.
- v1.5.0. Add new function to get basic and user meter value in STEPS kernel and stepspy. Add additional parameter vbase to bus_name2number in case multi buses have the same bus name. Released on Dec. 22, 2020.
- v1.4.1. Fix clear toolkit when reloading new powerflow data. Enable build initial zero Y matrix. Fix access violation in jacobian builder when updating seperate jacobian matrix. Add check of LU factorization failure. Special log file named 'blackhole' is supported to disable all log. Released on Dec. 7, 2020.
- v1.4. add function to add default GENCLS model for generators without sync generator model when checking missing models. Fix bug in IEEEG1 in case T1 or T2 is not 0. Released on Sep. 27, 2020.
Expand Down
48 changes: 24 additions & 24 deletions code/steps/STEPS.depend
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
1583938871 d:\steps\code\steps\header\model\load_relay_model\load_frequency_relay_model.h
"header/model/load_relay_model/load_relay_model.h"

1607318983 d:\steps\code\steps\header\device\line.h
1611673743 d:\steps\code\steps\header\device\line.h
"header/device/nonbus_device.h"
"header/basic/device_id.h"
"header/basic/rating.h"
Expand All @@ -300,14 +300,14 @@

1583938871 d:\steps\code\steps\header\basic\rating.h

1607318983 d:\steps\code\steps\header\device\transformer.h
1611674913 d:\steps\code\steps\header\device\transformer.h
"header/device/nonbus_device.h"
"header/basic/steps_enum.h"
"header/basic/rating.h"
<string>
<complex>

1607318983 d:\steps\code\steps\header\device\fixed_shunt.h
1611676471 d:\steps\code\steps\header\device\fixed_shunt.h
"header/device/nonbus_device.h"
<string>
<complex>
Expand Down Expand Up @@ -390,7 +390,7 @@
"header/network/jacobian_builder.h"
"header/basic/sparse_matrix_define.h"

1607318983 d:\steps\code\steps\header\network\network_matrix.h
1612239469 d:\steps\code\steps\header\network\network_matrix.h
"header/power_system_database.h"
"header/basic/sparse_matrix_define.h"
"header/basic/inphno.h"
Expand Down Expand Up @@ -953,7 +953,7 @@
"header/power_system_database.h"
"header/STEPS.h"

1583938871 d:\steps\code\steps\header\device\transformer_test.h
1611675032 d:\steps\code\steps\header\device\transformer_test.h
<istream>
<cstdlib>
<cstring>
Expand All @@ -963,7 +963,7 @@
"header/power_system_database.h"
"header/STEPS.h"

1598590744 d:\steps\code\steps\header\device\fixed_shunt_test.h
1611676525 d:\steps\code\steps\header\device\fixed_shunt_test.h
<istream>
<cstdlib>
<cstring>
Expand Down Expand Up @@ -2338,7 +2338,7 @@
"header/data_imexporter/psse_imexporter.h"
"header/data_imexporter/bpa_imexporter.h"

1608619265 d:\steps\code\steps\header\apis\steps_api.h
1612240167 d:\steps\code\steps\header\apis\steps_api.h
<cstdlib>
"header/basic/constants.h"

Expand Down Expand Up @@ -2388,7 +2388,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"

1587536929 source:d:\steps\code\steps\source\apis\steps_api_powerflow.cpp
1612240184 source:d:\steps\code\steps\source\apis\steps_api_powerflow.cpp
"header/apis/steps_api.h"
"header/basic/utility.h"
"header/steps_namespace.h"
Expand All @@ -2405,7 +2405,7 @@
"header/apis/steps_api_search_buffer.h"
<iostream>

1608619265 source:d:\steps\code\steps\source\apis\steps_api_search_devices.cpp
1611548671 source:d:\steps\code\steps\source\apis\steps_api_search_devices.cpp
<istream>
"header/apis/steps_api.h"
"header/apis/steps_api_common.h"
Expand Down Expand Up @@ -2439,7 +2439,7 @@
"header/data_imexporter/psse_imexporter.h"
"header/data_imexporter/bpa_imexporter.h"

1598590744 source:d:\steps\code\steps\source\apis\steps_api_set_get_fixed_shunt_parameters.cpp
1611676449 source:d:\steps\code\steps\source\apis\steps_api_set_get_fixed_shunt_parameters.cpp
"header/apis/steps_api.h"
"header/apis/steps_api_common.h"
"header/basic/utility.h"
Expand Down Expand Up @@ -2605,7 +2605,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"

1607318983 source:d:\steps\code\steps\source\basic\complex_sparse_matrix.cpp
1612241866 source:d:\steps\code\steps\source\basic\complex_sparse_matrix.cpp
"header/basic/complex_sparse_matrix.h"
"header/basic/constants.h"
"header/basic/utility.h"
Expand Down Expand Up @@ -3395,7 +3395,7 @@
<iostream>
<cstdio>

1598590744 source:d:\steps\code\steps\source\data_imexporter\bpa_powerflow_imexporter.cpp
1611676449 source:d:\steps\code\steps\source\data_imexporter\bpa_powerflow_imexporter.cpp
"header/data_imexporter/bpa_imexporter.h"
"header/basic/utility.h"
"header/device/bus.h"
Expand Down Expand Up @@ -3455,7 +3455,7 @@
<istream>
<iostream>

1585314815 source:d:\steps\code\steps\source\data_imexporter\psse_imexporter_test.cpp
1611676449 source:d:\steps\code\steps\source\data_imexporter\psse_imexporter_test.cpp
<cmath>
"cpptest.h"
"header/basic/test_macro.h"
Expand All @@ -3468,7 +3468,7 @@
<iostream>
<cstdio>

1598590744 source:d:\steps\code\steps\source\data_imexporter\psse_powerflow_imexporter.cpp
1611676449 source:d:\steps\code\steps\source\data_imexporter\psse_powerflow_imexporter.cpp
"header/data_imexporter/psse_imexporter.h"
"header/data_imexporter/steps_imexporter.h"
"header/basic/utility.h"
Expand All @@ -3494,7 +3494,7 @@
<istream>
<iostream>

1585314815 source:d:\steps\code\steps\source\data_imexporter\steps_imexporter_test.cpp
1611676449 source:d:\steps\code\steps\source\data_imexporter\steps_imexporter_test.cpp
<cmath>
"cpptest.h"
"header/basic/test_macro.h"
Expand All @@ -3507,7 +3507,7 @@
<iostream>
<cstdio>

1611360880 source:d:\steps\code\steps\source\data_imexporter\steps_powerflow_imexporter.cpp
1611676449 source:d:\steps\code\steps\source\data_imexporter\steps_powerflow_imexporter.cpp
"header/data_imexporter/steps_imexporter.h"
"header/basic/utility.h"
"header/device/bus.h"
Expand Down Expand Up @@ -3596,14 +3596,14 @@
<cstdio>
<cstdlib>

1607318983 source:d:\steps\code\steps\source\device\fixed_shunt.cpp
1611676484 source:d:\steps\code\steps\source\device\fixed_shunt.cpp
"header/device/fixed_shunt.h"
"header/basic/utility.h"
"header/STEPS.h"
<istream>
<iostream>

1598590744 source:d:\steps\code\steps\source\device\fixed_shunt_test.cpp
1611676601 source:d:\steps\code\steps\source\device\fixed_shunt_test.cpp
<cmath>
"cpptest.h"
"header/basic/test_macro.h"
Expand All @@ -3616,7 +3616,7 @@
<cstdio>
<cstdlib>

1611360880 source:d:\steps\code\steps\source\device\generator.cpp
1611675979 source:d:\steps\code\steps\source\device\generator.cpp
"header/device/generator.h"
"header/basic/utility.h"
"header/STEPS.h"
Expand Down Expand Up @@ -3696,7 +3696,7 @@
<iostream>
<cstdio>

1611360880 source:d:\steps\code\steps\source\device\load.cpp
1611676030 source:d:\steps\code\steps\source\device\load.cpp
"header/device/load.h"
"header/basic/utility.h"
"header/STEPS.h"
Expand Down Expand Up @@ -3773,14 +3773,14 @@
<iostream>
<cstdio>

1607318983 source:d:\steps\code\steps\source\device\transformer.cpp
1611674947 source:d:\steps\code\steps\source\device\transformer.cpp
"header/device/transformer.h"
"header/basic/utility.h"
"header/STEPS.h"
<istream>
<iostream>

1598590744 source:d:\steps\code\steps\source\device\transformer_test.cpp
1611675763 source:d:\steps\code\steps\source\device\transformer_test.cpp
<cmath>
"cpptest.h"
"header/basic/test_macro.h"
Expand Down Expand Up @@ -5393,7 +5393,7 @@
<cstdio>
<cmath>

1611360880 source:d:\steps\code\steps\source\network\jacobian_builder.cpp
1611676831 source:d:\steps\code\steps\source\network\jacobian_builder.cpp
"header/network/jacobian_builder.h"
"header/basic/utility.h"
"header/steps_namespace.h"
Expand All @@ -5410,7 +5410,7 @@
"header/steps_namespace.h"
<cstdio>

1607318983 source:d:\steps\code\steps\source\network\network_matrix.cpp
1612241740 source:d:\steps\code\steps\source\network\network_matrix.cpp
"header/network/network_matrix.h"
"header/basic/utility.h"
"header/STEPS.h"
Expand Down
2 changes: 1 addition & 1 deletion code/steps/header/apis/steps_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ EXPORT_STEPS_DLL void api_build_decoupled_network_B_matrix(unsigned int toolkit_
EXPORT_STEPS_DLL void api_build_dc_network_B_matrix(unsigned int toolkit_index=INDEX_NOT_EXIST);
EXPORT_STEPS_DLL void api_build_dynamic_network_Y_matrix(unsigned int toolkit_index=INDEX_NOT_EXIST);
EXPORT_STEPS_DLL void api_build_network_Z_matrix(unsigned int toolkit_index=INDEX_NOT_EXIST);
EXPORT_STEPS_DLL void api_save_network_Y_matrix(char* file, unsigned int toolkit_index=INDEX_NOT_EXIST);
EXPORT_STEPS_DLL void api_save_network_Y_matrix(char* file, bool export_full=false, unsigned int toolkit_index=INDEX_NOT_EXIST);
EXPORT_STEPS_DLL void api_save_decoupled_network_B_matrix(char* file, unsigned int toolkit_index=INDEX_NOT_EXIST);
EXPORT_STEPS_DLL void api_save_dc_network_B_matrix(char* file, unsigned int toolkit_index=INDEX_NOT_EXIST);
EXPORT_STEPS_DLL void api_save_dynamic_network_Y_matrix(char* file, unsigned int toolkit_index=INDEX_NOT_EXIST);
Expand Down
11 changes: 8 additions & 3 deletions code/steps/header/device/fixed_shunt.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@ class FIXED_SHUNT : public NONBUS_DEVICE
void set_identifier(string identifier);
void set_name(string name);
void set_status(bool status);
void set_nominal_impedance_shunt_in_MVA(complex<double> s);
void set_nominal_positive_sequence_impedance_shunt_in_MVA(complex<double> s);
void set_nominal_zero_sequence_impedance_shunt_in_MVA(complex<double> s);

unsigned int get_shunt_bus() const;
BUS* get_bus_pointer() const;
string get_identifier() const;
string get_name() const;
bool get_status() const;
complex<double> get_nominal_impedance_shunt_in_MVA() const;
complex<double> get_nominal_positive_sequence_impedance_shunt_in_MVA() const;
complex<double> get_nominal_impedance_shunt_in_pu() const;
complex<double> get_nominal_admittance_shunt_in_pu() const;
complex<double> get_nominal_zero_sequence_impedance_shunt_in_MVA() const;
complex<double> get_nominal_zero_sequence_impedance_shunt_in_pu() const;
complex<double> get_nominal_zero_sequence_admittance_shunt_in_pu() const;

virtual bool is_valid() const;
virtual void check();
Expand All @@ -52,6 +56,7 @@ class FIXED_SHUNT : public NONBUS_DEVICE
string identifier;
string name;
bool status;
complex<double> nominal_impedance_shunt_in_MVA;
complex<double> nominal_positive_sequence_impedance_shunt_in_MVA;
complex<double> nominal_zero_squence_impedance_shunt_in_MVA;
};
#endif // FIXED_SHUNT_H
3 changes: 2 additions & 1 deletion code/steps/header/device/fixed_shunt_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class FIXED_SHUNT_TEST : public Test::Suite
void test_set_get_identifier();
void test_set_get_name();
void test_set_get_status();
void test_set_get_nominal_impedance_shunt();
void test_set_get_nominal_positive_sequence_impedance_shunt();
void test_set_get_nominal_zero_sequence_impedance_shunt();

void test_is_valid();
void test_clear();
Expand Down
6 changes: 3 additions & 3 deletions code/steps/header/device/line.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ class LINE : public NONBUS_DEVICE
string name;
bool sending_side_breaker_status, receiving_side_breaker_status;
complex<double> line_z_12, line_z_0,
line_y_12, line_y_0,
shunt_y_12_sending_side, shunt_y_0_sending_side,
shunt_y_12_receiving_side, shunt_y_0_receiving_side;
line_y_12, line_y_0,
shunt_y_12_sending_side, shunt_y_0_sending_side,
shunt_y_12_receiving_side, shunt_y_0_receiving_side;
RATING rating;
unsigned int meter_end_bus;
double length;
Expand Down
16 changes: 13 additions & 3 deletions code/steps/header/device/transformer.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ class TRANSFORMER : public NONBUS_DEVICE
void set_controlled_min_reactive_power_into_winding_in_MVar(TRANSFORMER_WINDING_SIDE winding, double q);
void set_controlled_max_active_power_into_winding_in_MW(TRANSFORMER_WINDING_SIDE winding, double p);
void set_controlled_min_active_power_into_winding_in_MW(TRANSFORMER_WINDING_SIDE winding, double p);
void set_winding_zero_sequence_impedance_based_on_winding_nominals_in_pu(TRANSFORMER_WINDING_SIDE winding, complex<double> z);
void set_common_zero_sequence_nutural_grounding_impedance_based_on_winding_nominals_in_pu(complex<double> z);
void set_zero_sequence_impedance_between_windings_based_on_winding_nominals_in_pu(TRANSFORMER_WINDING_SIDE winding1, TRANSFORMER_WINDING_SIDE winding2, complex<double> z);



Expand Down Expand Up @@ -75,6 +78,9 @@ class TRANSFORMER : public NONBUS_DEVICE
double get_controlled_min_reactive_power_into_winding_in_MVar(TRANSFORMER_WINDING_SIDE winding) const;
double get_controlled_max_active_power_into_winding_in_MW(TRANSFORMER_WINDING_SIDE winding) const;
double get_controlled_min_active_power_into_winding_in_MW(TRANSFORMER_WINDING_SIDE winding) const;
complex<double> get_winding_zero_sequence_impedance_based_on_winding_nominals_in_pu(TRANSFORMER_WINDING_SIDE winding) const;
complex<double> get_common_zero_sequence_nutural_grounding_impedance_based_on_winding_nominals_in_pu() const;
complex<double> get_zero_sequence_impedance_between_windings_based_on_winding_nominals_in_pu(TRANSFORMER_WINDING_SIDE winding1, TRANSFORMER_WINDING_SIDE winding2) const;


virtual bool is_valid() const;
Expand Down Expand Up @@ -157,7 +163,7 @@ class TRANSFORMER : public NONBUS_DEVICE
RATING winding_rating_in_MVA[3];

complex<double> zl_primary2secondary_in_pu, zl_secondary2tertiary_in_pu,
zl_primary2tertiary_in_pu, y_magnetizing_in_pu;
zl_primary2tertiary_in_pu, y_magnetizing_in_pu;

double winding_turn_ratio_in_pu[3], winding_angle_shift_in_deg[3];

Expand All @@ -174,9 +180,13 @@ class TRANSFORMER : public NONBUS_DEVICE
double winding_controlled_max_bus_voltage_in_pu[3], winding_controlled_min_bus_voltage_in_pu[3];

double controlled_max_reactive_power_into_winding_in_MVar[3],
controlled_min_reactive_power_into_winding_in_MVar[3];
controlled_min_reactive_power_into_winding_in_MVar[3];

double controlled_max_active_power_into_winding_in_MW[3],
controlled_min_active_power_into_winding_in_MW[3];
controlled_min_active_power_into_winding_in_MW[3];

complex<double> z0_winding_ground_in_pu[3], z0_common_nutral_ground_in_pu;
complex<double> z0_primary2secondary_in_pu, z0_secondary2tertiary_in_pu,
z0_primary2tertiary_in_pu;
};
#endif // TRANSFORMER_H
3 changes: 3 additions & 0 deletions code/steps/header/device/transformer_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ class TRANSFORMER_TEST : public Test::Suite
void test_set_get_winding_controlled_max_min_voltage();
void test_set_get_controlled_reactive_power_into_windings();
void test_set_get_controlled_active_power_into_windings();
void test_set_get_winding_zero_sequence_impedance();
void test_set_get_zero_sequence_impedance_between_windings();
void test_set_get_common_zero_sequence_nutral_grouding_impedance();

void test_is_valid();
void test_clear();
Expand Down
3 changes: 2 additions & 1 deletion code/steps/header/network/network_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class NETWORK_MATRIX
void report_dynamic_network_matrix();
void report_physical_internal_bus_number_pair() const;

void save_network_Y_matrix_to_file(const string& filename);
void save_network_Y_matrix_to_file(const string& filename, bool export_full_matrix=true);
void save_decoupled_network_B_matrix_to_file(const string& filename) const;
void save_dc_network_B_matrix_to_file(const string& filename) const;
void save_dynamic_network_Y_matrix_to_file(const string& filename);
Expand Down Expand Up @@ -148,6 +148,7 @@ class NETWORK_MATRIX

void report_network_matrix_common() const;
void save_network_matrix_common(ofstream& file) const;
void save_full_network_matrix_common(ofstream& file) const;
private:
STEPS* toolkit;

Expand Down
4 changes: 2 additions & 2 deletions code/steps/source/apis/steps_api_powerflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,12 @@ void api_build_network_Z_matrix(unsigned int toolkit_index)
network_matrix.build_positive_sequence_network_Z_matrix();
}

void api_save_network_Y_matrix(char* file, unsigned int toolkit_index)
void api_save_network_Y_matrix(char* file, bool export_full, unsigned int toolkit_index)
{
STEPS& toolkit = get_toolkit(toolkit_index);
POWERFLOW_SOLVER& solver = toolkit.get_powerflow_solver();
NETWORK_MATRIX& network_matrix = solver.get_network_matrix();
network_matrix.save_network_Y_matrix_to_file(file);
network_matrix.save_network_Y_matrix_to_file(file, export_full);
}

void api_save_decoupled_network_B_matrix(char* file, unsigned int toolkit_index)
Expand Down
Loading

0 comments on commit e863709

Please sign in to comment.