diff --git a/README.md b/README.md
index 9f6821ac..689d2d64 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@
- Reminder of major repository:
* The github repository may lag behind the gitee repository due to some GIT PUSH issues. So, use gitee repository first.
* The 'dev' branch is constantly updating while the 'main' branch is updated when major functions are added. Use 'main' branch for stable applications, and try 'dev' branch for new features.
-- Date of Readme: Nov. 2, 2023
+- Date of Readme: March 24, 2024
# Reference
Please cite STEPS with the following papers:
@@ -23,6 +23,7 @@ Though BPA dat format is supported, it will be supported in the future version i
You are encouraged to join us for further development.
## Major versions
+- v2.2.0. Add function to change dynamic simulation time step manually. stepspy is also updated however not pushed to pypi due to token issue. please use python/stepspy-current/stepspy.
- v2.1.0. Add function to check if NAN is detected in powerflow solver. stepspy is also updated. Compile option '-ffast-math' is disabled.
- v2.0.0. Major version. (1) Short circuit functions added. Short circuit analysis with direct solution is supported. APIs are added to stepspy. Short circuit analysis with iterative solution is implemented in C++, and APIs will be added in later version. (2) Two toolkit functions added: Correct Three Winding Transformer Impedance Logic and Blockwise Automatic Large Step Logic. If the 'Correct' logic is enabled, zero impedance winding of 3-winding transformer can be automatically fixed to avoid NaN error. If the 'Blockwise' logic is enabled, dynamic simulation time step can be increased for fast simulation (See Reference Paper [2]). The 'Blockwise' logic is implemented with changes of dynamic blocks of first order, differential, and lead-lag. (3) Option 'libsteps_file' is added to stepspy when creating STEPS() object when dynamic library with name different from 'libSTEPS' is used. (4) Some wind turbine model bugs are fixed. (5) stepspy module is also upgraded to v2.0.0.
- v1.6.0. Add VSC HVDC for powerflow and dynamic simulation. stepspy also updated. Released on April 13, 2022.
diff --git a/code/steps/STEPS.cbp b/code/steps/STEPS.cbp
index bf614415..966ca4cf 100644
--- a/code/steps/STEPS.cbp
+++ b/code/steps/STEPS.cbp
@@ -8,11 +8,10 @@
-
+
-
+
-
diff --git a/code/steps/STEPS.depend b/code/steps/STEPS.depend
index 93a2ce2a..90aa977e 100644
--- a/code/steps/STEPS.depend
+++ b/code/steps/STEPS.depend
@@ -69,14 +69,14 @@
1710154432 d:\steps\code\steps\header\basic\constants.h
-1710214258 d:\steps\code\steps\header\basic\steps_enum.h
+1711280413 d:\steps\code\steps\header\basic\steps_enum.h
1664187911 d:\steps\code\steps\header\basic\terminal.h
-1704712176 d:\steps\code\steps\header\block\block.h
+1711183893 d:\steps\code\steps\header\block\block.h
"header/basic/steps_enum.h"
"header/basic/sparse_matrix_define.h"
@@ -161,10 +161,10 @@
"header/basic/steps_enum.h"
-1664187911 d:\steps\code\steps\header\model\bus_model\bus_frequency_model\bus_frequency_model.h
+1711288396 d:\steps\code\steps\header\model\bus_model\bus_frequency_model\bus_frequency_model.h
"header/block/differential_block.h"
-1710077423 d:\steps\code\steps\header\block\differential_block.h
+1711285524 d:\steps\code\steps\header\block\differential_block.h
"header/block/block.h"
1710079431 d:\steps\code\steps\header\device\generator.h
@@ -203,10 +203,10 @@
"header/basic/sparse_matrix_define.h"
-1710077423 d:\steps\code\steps\header\block\integral_block.h
+1711285538 d:\steps\code\steps\header\block\integral_block.h
"header/block/block.h"
-1710077423 d:\steps\code\steps\header\block\first_order_block.h
+1711281402 d:\steps\code\steps\header\block\first_order_block.h
"header/block/block.h"
"header/block/proportional_block.h"
@@ -588,7 +588,7 @@
"header/basic/sparse_matrix_define.h"
-1710223800 d:\steps\code\steps\header\toolkit\dynamic_simulator\dynamic_simulator.h
+1711289225 d:\steps\code\steps\header\toolkit\dynamic_simulator\dynamic_simulator.h
"header/basic/power_mismatch_struct.h"
"header/meter/meter.h"
"header/network/network_matrix.h"
@@ -1346,7 +1346,7 @@
"header/block/lead_lag_block.h"
"header/STEPS.h"
-1710077423 d:\steps\code\steps\header\block\lead_lag_block.h
+1711281460 d:\steps\code\steps\header\block\lead_lag_block.h
"header/block/block.h"
"header/block/first_order_block.h"
@@ -1359,7 +1359,7 @@
"header/block/pid_block.h"
"header/STEPS.h"
-1710077423 d:\steps\code\steps\header\block\pid_block.h
+1711285174 d:\steps\code\steps\header\block\pid_block.h
"header/block/block.h"
"header/block/proportional_block.h"
"header/block/integral_block.h"
@@ -1374,7 +1374,7 @@
"header/block/pi_block.h"
"header/STEPS.h"
-1710077423 d:\steps\code\steps\header\block\pi_block.h
+1711281500 d:\steps\code\steps\header\block\pi_block.h
"header/block/block.h"
"header/block/pid_block.h"
@@ -1387,7 +1387,7 @@
"header/block/pd_block.h"
"header/STEPS.h"
-1710077423 d:\steps\code\steps\header\block\pd_block.h
+1711281493 d:\steps\code\steps\header\block\pd_block.h
"header/block/block.h"
"header/block/proportional_block.h"
"header/block/differential_block.h"
@@ -1401,7 +1401,7 @@
"header/block/second_order_block.h"
"header/STEPS.h"
-1710077423 d:\steps\code\steps\header\block\second_order_block.h
+1711285559 d:\steps\code\steps\header\block\second_order_block.h
"header/block/block.h"
"header/block/proportional_block.h"
"header/block/first_order_block.h"
@@ -2663,7 +2663,7 @@
"header/data_imexporter/psse_imexporter.h"
"header/data_imexporter/bpa_imexporter.h"
-1709441688 d:\steps\code\steps\header\apis\steps_api.h
+1711289627 d:\steps\code\steps\header\apis\steps_api.h
"header/basic/constants.h"
"header/basic/dc_device_id.h"
@@ -2694,7 +2694,7 @@
"header/data_imexporter/bpa_imexporter.h"
"header/data_imexporter/steps_imexporter.h"
-1710224232 source:d:\steps\code\steps\source\apis\steps_api_dynamic_simulation.cpp
+1711290049 source:d:\steps\code\steps\source\apis\steps_api_dynamic_simulation.cpp
"header/apis/steps_api.h"
"header/basic/utility.h"
"header/toolkit/cct_searcher/cct_searcher.h"
@@ -3618,19 +3618,19 @@
"header/steps_namespace.h"
-1700585898 source:d:\steps\code\steps\source\block\block.cpp
+1711183893 source:d:\steps\code\steps\source\block\block.cpp
"header/block/block.h"
"header/steps_namespace.h"
"header/basic/utility.h"
-1710744533 source:d:\steps\code\steps\source\block\differential_block.cpp
+1711284659 source:d:\steps\code\steps\source\block\differential_block.cpp
"header/block/differential_block.h"
"header/basic/utility.h"
"header/steps_namespace.h"
-1710077423 source:d:\steps\code\steps\source\block\differential_block_test.cpp
+1711187967 source:d:\steps\code\steps\source\block\differential_block_test.cpp
"header/basic/test_macro.h"
"header/block/differential_block_test.h"
"header/basic/utility.h"
@@ -3640,14 +3640,14 @@
-1710830645 source:d:\steps\code\steps\source\block\first_order_block.cpp
+1711285675 source:d:\steps\code\steps\source\block\first_order_block.cpp
"header/block/first_order_block.h"
"header/basic/utility.h"
"header/steps_namespace.h"
-1710077423 source:d:\steps\code\steps\source\block\first_order_block_test.cpp
+1711187968 source:d:\steps\code\steps\source\block\first_order_block_test.cpp
"header/basic/test_macro.h"
"header/block/first_order_block_test.h"
"header/basic/utility.h"
@@ -3657,14 +3657,14 @@
-1710830645 source:d:\steps\code\steps\source\block\integral_block.cpp
+1711283710 source:d:\steps\code\steps\source\block\integral_block.cpp
"header/block/integral_block.h"
"header/basic/utility.h"
"header/steps_namespace.h"
-1585314815 source:d:\steps\code\steps\source\block\integral_block_test.cpp
+1711187968 source:d:\steps\code\steps\source\block\integral_block_test.cpp
"header/basic/test_macro.h"
"header/block/integral_block_test.h"
"header/basic/utility.h"
@@ -3674,14 +3674,14 @@
-1710744567 source:d:\steps\code\steps\source\block\lead_lag_block.cpp
+1711284955 source:d:\steps\code\steps\source\block\lead_lag_block.cpp
"header/block/lead_lag_block.h"
"header/basic/utility.h"
"header/steps_namespace.h"
-1585314815 source:d:\steps\code\steps\source\block\lead_lag_block_test.cpp
+1711187967 source:d:\steps\code\steps\source\block\lead_lag_block_test.cpp
"header/basic/test_macro.h"
"header/block/lead_lag_block_test.h"
"header/basic/utility.h"
@@ -3691,14 +3691,14 @@
-1710744578 source:d:\steps\code\steps\source\block\pd_block.cpp
+1711285589 source:d:\steps\code\steps\source\block\pd_block.cpp
"header/block/pd_block.h"
"header/basic/utility.h"
"header/steps_namespace.h"
-1585314815 source:d:\steps\code\steps\source\block\pd_block_test.cpp
+1711187968 source:d:\steps\code\steps\source\block\pd_block_test.cpp
"header/basic/test_macro.h"
"header/block/pd_block_test.h"
"header/basic/utility.h"
@@ -3708,14 +3708,14 @@
-1710744587 source:d:\steps\code\steps\source\block\pi_block.cpp
+1711285153 source:d:\steps\code\steps\source\block\pi_block.cpp
"header/block/pi_block.h"
"header/basic/utility.h"
"header/steps_namespace.h"
-1585314815 source:d:\steps\code\steps\source\block\pi_block_test.cpp
+1711187968 source:d:\steps\code\steps\source\block\pi_block_test.cpp
"header/basic/test_macro.h"
"header/block/pi_block_test.h"
"header/basic/utility.h"
@@ -3725,14 +3725,14 @@
-1710744597 source:d:\steps\code\steps\source\block\pid_block.cpp
+1711285610 source:d:\steps\code\steps\source\block\pid_block.cpp
"header/block/pid_block.h"
"header/basic/utility.h"
"header/steps_namespace.h"
-1710077423 source:d:\steps\code\steps\source\block\pid_block_test.cpp
+1711187967 source:d:\steps\code\steps\source\block\pid_block_test.cpp
"header/basic/test_macro.h"
"header/block/pid_block_test.h"
"header/basic/utility.h"
@@ -3748,7 +3748,7 @@
"header/STEPS.h"
-1585314815 source:d:\steps\code\steps\source\block\proportional_block_test.cpp
+1711187967 source:d:\steps\code\steps\source\block\proportional_block_test.cpp
"header/basic/test_macro.h"
"header/block/proportional_block_test.h"
"header/basic/utility.h"
@@ -3775,7 +3775,7 @@
-1710744619 source:d:\steps\code\steps\source\block\second_order_block.cpp
+1711285506 source:d:\steps\code\steps\source\block\second_order_block.cpp
"header/block/second_order_block.h"
"header/basic/utility.h"
"header/steps_namespace.h"
@@ -3973,7 +3973,7 @@
-1634637238 source:d:\steps\code\steps\source\device\bus_test.cpp
+1711184858 source:d:\steps\code\steps\source\device\bus_test.cpp
"cpptest.h"
"header/basic/test_macro.h"
@@ -4039,7 +4039,7 @@
-1710161353 source:d:\steps\code\steps\source\device\energy_storage.cpp
+1711280796 source:d:\steps\code\steps\source\device\energy_storage.cpp
"header/device/energy_storage.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -4060,7 +4060,7 @@
-1709520930 source:d:\steps\code\steps\source\device\equivalent_device.cpp
+1711280827 source:d:\steps\code\steps\source\device\equivalent_device.cpp
"header/device/nonbus_device.h"
"header/basic/utility.h"
"header/model/equivalent_model/equivalent_model.h"
@@ -4102,7 +4102,7 @@
-1710834640 source:d:\steps\code\steps\source\device\generator.cpp
+1711280826 source:d:\steps\code\steps\source\device\generator.cpp
"header/device/generator.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -4248,7 +4248,7 @@
-1710080679 source:d:\steps\code\steps\source\device\load.cpp
+1711280827 source:d:\steps\code\steps\source\device\load.cpp
"header/device/load.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -4287,7 +4287,7 @@
-1710152391 source:d:\steps\code\steps\source\device\pv_unit.cpp
+1711280785 source:d:\steps\code\steps\source\device\pv_unit.cpp
"header/device/pv_unit.h"
"header/basic/utility.h"
"header/steps_namespace.h"
@@ -4350,7 +4350,7 @@
-1710208884 source:d:\steps\code\steps\source\device\vsc_hvdc.cpp
+1711280827 source:d:\steps\code\steps\source\device\vsc_hvdc.cpp
"header/device/vsc_hvdc.h"
"header/basic/utility.h"
"header/basic/steps_define.h"
@@ -4378,7 +4378,7 @@
-1709522663 source:d:\steps\code\steps\source\device\wt_generator.cpp
+1711280779 source:d:\steps\code\steps\source\device\wt_generator.cpp
"header/device/wt_generator.h"
"header/basic/utility.h"
"header/steps_namespace.h"
@@ -4456,7 +4456,7 @@
-1706017945 source:d:\steps\code\steps\source\model\bus_model\bus_frequency_model\bus_frequency_model.cpp
+1711290374 source:d:\steps\code\steps\source\model\bus_model\bus_frequency_model\bus_frequency_model.cpp
"header/model/bus_model/bus_frequency_model/bus_frequency_model.h"
"header/power_system_database.h"
"header/STEPS.h"
@@ -4473,7 +4473,7 @@
"header/basic/constants.h"
-1706780361 source:d:\steps\code\steps\source\model\converter_common_model\pll_model\pll0.cpp
+1711187968 source:d:\steps\code\steps\source\model\converter_common_model\pll_model\pll0.cpp
"header/model/converter_common_models/pll_model/pll0.h"
"header/power_system_database.h"
"header/STEPS.h"
@@ -4594,7 +4594,7 @@
"header/model/energy_storage_model/estr0.h"
"header/STEPS.h"
-1710224976 source:d:\steps\code\steps\source\model\equivalent_model\arxl.cpp
+1711187967 source:d:\steps\code\steps\source\model\equivalent_model\arxl.cpp
"header/model/equivalent_model/ARXL.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -4666,7 +4666,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710076265 source:d:\steps\code\steps\source\model\load_model\cim6.cpp
+1711187967 source:d:\steps\code\steps\source\model\load_model\cim6.cpp
"header/model/load_model/CIM6.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -4679,7 +4679,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710743923 source:d:\steps\code\steps\source\model\load_model\ieel.cpp
+1711187968 source:d:\steps\code\steps\source\model\load_model\ieel.cpp
"header/model/load_model/IEEL.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -4698,7 +4698,7 @@
"header/STEPS.h"
-1634637238 source:d:\steps\code\steps\source\model\load_model\load_model_test.cpp
+1711187967 source:d:\steps\code\steps\source\model\load_model\load_model_test.cpp
"header/basic/test_macro.h"
"header/model/load_model/load_model_test.h"
"header/basic/utility.h"
@@ -4711,7 +4711,7 @@
"header/power_system_database.h"
"header/STEPS.h"
-1664187911 source:d:\steps\code\steps\source\model\load_relay_model\load_frequency_relay_model_test.cpp
+1711187968 source:d:\steps\code\steps\source\model\load_relay_model\load_frequency_relay_model_test.cpp
"header/basic/test_macro.h"
"header/model/load_relay_model/load_frequency_relay_model_test.h"
"header/basic/utility.h"
@@ -4748,7 +4748,7 @@
"header/power_system_database.h"
"header/STEPS.h"
-1664187911 source:d:\steps\code\steps\source\model\load_relay_model\load_voltage_relay_model_test.cpp
+1711187968 source:d:\steps\code\steps\source\model\load_relay_model\load_voltage_relay_model_test.cpp
"header/basic/test_macro.h"
"header/model/load_relay_model/load_voltage_relay_model_test.h"
"header/basic/utility.h"
@@ -4760,7 +4760,7 @@
-1707115471 source:d:\steps\code\steps\source\model\load_relay_model\pufls.cpp
+1711187967 source:d:\steps\code\steps\source\model\load_relay_model\pufls.cpp
"header/model/load_relay_model/PUFLS.h"
"header/basic/utility.h"
"header/steps_namespace.h"
@@ -4779,7 +4779,7 @@
-1707115471 source:d:\steps\code\steps\source\model\load_relay_model\ufls.cpp
+1711184989 source:d:\steps\code\steps\source\model\load_relay_model\ufls.cpp
"header/model/load_relay_model/UFLS.h"
"header/basic/utility.h"
"header/steps_namespace.h"
@@ -4798,7 +4798,7 @@
-1707115471 source:d:\steps\code\steps\source\model\load_relay_model\uvls.cpp
+1711184989 source:d:\steps\code\steps\source\model\load_relay_model\uvls.cpp
"header/model/load_relay_model/UVLS.h"
"header/basic/utility.h"
"header/steps_namespace.h"
@@ -4850,7 +4850,7 @@
-1664187911 source:d:\steps\code\steps\source\model\pvu_models\pv_converter_model\pv_converter_model_test.cpp
+1711187968 source:d:\steps\code\steps\source\model\pvu_models\pv_converter_model\pv_converter_model_test.cpp
"header/basic/test_macro.h"
"header/model/pvu_models/pv_converter_model/pv_converter_model_test.h"
"header/basic/utility.h"
@@ -4862,7 +4862,7 @@
-1664187911 source:d:\steps\code\steps\source\model\pvu_models\pv_converter_model\pvcv0.cpp
+1711187968 source:d:\steps\code\steps\source\model\pvu_models\pv_converter_model\pvcv0.cpp
"header/model/pvu_models/pv_converter_model/pvcv0.h"
"header/basic/utility.h"
"header/steps_namespace.h"
@@ -4891,7 +4891,7 @@
"header/model/pvu_models/pv_converter_model/pvcv0.h"
"header/STEPS.h"
-1664187911 source:d:\steps\code\steps\source\model\pvu_models\pv_converter_model\pvgu1.cpp
+1711187968 source:d:\steps\code\steps\source\model\pvu_models\pv_converter_model\pvgu1.cpp
"header/model/pvu_models/pv_converter_model/pvgu1.h"
"header/basic/utility.h"
"header/steps_namespace.h"
@@ -4918,7 +4918,7 @@
"header/power_system_database.h"
"header/STEPS.h"
-1710155008 source:d:\steps\code\steps\source\model\pvu_models\pv_electrical_model\pv_electrical_model_test.cpp
+1711187967 source:d:\steps\code\steps\source\model\pvu_models\pv_electrical_model\pv_electrical_model_test.cpp
"header/basic/test_macro.h"
"header/model/pvu_models/pv_electrical_model/pv_electrical_model_test.h"
"header/basic/utility.h"
@@ -5077,7 +5077,7 @@
-1710075851 source:d:\steps\code\steps\source\model\sg_models\compensator_model\comp.cpp
+1711187967 source:d:\steps\code\steps\source\model\sg_models\compensator_model\comp.cpp
"header/model/sg_models/compensator_model/COMP.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5099,14 +5099,14 @@
-1630861130 source:d:\steps\code\steps\source\model\sg_models\compensator_model\compensator_model_test.cpp
+1711187968 source:d:\steps\code\steps\source\model\sg_models\compensator_model\compensator_model_test.cpp
"header/basic/test_macro.h"
"header/model/sg_models/compensator_model/compensator_model_test.h"
"header/model/sg_models/sync_generator_model/genrou.h"
"header/basic/utility.h"
"header/steps_namespace.h"
-1710075856 source:d:\steps\code\steps\source\model\sg_models\compensator_model\ieeevc.cpp
+1711187967 source:d:\steps\code\steps\source\model\sg_models\compensator_model\ieeevc.cpp
"header/model/sg_models/compensator_model/IEEEVC.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5130,7 +5130,7 @@
"header/power_system_database.h"
"header/STEPS.h"
-1710075874 source:d:\steps\code\steps\source\model\sg_models\compensator_model\psaspvc.cpp
+1711187968 source:d:\steps\code\steps\source\model\sg_models\compensator_model\psaspvc.cpp
"header/model/sg_models/compensator_model/PSASPVC.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5154,7 +5154,7 @@
"header/power_system_database.h"
"header/STEPS.h"
-1710075916 source:d:\steps\code\steps\source\model\sg_models\exciter_model\cseet1.cpp
+1711187968 source:d:\steps\code\steps\source\model\sg_models\exciter_model\cseet1.cpp
"header/model/sg_models/exciter_model/CSEET1.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5168,7 +5168,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710075972 source:d:\steps\code\steps\source\model\sg_models\exciter_model\cseet2.cpp
+1711187967 source:d:\steps\code\steps\source\model\sg_models\exciter_model\cseet2.cpp
"header/model/sg_models/exciter_model/CSEET2.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5192,7 +5192,7 @@
-1630861153 source:d:\steps\code\steps\source\model\sg_models\exciter_model\exciter_model_test.cpp
+1711187967 source:d:\steps\code\steps\source\model\sg_models\exciter_model\exciter_model_test.cpp
"header/basic/test_macro.h"
"header/model/sg_models/exciter_model/exciter_model_test.h"
"header/basic/utility.h"
@@ -5202,7 +5202,7 @@
"header/model/sg_models/stabilizer_model/IEE2ST.h"
"header/model/sg_models/sync_generator_model/gencls.h"
-1710075884 source:d:\steps\code\steps\source\model\sg_models\exciter_model\ieeet1.cpp
+1711187968 source:d:\steps\code\steps\source\model\sg_models\exciter_model\ieeet1.cpp
"header/model/sg_models/exciter_model/IEEET1.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5216,7 +5216,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710075894 source:d:\steps\code\steps\source\model\sg_models\exciter_model\psaspe1.cpp
+1711187967 source:d:\steps\code\steps\source\model\sg_models\exciter_model\psaspe1.cpp
"header/model/sg_models/exciter_model/PSASPE1.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5224,7 +5224,7 @@
-1710075904 source:d:\steps\code\steps\source\model\sg_models\exciter_model\psaspe13.cpp
+1711187968 source:d:\steps\code\steps\source\model\sg_models\exciter_model\psaspe13.cpp
"header/model/sg_models/exciter_model/PSASPE13.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5238,7 +5238,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710075954 source:d:\steps\code\steps\source\model\sg_models\exciter_model\psaspe14.cpp
+1711187967 source:d:\steps\code\steps\source\model\sg_models\exciter_model\psaspe14.cpp
"header/model/sg_models/exciter_model/PSASPE14.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5267,7 +5267,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710075925 source:d:\steps\code\steps\source\model\sg_models\exciter_model\psaspe2.cpp
+1711187968 source:d:\steps\code\steps\source\model\sg_models\exciter_model\psaspe2.cpp
"header/model/sg_models/exciter_model/PSASPE2.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5281,7 +5281,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710834390 source:d:\steps\code\steps\source\model\sg_models\exciter_model\sexs.cpp
+1711187968 source:d:\steps\code\steps\source\model\sg_models\exciter_model\sexs.cpp
"header/model/sg_models/exciter_model/SEXS.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5314,7 +5314,7 @@
-1710744922 source:d:\steps\code\steps\source\model\sg_models\stabilizer_model\iee2st.cpp
+1711187967 source:d:\steps\code\steps\source\model\sg_models\stabilizer_model\iee2st.cpp
"header/model/sg_models/stabilizer_model/IEE2ST.h"
"header/basic/constants.h"
"header/STEPS.h"
@@ -5328,7 +5328,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710076000 source:d:\steps\code\steps\source\model\sg_models\stabilizer_model\psasps1.cpp
+1711187968 source:d:\steps\code\steps\source\model\sg_models\stabilizer_model\psasps1.cpp
"header/model/sg_models/stabilizer_model/PSASPS1.h"
"header/basic/constants.h"
"header/STEPS.h"
@@ -5343,7 +5343,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710075991 source:d:\steps\code\steps\source\model\sg_models\stabilizer_model\psasps2.cpp
+1711187968 source:d:\steps\code\steps\source\model\sg_models\stabilizer_model\psasps2.cpp
"header/model/sg_models/stabilizer_model/PSASPS2.h"
"header/basic/constants.h"
"header/STEPS.h"
@@ -5357,7 +5357,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710075982 source:d:\steps\code\steps\source\model\sg_models\stabilizer_model\psasps3.cpp
+1711187968 source:d:\steps\code\steps\source\model\sg_models\stabilizer_model\psasps3.cpp
"header/model/sg_models/stabilizer_model/PSASPS3.h"
"header/basic/constants.h"
"header/STEPS.h"
@@ -5371,7 +5371,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710076017 source:d:\steps\code\steps\source\model\sg_models\stabilizer_model\psasps4.cpp
+1711187967 source:d:\steps\code\steps\source\model\sg_models\stabilizer_model\psasps4.cpp
"header/model/sg_models/stabilizer_model/PSASPS4.h"
"header/basic/constants.h"
"header/STEPS.h"
@@ -5386,7 +5386,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710076008 source:d:\steps\code\steps\source\model\sg_models\stabilizer_model\psasps5.cpp
+1711187968 source:d:\steps\code\steps\source\model\sg_models\stabilizer_model\psasps5.cpp
"header/model/sg_models/stabilizer_model/PSASPS5.h"
"header/basic/constants.h"
"header/STEPS.h"
@@ -5394,7 +5394,7 @@
"header/basic/utility.h"
-1710076044 source:d:\steps\code\steps\source\model\sg_models\stabilizer_model\psasps6.cpp
+1711187968 source:d:\steps\code\steps\source\model\sg_models\stabilizer_model\psasps6.cpp
"header/model/sg_models/stabilizer_model/PSASPS6.h"
"header/basic/constants.h"
"header/STEPS.h"
@@ -5409,7 +5409,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710076026 source:d:\steps\code\steps\source\model\sg_models\stabilizer_model\psasps8.cpp
+1711187967 source:d:\steps\code\steps\source\model\sg_models\stabilizer_model\psasps8.cpp
"header/model/sg_models/stabilizer_model/PSASPS8.h"
"header/basic/constants.h"
"header/STEPS.h"
@@ -5436,7 +5436,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710076035 source:d:\steps\code\steps\source\model\sg_models\sync_generator_model\gencls.cpp
+1711187967 source:d:\steps\code\steps\source\model\sg_models\sync_generator_model\gencls.cpp
"header/model/sg_models/sync_generator_model/gencls.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5456,7 +5456,7 @@
-1710076053 source:d:\steps\code\steps\source\model\sg_models\sync_generator_model\genrou.cpp
+1711187967 source:d:\steps\code\steps\source\model\sg_models\sync_generator_model\genrou.cpp
"header/model/sg_models/sync_generator_model/genrou.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5476,7 +5476,7 @@
-1710835232 source:d:\steps\code\steps\source\model\sg_models\sync_generator_model\gensal.cpp
+1711187967 source:d:\steps\code\steps\source\model\sg_models\sync_generator_model\gensal.cpp
"header/model/sg_models/sync_generator_model/gensal.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5503,7 +5503,7 @@
-1634637238 source:d:\steps\code\steps\source\model\sg_models\sync_generator_model\sync_generator_model_test.cpp
+1711187968 source:d:\steps\code\steps\source\model\sg_models\sync_generator_model\sync_generator_model_test.cpp
"header/basic/test_macro.h"
"header/model/sg_models/sync_generator_model/sync_generator_model_test.h"
"header/basic/utility.h"
@@ -5515,14 +5515,14 @@
-1710076071 source:d:\steps\code\steps\source\model\sg_models\turbine_governors\gast2a.cpp
+1711187967 source:d:\steps\code\steps\source\model\sg_models\turbine_governors\gast2a.cpp
"header/model/sg_models/turbine_governor_model/GAST2A.h"
"header/basic/utility.h"
"header/STEPS.h"
-1710076080 source:d:\steps\code\steps\source\model\sg_models\turbine_governors\ieeeg1.cpp
+1711187968 source:d:\steps\code\steps\source\model\sg_models\turbine_governors\ieeeg1.cpp
"header/model/sg_models/turbine_governor_model/IEEEG1.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5535,7 +5535,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710076116 source:d:\steps\code\steps\source\model\sg_models\turbine_governors\ieeeg1sb.cpp
+1711187967 source:d:\steps\code\steps\source\model\sg_models\turbine_governors\ieeeg1sb.cpp
"header/model/sg_models/turbine_governor_model/IEEEG1SB.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5548,7 +5548,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710744912 source:d:\steps\code\steps\source\model\sg_models\turbine_governors\ieeeg2.cpp
+1711187967 source:d:\steps\code\steps\source\model\sg_models\turbine_governors\ieeeg2.cpp
"header/model/sg_models/turbine_governor_model/IEEEG2.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5561,7 +5561,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710076088 source:d:\steps\code\steps\source\model\sg_models\turbine_governors\ieeeg3.cpp
+1711187968 source:d:\steps\code\steps\source\model\sg_models\turbine_governors\ieeeg3.cpp
"header/model/sg_models/turbine_governor_model/IEEEG3.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5574,7 +5574,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710076125 source:d:\steps\code\steps\source\model\sg_models\turbine_governors\ieesgo.cpp
+1711187967 source:d:\steps\code\steps\source\model\sg_models\turbine_governors\ieesgo.cpp
"header/model/sg_models/turbine_governor_model/IEESGO.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5585,7 +5585,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710076098 source:d:\steps\code\steps\source\model\sg_models\turbine_governors\tgov1.cpp
+1711187967 source:d:\steps\code\steps\source\model\sg_models\turbine_governors\tgov1.cpp
"header/model/sg_models/turbine_governor_model/TGOV1.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5604,7 +5604,7 @@
-1630861130 source:d:\steps\code\steps\source\model\sg_models\turbine_governors\turbine_governor_model_test.cpp
+1711187968 source:d:\steps\code\steps\source\model\sg_models\turbine_governors\turbine_governor_model_test.cpp
"header/basic/test_macro.h"
"header/model/sg_models/turbine_governor_model/turbine_governor_model_test.h"
"header/basic/utility.h"
@@ -5612,14 +5612,14 @@
"header/model/sg_models/turbine_governor_model/TGOV1.h"
"header/model/sg_models/sync_generator_model/gencls.h"
-1710076143 source:d:\steps\code\steps\source\model\sg_models\turbine_governors\urcsct.cpp
+1711187968 source:d:\steps\code\steps\source\model\sg_models\turbine_governors\urcsct.cpp
"header/model/sg_models/turbine_governor_model/URCSCT.h"
"header/basic/utility.h"
"header/STEPS.h"
-1710076134 source:d:\steps\code\steps\source\model\sg_models\turbine_load_controller_model\lcfb1.cpp
+1711187968 source:d:\steps\code\steps\source\model\sg_models\turbine_load_controller_model\lcfb1.cpp
"header/model/sg_models/turbine_load_controller_model/lcfb1.h"
"header/basic/constants.h"
"header/STEPS.h"
@@ -5653,19 +5653,19 @@
"header/STEPS.h"
-1709520659 source:d:\steps\code\steps\source\model\vsc_hvdc_model\vsc_hvdc_converter_model\vschvdcc0.cpp
+1711187967 source:d:\steps\code\steps\source\model\vsc_hvdc_model\vsc_hvdc_converter_model\vschvdcc0.cpp
"header/model/vsc_hvdc_model/vsc_hvdc_converter_model/VSCHVDCC0.h"
"header/basic/utility.h"
"header/STEPS.h"
-1709520647 source:d:\steps\code\steps\source\model\vsc_hvdc_model\vsc_hvdc_converter_model\vschvdcc1.cpp
+1711187968 source:d:\steps\code\steps\source\model\vsc_hvdc_model\vsc_hvdc_converter_model\vschvdcc1.cpp
"header/model/vsc_hvdc_model/vsc_hvdc_converter_model/VSCHVDCC1.h"
"header/basic/utility.h"
"header/STEPS.h"
-1709520636 source:d:\steps\code\steps\source\model\vsc_hvdc_model\vsc_hvdc_converter_model\vschvdcc2.cpp
+1711187968 source:d:\steps\code\steps\source\model\vsc_hvdc_model\vsc_hvdc_converter_model\vschvdcc2.cpp
"header/model/vsc_hvdc_model/vsc_hvdc_converter_model/VSCHVDCC2.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5684,7 +5684,7 @@
1710208884 source:d:\steps\code\steps\source\model\vsc_hvdc_model\vsc_hvdc_network_model\vsc_hvdc_network_model.cpp
"header/model/vsc_hvdc_model/vsc_hvdc_network_model/vsc_hvdc_network_model.h"
-1709520624 source:d:\steps\code\steps\source\model\vsc_hvdc_model\vsc_hvdc_network_model\vschvdcp0.cpp
+1711187968 source:d:\steps\code\steps\source\model\vsc_hvdc_model\vsc_hvdc_network_model\vschvdcp0.cpp
"header/model/vsc_hvdc_model/vsc_hvdc_network_model/VSCHVDCP0.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -5797,7 +5797,7 @@
-1709524109 source:d:\steps\code\steps\source\model\wtg_models\wt_electrical_model\wt3e1.cpp
+1711187968 source:d:\steps\code\steps\source\model\wtg_models\wt_electrical_model\wt3e1.cpp
"header/model/wtg_models/wt_electrical_model/wt3e1.h"
"header/device/wt_generator.h"
"header/power_system_database.h"
@@ -5821,7 +5821,7 @@
"header/power_system_database.h"
"header/STEPS.h"
-1664187911 source:d:\steps\code\steps\source\model\wtg_models\wt_electrical_model\wt_electrical_model_test.cpp
+1711187967 source:d:\steps\code\steps\source\model\wtg_models\wt_electrical_model\wt_electrical_model_test.cpp
"header/basic/test_macro.h"
"header/model/wtg_models/wt_electrical_model/wt_electrical_model_test.h"
"header/basic/utility.h"
@@ -5830,7 +5830,7 @@
"header/model/wtg_models/wt_aerodynamic_model/aerd0.h"
"header/model/wtg_models/wt_turbine_model/wt3t0.h"
-1706781613 source:d:\steps\code\steps\source\model\wtg_models\wt_generator_model\wt3g0.cpp
+1711187967 source:d:\steps\code\steps\source\model\wtg_models\wt_generator_model\wt3g0.cpp
"header/model/wtg_models/wt_generator_model/wt3g0.h"
"header/basic/utility.h"
"header/steps_namespace.h"
@@ -5850,7 +5850,7 @@
-1664187911 source:d:\steps\code\steps\source\model\wtg_models\wt_generator_model\wt3g1.cpp
+1711187967 source:d:\steps\code\steps\source\model\wtg_models\wt_generator_model\wt3g1.cpp
"header/model/wtg_models/wt_generator_model/wt3g1.h"
"header/basic/utility.h"
"header/steps_namespace.h"
@@ -5870,7 +5870,7 @@
-1697457172 source:d:\steps\code\steps\source\model\wtg_models\wt_generator_model\wt3g2.cpp
+1711187967 source:d:\steps\code\steps\source\model\wtg_models\wt_generator_model\wt3g2.cpp
"header/model/wtg_models/wt_generator_model/wt3g2.h"
"header/basic/utility.h"
"header/steps_namespace.h"
@@ -5899,7 +5899,7 @@
"header/model/wtg_models/wt_generator_model/wt3g2.h"
"header/STEPS.h"
-1709445050 source:d:\steps\code\steps\source\model\wtg_models\wt_generator_model\wt3gx.cpp
+1711187968 source:d:\steps\code\steps\source\model\wtg_models\wt_generator_model\wt3gx.cpp
"header/model/wtg_models/wt_generator_model/wt3gx.h"
"header/basic/utility.h"
"header/steps_namespace.h"
@@ -5916,7 +5916,7 @@
-1664187911 source:d:\steps\code\steps\source\model\wtg_models\wt_generator_model\wt_generator_model_test.cpp
+1711187968 source:d:\steps\code\steps\source\model\wtg_models\wt_generator_model\wt_generator_model_test.cpp
"header/basic/test_macro.h"
"header/model/wtg_models/wt_generator_model/wt_generator_model_test.h"
"header/basic/utility.h"
@@ -5928,7 +5928,7 @@
-1664187911 source:d:\steps\code\steps\source\model\wtg_models\wt_pitch_model\wt3p0.cpp
+1711187967 source:d:\steps\code\steps\source\model\wtg_models\wt_pitch_model\wt3p0.cpp
"header/model/wtg_models/wt_pitch_model/wt3p0.h"
"header/basic/utility.h"
"header/steps_namespace.h"
@@ -5953,7 +5953,7 @@
"header/STEPS.h"
-1664187911 source:d:\steps\code\steps\source\model\wtg_models\wt_pitch_model\wt_pitch_model_test.cpp
+1711187967 source:d:\steps\code\steps\source\model\wtg_models\wt_pitch_model\wt_pitch_model_test.cpp
"header/basic/test_macro.h"
"header/model/wtg_models/wt_pitch_model/wt_pitch_model_test.h"
"header/basic/utility.h"
@@ -5974,13 +5974,13 @@
"header/STEPS.h"
-1709446649 source:d:\steps\code\steps\source\model\wtg_models\wt_relay_model\wtrly0.cpp
+1711184989 source:d:\steps\code\steps\source\model\wtg_models\wt_relay_model\wtrly0.cpp
"header/model/wtg_models/wt_relay_model/wtrly0.h"
"header/basic/utility.h"
"header/STEPS.h"
-1664187911 source:d:\steps\code\steps\source\model\wtg_models\wt_turbine_model\wt3t0.cpp
+1711187967 source:d:\steps\code\steps\source\model\wtg_models\wt_turbine_model\wt3t0.cpp
"header/model/wtg_models/wt_turbine_model/wt3t0.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -6002,7 +6002,7 @@
"header/basic/utility.h"
-1630861211 source:d:\steps\code\steps\source\model\wtg_models\wt_turbine_model\wt_turbine_model_test.cpp
+1711187968 source:d:\steps\code\steps\source\model\wtg_models\wt_turbine_model\wt_turbine_model_test.cpp
"header/basic/test_macro.h"
"header/model/wtg_models/wt_turbine_model/wt_turbine_model_test.h"
"header/basic/utility.h"
@@ -6023,7 +6023,7 @@
"header/power_system_database.h"
"header/STEPS.h"
-1710152179 source:d:\steps\code\steps\source\model\wtg_models\wt_vrt_model\wtvrt3.cpp
+1711187968 source:d:\steps\code\steps\source\model\wtg_models\wt_vrt_model\wtvrt3.cpp
"header/model/wtg_models/wt_vrt_model/wtvrt3.h"
"header/device/wt_generator.h"
"header/power_system_database.h"
@@ -6297,7 +6297,7 @@
"header/steps_namespace.h"
"header/basic/utility.h"
-1710225258 source:d:\steps\code\steps\source\steps.cpp
+1711183893 source:d:\steps\code\steps\source\steps.cpp
"header/STEPS.h"
"header/basic/utility.h"
"header/steps_namespace.h"
@@ -6380,7 +6380,7 @@
"header/toolkit/contingency_screener/contingency_screener.h"
"header/STEPS.h"
-1710225258 source:d:\steps\code\steps\source\toolkit\dynamic_simulator\dynamic_simulator.cpp
+1711290271 source:d:\steps\code\steps\source\toolkit\dynamic_simulator\dynamic_simulator.cpp
"header/toolkit/dynamic_simulator/dynamic_simulator.h"
"header/basic/constants.h"
"header/basic/utility.h"
@@ -6495,7 +6495,7 @@
"header/data_imexporter/bpa_imexporter.h"
-1709798810 source:d:\steps\code\steps\source\model\wtg_models\wt_electrical_model\wt3e0.cpp
+1711187968 source:d:\steps\code\steps\source\model\wtg_models\wt_electrical_model\wt3e0.cpp
"header/model/wtg_models/wt_electrical_model/wt3e0.h"
"header/device/wt_generator.h"
"header/power_system_database.h"
@@ -6550,7 +6550,7 @@
"header/model/load_relay_model/load_voltage_relay_models.h"
"header/model/load_relay_model/load_frequency_relay_models.h"
-1709800006 source:d:\steps\code\steps\source\model\wtg_models\wt_relay_model\wtvrtrly1.cpp
+1711184989 source:d:\steps\code\steps\source\model\wtg_models\wt_relay_model\wtvrtrly1.cpp
"header/model/wtg_models/wt_relay_model/wtvrtrly1.h"
"header/basic/utility.h"
"header/STEPS.h"
@@ -6656,7 +6656,7 @@
"header/block/pi_block.h"
"header/block/integral_block.h"
-1710156628 source:d:\steps\code\steps\source\model\pvu_models\pv_converter_model\pvcvx.cpp
+1711187968 source:d:\steps\code\steps\source\model\pvu_models\pv_converter_model\pvcvx.cpp
"header/model/pvu_models/pv_converter_model/pvcvx.h"
"header/basic/utility.h"
"header/steps_namespace.h"
@@ -6664,7 +6664,7 @@
-1710156628 source:d:\steps\code\steps\source\model\pvu_models\pv_electrical_model\pvex.cpp
+1711187968 source:d:\steps\code\steps\source\model\pvu_models\pv_electrical_model\pvex.cpp
"header/model/pvu_models/pv_electrical_model/pvex.h"
"header/device/pv_unit.h"
"header/power_system_database.h"
@@ -7036,7 +7036,7 @@
"header/model/lcc_hvdc2t_model/lcc_hvdc2t_model_test.h"
"header/STEPS.h"
-1710729251 source:d:\steps\code\steps\source\device\lcc_hvdc2t.cpp
+1711184859 source:d:\steps\code\steps\source\device\lcc_hvdc2t.cpp
"header/device/lcc_hvdc2t.h"
"header/basic/utility.h"
"header/basic/constants.h"
@@ -7062,7 +7062,7 @@
-1710218985 source:d:\steps\code\steps\source\model\lcc_hvdc2t_model\cdc4t.cpp
+1711187967 source:d:\steps\code\steps\source\model\lcc_hvdc2t_model\cdc4t.cpp
"header/model/lcc_hvdc2t_model/CDC4T.h"
"header/basic/utility.h"
"header/steps_namespace.h"
@@ -7077,7 +7077,7 @@
"header/basic/utility.h"
"header/steps_namespace.h"
-1710218985 source:d:\steps\code\steps\source\model\lcc_hvdc2t_model\cdc6t.cpp
+1711187967 source:d:\steps\code\steps\source\model\lcc_hvdc2t_model\cdc6t.cpp
"header/model/lcc_hvdc2t_model/CDC6T.h"
"header/basic/utility.h"
"header/steps_namespace.h"
@@ -7100,7 +7100,7 @@
-1710218985 source:d:\steps\code\steps\source\model\lcc_hvdc2t_model\lcc_hvdc2t_model_test.cpp
+1711187968 source:d:\steps\code\steps\source\model\lcc_hvdc2t_model\lcc_hvdc2t_model_test.cpp
"header/basic/test_macro.h"
"header/model/lcc_hvdc2t_model/lcc_hvdc2t_model_test.h"
"header/basic/utility.h"
diff --git a/code/steps/header/apis/steps_api.h b/code/steps/header/apis/steps_api.h
index ce837472..b3edee33 100644
--- a/code/steps/header/apis/steps_api.h
+++ b/code/steps/header/apis/steps_api.h
@@ -440,6 +440,8 @@ EXPORT_STEPS_DLL bool api_get_system_angular_stable_flag(unsigned int toolkit_in
EXPORT_STEPS_DLL double api_get_basic_meter_value(const char* meter_name, unsigned int toolkit_index=INDEX_NOT_EXIST);
EXPORT_STEPS_DLL double api_get_user_meter_value(int index, unsigned int toolkit_index=INDEX_NOT_EXIST);
+EXPORT_STEPS_DLL void api_change_dynamic_simulation_time_step(double delt, unsigned int toolkit_index=INDEX_NOT_EXIST);
+
EXPORT_STEPS_DLL void api_set_bus_fault(unsigned int bus, char* fault_type, double fault_G, double fault_B, unsigned int toolkit_index=INDEX_NOT_EXIST);
EXPORT_STEPS_DLL void api_clear_bus_fault(unsigned int bus, char* fault_type, unsigned int toolkit_index=INDEX_NOT_EXIST);
EXPORT_STEPS_DLL void api_trip_bus(unsigned int bus, unsigned int toolkit_index=INDEX_NOT_EXIST);
diff --git a/code/steps/header/basic/steps_enum.h b/code/steps/header/basic/steps_enum.h
index 6c58c89c..ec783a50 100644
--- a/code/steps/header/basic/steps_enum.h
+++ b/code/steps/header/basic/steps_enum.h
@@ -192,10 +192,11 @@ enum LIMITER_TYPE
enum DYNAMIC_MODE
{
- INITIALIZE_MODE = 1,
- INTEGRATE_MODE = 2,
- UPDATE_MODE = 3,
- RELAY_MODE = 4
+ DYNAMIC_INITIALIZE_MODE = 1,
+ DYNAMIC_INTEGRATE_MODE = 2,
+ DYNAMIC_UPDATE_MODE = 3,
+ DYNAMIC_RELAY_MODE = 4,
+ DYNAMIC_UPDATE_TIME_STEP_MODE = 5
};
enum BLOCK_INTEGRATION_TIME_STEP_MODE
@@ -205,6 +206,12 @@ enum BLOCK_INTEGRATION_TIME_STEP_MODE
LARGE_INTEGRATION_TIME_STEP_MODE = 2
};
+enum DYNAMIC_EVENT_TYPE
+{
+ FAULT_OR_OPERATION_EVENT = 0,
+ TIME_STEP_CHANGE_EVENT = 1,
+};
+
enum FAULT_TYPE
{
SINGLE_PHASE_GROUNDED_FAULT = 10,
diff --git a/code/steps/header/block/block.h b/code/steps/header/block/block.h
index 77ba3507..73fbe5b6 100644
--- a/code/steps/header/block/block.h
+++ b/code/steps/header/block/block.h
@@ -46,7 +46,7 @@ class BLOCK
static void enable_automatic_large_time_step_logic();
static void disable_automatic_large_time_step_logic();
- static bool get_automatic_large_time_step_logic();
+ static bool is_automatic_large_time_step_logic_enabled();
void check_limiter() const;
diff --git a/code/steps/header/block/differential_block.h b/code/steps/header/block/differential_block.h
index b18fda32..41e9c871 100644
--- a/code/steps/header/block/differential_block.h
+++ b/code/steps/header/block/differential_block.h
@@ -26,7 +26,6 @@ class DIFFERENTIAL_BLOCK : public BLOCK
STEPS_SPARSE_MATRIX get_linearized_matrix_D() const;
virtual void check();
-
private:
void determine_block_integration_time_step_mode();
void determine_block_integration_time_step();
@@ -46,6 +45,8 @@ class DIFFERENTIAL_BLOCK : public BLOCK
void update_small_time_step_mode();
void update_large_time_step_mode();
+ void update_simulation_time_step();
+
double K, T;
double h;
diff --git a/code/steps/header/block/first_order_block.h b/code/steps/header/block/first_order_block.h
index 54f06f06..96193e6a 100644
--- a/code/steps/header/block/first_order_block.h
+++ b/code/steps/header/block/first_order_block.h
@@ -47,6 +47,8 @@ class FIRST_ORDER_BLOCK : public BLOCK
void update_small_time_step_mode();
void update_large_time_step_mode();
+ void update_simulation_time_step();
+
double K, T;
double h;
diff --git a/code/steps/header/block/integral_block.h b/code/steps/header/block/integral_block.h
index 8de4e355..f008a575 100644
--- a/code/steps/header/block/integral_block.h
+++ b/code/steps/header/block/integral_block.h
@@ -26,6 +26,8 @@ class INTEGRAL_BLOCK : public BLOCK
private:
void integrate();
void update();
+ void update_simulation_time_step();
+
double T;
double one_over_t, h_over_t;
diff --git a/code/steps/header/block/lead_lag_block.h b/code/steps/header/block/lead_lag_block.h
index 8a470626..61034d86 100644
--- a/code/steps/header/block/lead_lag_block.h
+++ b/code/steps/header/block/lead_lag_block.h
@@ -48,6 +48,8 @@ class LEAD_LAG_BLOCK : public BLOCK
void update_small_time_step_mode();
void update_large_time_step_mode();
+ void update_simulation_time_step();
+
double K, T1, T2;
FIRST_ORDER_BLOCK first_order_block;
double h;
diff --git a/code/steps/header/block/pd_block.h b/code/steps/header/block/pd_block.h
index eb44fefe..1d2b07e2 100644
--- a/code/steps/header/block/pd_block.h
+++ b/code/steps/header/block/pd_block.h
@@ -36,6 +36,9 @@ class PD_BLOCK : public BLOCK
private:
void integrate();
void update();
+
+ void update_simulation_time_step();
+
PROPORTIONAL_BLOCK p_block;
DIFFERENTIAL_BLOCK d_block;
};
diff --git a/code/steps/header/block/pi_block.h b/code/steps/header/block/pi_block.h
index 1643d1b0..0dec2198 100644
--- a/code/steps/header/block/pi_block.h
+++ b/code/steps/header/block/pi_block.h
@@ -34,6 +34,9 @@ class PI_BLOCK : public BLOCK
private:
void integrate();
void update();
+
+ void update_simulation_time_step();
+
PID_BLOCK pid_block;
};
#endif // PI_BLOCK_H
diff --git a/code/steps/header/block/pid_block.h b/code/steps/header/block/pid_block.h
index bbec9425..f7bd616b 100644
--- a/code/steps/header/block/pid_block.h
+++ b/code/steps/header/block/pid_block.h
@@ -41,9 +41,12 @@ class PID_BLOCK : public BLOCK
STEPS_SPARSE_MATRIX get_linearized_matrix_D() const;
virtual void check();
+
+ void update_simulation_time_step();
private:
void integrate();
void update();
+
PROPORTIONAL_BLOCK p_block;
INTEGRAL_BLOCK i_block;
DIFFERENTIAL_BLOCK d_block;
diff --git a/code/steps/header/block/second_order_block.h b/code/steps/header/block/second_order_block.h
index 4f8b27e8..bd78a52d 100644
--- a/code/steps/header/block/second_order_block.h
+++ b/code/steps/header/block/second_order_block.h
@@ -37,6 +37,8 @@ class SECOND_ORDER_BLOCK : public BLOCK
private:
void integrate();
void update();
+ void update_simulation_time_step();
+
double a, b, c, d, e;
FIRST_ORDER_BLOCK block1, block2;
diff --git a/code/steps/header/model/bus_model/bus_frequency_model/bus_frequency_model.h b/code/steps/header/model/bus_model/bus_frequency_model/bus_frequency_model.h
index 628e61c0..8e388f7e 100644
--- a/code/steps/header/model/bus_model/bus_frequency_model/bus_frequency_model.h
+++ b/code/steps/header/model/bus_model/bus_frequency_model/bus_frequency_model.h
@@ -19,7 +19,7 @@ class BUS_FREQUENCY_MODEL
void initialize();
void run(DYNAMIC_MODE mode);
- void update_for_applying_event();
+ void update_for_applying_event(DYNAMIC_EVENT_TYPE type);
public:
void set_frequency_deviation_in_pu(double f);
double get_frequency_deviation_in_pu() const;
@@ -31,6 +31,8 @@ class BUS_FREQUENCY_MODEL
DIFFERENTIAL_BLOCK frequency_block;
BUS* bus_ptr;
double fbase_Hz, tbase_s;
+ double frequency_block_output_old;
+ bool is_model_updated;
};
#endif // BUS_FREQUENCY_MODEL_H
diff --git a/code/steps/header/toolkit/dynamic_simulator/dynamic_simulator.h b/code/steps/header/toolkit/dynamic_simulator/dynamic_simulator.h
index 67932d46..95e011cb 100644
--- a/code/steps/header/toolkit/dynamic_simulator/dynamic_simulator.h
+++ b/code/steps/header/toolkit/dynamic_simulator/dynamic_simulator.h
@@ -47,6 +47,8 @@ class DYNAMICS_SIMULATOR
void set_automatic_iteration_accelerator_tune_logic(bool logic);
void set_rotor_angle_stability_surveillance_flag(bool flag);
void set_rotor_angle_stability_threshold_in_deg(double angle_th);
+ void set_time_step_threshold_when_leading_part_of_bus_frequency_model_is_enabled_in_s(double delt);
+ void set_k_for_leading_part_of_bus_frequency_model(double k);
unsigned int get_max_DAE_iteration() const;
unsigned int get_min_DAE_iteration() const;
@@ -60,6 +62,8 @@ class DYNAMICS_SIMULATOR
bool get_automatic_iteration_accelerator_tune_logic() const;
bool get_rotor_angle_stability_surveillance_flag() const;
double get_rotor_angle_stability_threshold_in_deg() const;
+ double get_time_step_threshold_when_leading_part_of_bus_frequency_model_is_enabled_in_s() const;
+ double get_k_for_leading_part_of_bus_frequency_model() const;
void show_dynamic_simulator_configuration() const;
@@ -112,10 +116,10 @@ class DYNAMICS_SIMULATOR
void stop();
void run_to(double time);
void run_a_step();
- void update_with_event();
+ void update_with_event(DYNAMIC_EVENT_TYPE event_type);
void run_all_models(DYNAMIC_MODE mode);
void run_bus_frequency_blocks(DYNAMIC_MODE mode);
- void update_bus_frequency_blocks_when_applying_event();
+ void update_bus_frequency_blocks_when_applying_event(DYNAMIC_EVENT_TYPE type);
void update_equivalent_devices_buffer();
void update_equivalent_devices_output();
bool get_system_angular_stable_flag() const;
@@ -123,9 +127,9 @@ class DYNAMICS_SIMULATOR
void enable_relay_action_flag();
private:
void disable_relay_action_flag();
- bool get_relay_actiion_flag() const;
+ bool is_relay_action_detected() const;
public: // events
- void change_dynamic_simulator_time_step(double newDELT);
+ void change_dynamic_simulator_time_step_in_s(double delt);
void set_bus_fault(unsigned int bus, const complex& fault_shunt);
void clear_bus_fault(unsigned int bus);
@@ -198,7 +202,9 @@ class DYNAMICS_SIMULATOR
void integrate();
void update();
- void update_relay_models();
+ void update_when_time_step_is_change();
+ void update_with_specific_mode(DYNAMIC_MODE mode);
+ void check_relay_events();
double get_system_max_angle_difference_in_deg();
void open_meter_output_files();
@@ -274,6 +280,8 @@ class DYNAMICS_SIMULATOR
double alpha;
bool non_divergent_solution_enabled;
bool automatic_iteration_accelerator_tune_enabled;
+ double time_step_threshold_when_leading_part_of_bus_frequency_model_is_enabled;
+ double k_for_leading_part_of_bus_frequency_model;
double max_current_mismatch_pu, max_power_mismatch_MVA;
unsigned int max_mismatch_bus;
diff --git a/code/steps/source/STEPS.cpp b/code/steps/source/STEPS.cpp
index e34893b5..131422aa 100644
--- a/code/steps/source/STEPS.cpp
+++ b/code/steps/source/STEPS.cpp
@@ -116,7 +116,7 @@ void STEPS::disable_dynamic_blocks_automatic_large_time_step_logic()
bool STEPS::get_dynamic_blocks_automatic_large_time_step_logic()
{
- return BLOCK::get_automatic_large_time_step_logic();
+ return BLOCK::is_automatic_large_time_step_logic_enabled();
}
void STEPS::set_thread_number(unsigned int n)
diff --git a/code/steps/source/apis/steps_api_dynamic_simulation.cpp b/code/steps/source/apis/steps_api_dynamic_simulation.cpp
index 7db2f6a9..4053ebe6 100644
--- a/code/steps/source/apis/steps_api_dynamic_simulation.cpp
+++ b/code/steps/source/apis/steps_api_dynamic_simulation.cpp
@@ -87,6 +87,10 @@ double api_get_dynamic_simulator_float_parameter(char* parameter_name, unsigned
return ds.get_iteration_accelerator();
if(PARAMETER_NAME=="ANGLE STABILITY THRESHOLD IN DEG")
return ds.get_rotor_angle_stability_threshold_in_deg();
+ if(PARAMETER_NAME=="DELT THRESHOLD FOR LEADING PART OF BUS FREQ MODEL IN S")
+ return ds.get_time_step_threshold_when_leading_part_of_bus_frequency_model_is_enabled_in_s();
+ if(PARAMETER_NAME=="K FOR LEADING PART OF BUS FREQ MODEL")
+ return ds.get_k_for_leading_part_of_bus_frequency_model();
char buffer[STEPS_MAX_TEMP_CHAR_BUFFER_SIZE];
@@ -117,6 +121,16 @@ void api_set_dynamic_simulator_float_parameter(char* parameter_name, double valu
ds.set_rotor_angle_stability_threshold_in_deg(value);
return;
}
+ if(PARAMETER_NAME=="DELT THRESHOLD FOR LEADING PART OF BUS FREQ MODEL IN S")
+ {
+ ds.set_time_step_threshold_when_leading_part_of_bus_frequency_model_is_enabled_in_s(value);
+ return;
+ }
+ if(PARAMETER_NAME=="K FOR LEADING PART OF BUS FREQ MODEL")
+ {
+ ds.set_k_for_leading_part_of_bus_frequency_model(value);
+ return;
+ }
char buffer[STEPS_MAX_TEMP_CHAR_BUFFER_SIZE];
snprintf(buffer, STEPS_MAX_TEMP_CHAR_BUFFER_SIZE, "Parameter '%s' is not supported for dynamic simulator with api %s.\n",
PARAMETER_NAME.c_str(), __FUNCTION__);
@@ -497,6 +511,14 @@ double api_get_user_meter_value(int index, unsigned int toolkit_index)
return ds.get_user_meter_value(index);
}
+void api_change_dynamic_simulation_time_step(double delt, unsigned int toolkit_index)
+{
+ STEPS& toolkit = get_toolkit(toolkit_index);
+ DYNAMICS_SIMULATOR& ds = toolkit.get_dynamic_simulator();
+ return ds.change_dynamic_simulator_time_step_in_s(delt);
+
+}
+
void api_set_bus_fault(unsigned int bus, char* fault_type, double fault_G, double fault_B, unsigned int toolkit_index)
{
STEPS& toolkit = get_toolkit(toolkit_index);
diff --git a/code/steps/source/block/block.cpp b/code/steps/source/block/block.cpp
index 2df2378c..126bd3ef 100644
--- a/code/steps/source/block/block.cpp
+++ b/code/steps/source/block/block.cpp
@@ -128,7 +128,7 @@ void BLOCK::disable_automatic_large_time_step_logic()
automatic_large_time_step_logic = false;
}
-bool BLOCK::get_automatic_large_time_step_logic()
+bool BLOCK::is_automatic_large_time_step_logic_enabled()
{
return automatic_large_time_step_logic;
}
diff --git a/code/steps/source/block/differential_block.cpp b/code/steps/source/block/differential_block.cpp
index 73e85458..aabf682e 100644
--- a/code/steps/source/block/differential_block.cpp
+++ b/code/steps/source/block/differential_block.cpp
@@ -72,7 +72,7 @@ void DIFFERENTIAL_BLOCK::determine_block_integration_time_step_mode()
double global_h = toolkit.get_dynamic_simulation_time_step_in_s();
BLOCK_INTEGRATION_TIME_STEP_MODE mode = NORMAL_INTEGRATION_TIME_STEP_MODE;
- bool is_automatic_large_step_logic_enabled = get_automatic_large_time_step_logic();
+ bool is_automatic_large_step_logic_enabled = is_automatic_large_time_step_logic_enabled();
if(is_automatic_large_step_logic_enabled)
{
double t = get_T_in_s();
@@ -156,10 +156,12 @@ void DIFFERENTIAL_BLOCK::run(DYNAMIC_MODE mode)
{
if(get_K()!=0.0)
{
- if(mode==INTEGRATE_MODE)
+ if(mode==DYNAMIC_INTEGRATE_MODE)
integrate();
- if(mode==UPDATE_MODE)
+ if(mode==DYNAMIC_UPDATE_MODE)
update();
+ if(mode==DYNAMIC_UPDATE_TIME_STEP_MODE)
+ update_simulation_time_step();
}
}
@@ -277,6 +279,22 @@ void DIFFERENTIAL_BLOCK::update_large_time_step_mode()
update_normal_time_step_mode();
}
+void DIFFERENTIAL_BLOCK::update_simulation_time_step()
+{
+ determine_block_integration_time_step_mode();
+ determine_block_integration_time_step();
+ determine_block_temp_variables();
+
+ double x = get_input();
+ double y = get_output();
+ double s = k_over_t*x-y;
+ set_state(s);
+ double z = k_over_t*x-(1.0-2.0*t_over_h)*s;
+ set_store(z);
+
+ copy_current_input_to_old_input_in_last_time_step();
+}
+
STEPS_SPARSE_MATRIX DIFFERENTIAL_BLOCK::get_linearized_matrix_variable(char var) const
{
var = toupper(var);
diff --git a/code/steps/source/block/differential_block_test.cpp b/code/steps/source/block/differential_block_test.cpp
index e5f84529..0da96838 100644
--- a/code/steps/source/block/differential_block_test.cpp
+++ b/code/steps/source/block/differential_block_test.cpp
@@ -86,13 +86,13 @@ void DIFFERENTIAL_BLOCK_TEST::test_step_response_without_limiter()
input = input+1.0;
block.set_input(input);
- block.run(UPDATE_MODE);
+ block.run(DYNAMIC_UPDATE_MODE);
y = 1.0*K/T;
TEST_ASSERT(fabs(block.get_output()-y)Small; Small-->Normal; Normal-->Small; Normal-->Normal
+ s = get_state();
+ z = k*x-h_minus_2t*s*one_over_h;
+ }
+ else//Large-->Small; Large-->Normal
+ {
+ double guess_s = get_output();
+ s = guess_s;
+ set_state(s);
+ z = k*x-h_minus_2t*guess_s*one_over_h;
+ }
+ set_store(z);
+ copy_current_input_to_old_input_in_last_time_step();
+ }
+ }
+}
+
STEPS_SPARSE_MATRIX FIRST_ORDER_BLOCK::get_linearized_matrix_variable(char var) const
{
var = toupper(var);
diff --git a/code/steps/source/block/first_order_block_test.cpp b/code/steps/source/block/first_order_block_test.cpp
index 26f0dba1..5a84de92 100644
--- a/code/steps/source/block/first_order_block_test.cpp
+++ b/code/steps/source/block/first_order_block_test.cpp
@@ -88,11 +88,11 @@ void FIRST_ORDER_BLOCK_TEST::test_step_response_without_limiter()
double input = block.get_input();
block.set_input(input+1.0);
- block.run(UPDATE_MODE);
+ block.run(DYNAMIC_UPDATE_MODE);
for(t=h; t<=10.0000001; t +=h)
{
- block.run(INTEGRATE_MODE);
- block.run(UPDATE_MODE);
+ block.run(DYNAMIC_INTEGRATE_MODE);
+ block.run(DYNAMIC_UPDATE_MODE);
y = 10.0+K*(1.0-exp(-t/T));
TEST_ASSERT(fabs(block.get_output()-y)<1e-8);
}
@@ -129,11 +129,11 @@ void FIRST_ORDER_BLOCK_TEST::test_step_response_with_limiter()
double input = block.get_input();
block.set_input(input+1.0);
- block.run(UPDATE_MODE);
+ block.run(DYNAMIC_UPDATE_MODE);
for(t=h; t<=10.0000001; t +=h)
{
- block.run(INTEGRATE_MODE);
- block.run(UPDATE_MODE);
+ block.run(DYNAMIC_INTEGRATE_MODE);
+ block.run(DYNAMIC_UPDATE_MODE);
y = 10.0+K*(1.0-exp(-t/T));
if(y>11.0)
y = 11.0;
@@ -171,11 +171,11 @@ void FIRST_ORDER_BLOCK_TEST::test_step_response_without_limiter_when_T_is_zero()
double input = block.get_input();
block.set_input(input+1.0);
- block.run(UPDATE_MODE);
+ block.run(DYNAMIC_UPDATE_MODE);
for(t=h; t<=10.0000001; t +=h)
{
- block.run(INTEGRATE_MODE);
- block.run(UPDATE_MODE);
+ block.run(DYNAMIC_INTEGRATE_MODE);
+ block.run(DYNAMIC_UPDATE_MODE);
y = 10.0+K*1.0;
TEST_ASSERT(fabs(block.get_output()-y)<1e-8);
}
diff --git a/code/steps/source/block/integral_block.cpp b/code/steps/source/block/integral_block.cpp
index 101a2895..000a3f94 100644
--- a/code/steps/source/block/integral_block.cpp
+++ b/code/steps/source/block/integral_block.cpp
@@ -81,10 +81,12 @@ void INTEGRAL_BLOCK::run(DYNAMIC_MODE mode)
double t = get_T_in_s();
if(fabs(t)>DOUBLE_EPSILON and fabs(t-INFINITE_THRESHOLD)>DOUBLE_EPSILON)
{
- if(mode==INTEGRATE_MODE)
+ if(mode==DYNAMIC_INTEGRATE_MODE)
integrate();
- if(mode==UPDATE_MODE)
+ if(mode==DYNAMIC_UPDATE_MODE)
update();
+ if(mode==DYNAMIC_UPDATE_TIME_STEP_MODE)
+ update_simulation_time_step();
}
}
@@ -212,6 +214,23 @@ void INTEGRAL_BLOCK::update()
}
}
+void INTEGRAL_BLOCK::update_simulation_time_step()
+{
+ double t = get_T_in_s();
+ if(fabs(t)>DOUBLE_EPSILON and fabs(t-INFINITE_THRESHOLD)>DOUBLE_EPSILON)
+ {
+ STEPS& toolkit = get_toolkit();
+ double h = toolkit.get_dynamic_simulation_time_step_in_s();
+ h_over_t = h*one_over_t;
+
+ double x = get_input();
+ double s = get_state();
+ double z = s+0.5*h_over_t*x;
+
+ set_store(z);
+ }
+}
+
STEPS_SPARSE_MATRIX INTEGRAL_BLOCK::get_linearized_matrix_variable(char var) const
{
var = toupper(var);
diff --git a/code/steps/source/block/integral_block_test.cpp b/code/steps/source/block/integral_block_test.cpp
index 29aeb3fb..5d373b96 100644
--- a/code/steps/source/block/integral_block_test.cpp
+++ b/code/steps/source/block/integral_block_test.cpp
@@ -67,16 +67,16 @@ void INTEGRAL_BLOCK_TEST::test_initialize_integrate_update_once()
TEST_ASSERT(block.get_store()==10.0);
block.set_input(0.2);
- block.run(UPDATE_MODE);
+ block.run(DYNAMIC_UPDATE_MODE);
TEST_ASSERT(fabs(block.get_output()-10.0)run(INITIALIZE_MODE);
+ bus_model->run(DYNAMIC_INITIALIZE_MODE);
bus.set_frequency_deviation_in_pu(0.0);
TEST_ASSERT(fabs(bus.get_frequency_deviation_in_pu()-0.0)is_model_active())
conv->initialize();
@@ -217,8 +217,9 @@ void ENERGY_STORAGE::run(DYNAMIC_MODE mode)
break;
}
- case INTEGRATE_MODE:
- case UPDATE_MODE:
+ case DYNAMIC_INTEGRATE_MODE:
+ case DYNAMIC_UPDATE_MODE:
+ case DYNAMIC_UPDATE_TIME_STEP_MODE:
{
if(vrt!=NULL and vrt->is_model_active())
{
@@ -247,7 +248,7 @@ void ENERGY_STORAGE::run(DYNAMIC_MODE mode)
conv->run(mode);
break;
}
- case RELAY_MODE:
+ case DYNAMIC_RELAY_MODE:
{
if(relay!=NULL and relay->is_model_active())
relay->run(mode);
diff --git a/code/steps/source/device/equivalent_device.cpp b/code/steps/source/device/equivalent_device.cpp
index 507a85d3..ad119140 100644
--- a/code/steps/source/device/equivalent_device.cpp
+++ b/code/steps/source/device/equivalent_device.cpp
@@ -455,7 +455,7 @@ void EQUIVALENT_DEVICE::run(DYNAMIC_MODE mode)
{
switch(mode)
{
- case INITIALIZE_MODE:
+ case DYNAMIC_INITIALIZE_MODE:
{
EQUIVALENT_MODEL* model = get_equivalent_model();
if(model!=NULL and model->is_model_active())
@@ -465,8 +465,9 @@ void EQUIVALENT_DEVICE::run(DYNAMIC_MODE mode)
break;
}
- case INTEGRATE_MODE:
- case UPDATE_MODE:
+ case DYNAMIC_INTEGRATE_MODE:
+ case DYNAMIC_UPDATE_MODE:
+ case DYNAMIC_UPDATE_TIME_STEP_MODE:
{
EQUIVALENT_MODEL* model = get_equivalent_model();
if(model!=NULL and model->is_model_active())
diff --git a/code/steps/source/device/generator.cpp b/code/steps/source/device/generator.cpp
index 7afaca72..16daa228 100644
--- a/code/steps/source/device/generator.cpp
+++ b/code/steps/source/device/generator.cpp
@@ -589,7 +589,7 @@ void GENERATOR::run(DYNAMIC_MODE mode)
SYNC_GENERATOR_MODEL* gen = get_sync_generator_model();
switch(mode)
{
- case INITIALIZE_MODE:
+ case DYNAMIC_INITIALIZE_MODE:
{
if(gen!=NULL and gen->is_model_active())
gen->initialize();
@@ -637,8 +637,9 @@ void GENERATOR::run(DYNAMIC_MODE mode)
break;
}
- case INTEGRATE_MODE:
- case UPDATE_MODE:
+ case DYNAMIC_INTEGRATE_MODE:
+ case DYNAMIC_UPDATE_MODE:
+ case DYNAMIC_UPDATE_TIME_STEP_MODE:
{
if(comp!=NULL and comp->is_model_active())
comp->run(mode);
@@ -659,7 +660,7 @@ void GENERATOR::run(DYNAMIC_MODE mode)
gen->run(mode);
break;
}
- case RELAY_MODE:
+ case DYNAMIC_RELAY_MODE:
default:
{
break;
diff --git a/code/steps/source/device/lcc_hvdc2t.cpp b/code/steps/source/device/lcc_hvdc2t.cpp
index ddd46003..ca981ddc 100644
--- a/code/steps/source/device/lcc_hvdc2t.cpp
+++ b/code/steps/source/device/lcc_hvdc2t.cpp
@@ -1122,7 +1122,7 @@ void LCC_HVDC2T::run(DYNAMIC_MODE mode)
{
switch(mode)
{
- case INITIALIZE_MODE:
+ case DYNAMIC_INITIALIZE_MODE:
{
if(toolkit.is_detailed_log_enabled())
{
diff --git a/code/steps/source/device/load.cpp b/code/steps/source/device/load.cpp
index fb97615f..354d0463 100644
--- a/code/steps/source/device/load.cpp
+++ b/code/steps/source/device/load.cpp
@@ -622,7 +622,7 @@ void LOAD::run(DYNAMIC_MODE mode)
LOAD_MODEL* load = get_load_model();
switch(mode)
{
- case INITIALIZE_MODE:
+ case DYNAMIC_INITIALIZE_MODE:
{
set_load_manually_scale_factor_in_pu(0.0);
@@ -638,8 +638,9 @@ void LOAD::run(DYNAMIC_MODE mode)
}
break;
}
- case INTEGRATE_MODE:
- case UPDATE_MODE:
+ case DYNAMIC_INTEGRATE_MODE:
+ case DYNAMIC_UPDATE_MODE:
+ case DYNAMIC_UPDATE_TIME_STEP_MODE:
{
if(uvls!=NULL and uvls->is_model_active())
uvls->run(mode);
@@ -651,7 +652,7 @@ void LOAD::run(DYNAMIC_MODE mode)
load->run(mode);
break;
}
- case RELAY_MODE:
+ case DYNAMIC_RELAY_MODE:
{
if(uvls!=NULL and uvls->is_model_active())
uvls->run(mode);
diff --git a/code/steps/source/device/pv_unit.cpp b/code/steps/source/device/pv_unit.cpp
index d54d235e..be3b086b 100644
--- a/code/steps/source/device/pv_unit.cpp
+++ b/code/steps/source/device/pv_unit.cpp
@@ -103,7 +103,7 @@ void PV_UNIT::run(DYNAMIC_MODE mode)
switch(mode)
{
- case INITIALIZE_MODE:
+ case DYNAMIC_INITIALIZE_MODE:
{
if(conv!=NULL and conv->is_model_active())
conv->initialize();
@@ -131,8 +131,9 @@ void PV_UNIT::run(DYNAMIC_MODE mode)
break;
}
- case INTEGRATE_MODE:
- case UPDATE_MODE:
+ case DYNAMIC_INTEGRATE_MODE:
+ case DYNAMIC_UPDATE_MODE:
+ case DYNAMIC_UPDATE_TIME_STEP_MODE:
{
if(vrt!=NULL and vrt->is_model_active())
{
@@ -165,7 +166,7 @@ void PV_UNIT::run(DYNAMIC_MODE mode)
conv->run(mode);
break;
}
- case RELAY_MODE:
+ case DYNAMIC_RELAY_MODE:
{
if(relay!=NULL and relay->is_model_active())
relay->run(mode);
diff --git a/code/steps/source/device/vsc_hvdc.cpp b/code/steps/source/device/vsc_hvdc.cpp
index f6768c53..9b1f9c39 100644
--- a/code/steps/source/device/vsc_hvdc.cpp
+++ b/code/steps/source/device/vsc_hvdc.cpp
@@ -2380,7 +2380,7 @@ void VSC_HVDC::run(DYNAMIC_MODE mode)
unsigned int i;
switch(mode)
{
- case INITIALIZE_MODE:
+ case DYNAMIC_INITIALIZE_MODE:
{
if(network!=NULL)
network->initialize();
@@ -2391,8 +2391,9 @@ void VSC_HVDC::run(DYNAMIC_MODE mode)
}
break;
}
- case INTEGRATE_MODE:
- case UPDATE_MODE:
+ case DYNAMIC_INTEGRATE_MODE:
+ case DYNAMIC_UPDATE_MODE:
+ case DYNAMIC_UPDATE_TIME_STEP_MODE:
{
if(network!=NULL)
network->run(mode);
@@ -2404,7 +2405,7 @@ void VSC_HVDC::run(DYNAMIC_MODE mode)
}
break;
}
- case RELAY_MODE:
+ case DYNAMIC_RELAY_MODE:
{
break;
}
diff --git a/code/steps/source/device/wt_generator.cpp b/code/steps/source/device/wt_generator.cpp
index f84761c5..2f606fa5 100644
--- a/code/steps/source/device/wt_generator.cpp
+++ b/code/steps/source/device/wt_generator.cpp
@@ -107,7 +107,7 @@ void WT_GENERATOR::run(DYNAMIC_MODE mode)
switch(mode)
{
- case INITIALIZE_MODE:
+ case DYNAMIC_INITIALIZE_MODE:
{
STEPS& toolkit = get_toolkit();
WT_AERODYNAMIC_MODEL* aero = get_wt_aerodynamic_model();
@@ -156,8 +156,9 @@ void WT_GENERATOR::run(DYNAMIC_MODE mode)
break;
}
- case INTEGRATE_MODE:
- case UPDATE_MODE:
+ case DYNAMIC_INTEGRATE_MODE:
+ case DYNAMIC_UPDATE_MODE:
+ case DYNAMIC_UPDATE_TIME_STEP_MODE:
{
if(vrt!=NULL and vrt->is_model_active())
{
@@ -199,7 +200,7 @@ void WT_GENERATOR::run(DYNAMIC_MODE mode)
gen->run(mode);
break;
}
- case RELAY_MODE:
+ case DYNAMIC_RELAY_MODE:
{
if(relay!=NULL and relay->is_model_active())
relay->run(mode);
diff --git a/code/steps/source/model/bus_model/bus_frequency_model/bus_frequency_model.cpp b/code/steps/source/model/bus_model/bus_frequency_model/bus_frequency_model.cpp
index 724693f1..219d6b40 100644
--- a/code/steps/source/model/bus_model/bus_frequency_model/bus_frequency_model.cpp
+++ b/code/steps/source/model/bus_model/bus_frequency_model/bus_frequency_model.cpp
@@ -55,23 +55,46 @@ void BUS_FREQUENCY_MODEL::initialize()
frequency_block.set_input(bus_ptr->get_positive_sequence_angle_in_rad());
frequency_block.initialize();
+
+ frequency_block_output_old = frequency_block.get_output();
+ is_model_updated = true;
}
void BUS_FREQUENCY_MODEL::run(DYNAMIC_MODE mode)
{
- if(mode==INTEGRATE_MODE or mode==UPDATE_MODE)
+ if(mode==DYNAMIC_INTEGRATE_MODE or mode==DYNAMIC_UPDATE_MODE)
{
+ if(mode==DYNAMIC_INTEGRATE_MODE and is_model_updated==true)
+ {
+ // this is the very first time for bus frequency block to be integrated for the next time step.
+ //need to store the previous frequency output temporarily for calculating the frequency when simulation time step is very large.
+ frequency_block_output_old = frequency_block.get_output();
+ is_model_updated = false;
+ }
+ if(mode==DYNAMIC_UPDATE_MODE)
+ is_model_updated = true;
+
frequency_block.set_input(bus_ptr->get_positive_sequence_angle_in_rad());
frequency_block.run(mode);
}
else
{
- if(mode==INITIALIZE_MODE)
- initialize();
+ if(mode==DYNAMIC_UPDATE_TIME_STEP_MODE)
+ {
+ double DELT= toolkit->get_dynamic_simulation_time_step_in_s();
+ frequency_block.set_T_in_s(DELT*4.0);
+ frequency_block.set_input(bus_ptr->get_positive_sequence_angle_in_rad());
+ frequency_block.run(mode);
+ }
+ else
+ {
+ if(mode==DYNAMIC_INITIALIZE_MODE)
+ initialize();
+ }
}
}
-void BUS_FREQUENCY_MODEL::update_for_applying_event()
+void BUS_FREQUENCY_MODEL::update_for_applying_event(DYNAMIC_EVENT_TYPE type)
{
double temp = frequency_block.get_output();
@@ -80,9 +103,23 @@ void BUS_FREQUENCY_MODEL::update_for_applying_event()
double K = frequency_block.get_K();
double T = frequency_block.get_T_in_s();
- frequency_block.set_state_WITH_CAUTION(K/T*input-temp);
- frequency_block.run(UPDATE_MODE);
-
+ switch(type)
+ {
+ case FAULT_OR_OPERATION_EVENT:
+ {
+ frequency_block.set_state_WITH_CAUTION(K/T*input-temp);
+ frequency_block.run(DYNAMIC_UPDATE_MODE);
+ break;
+ }
+ case TIME_STEP_CHANGE_EVENT:
+ {
+ double new_DELT= toolkit->get_dynamic_simulation_time_step_in_s();
+ frequency_block.set_T_in_s(new_DELT*4.0);
+ T = frequency_block.get_T_in_s();
+ frequency_block.set_state_WITH_CAUTION(K/T*input-temp);
+ frequency_block.run(DYNAMIC_UPDATE_TIME_STEP_MODE);
+ }
+ }
//cout<<"before updating bus frequency model of bus "<get_bus_number()<<": output = "<get_bus_number()<<": input="<run(UPDATE_MODE);
- pvc_model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
+ pvc_model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
}
diff --git a/code/steps/source/model/equivalent_model/ARXL.cpp b/code/steps/source/model/equivalent_model/ARXL.cpp
index c1edf646..addbafc5 100644
--- a/code/steps/source/model/equivalent_model/ARXL.cpp
+++ b/code/steps/source/model/equivalent_model/ARXL.cpp
@@ -312,7 +312,7 @@ void ARXL::initialize()
void ARXL::run(DYNAMIC_MODE mode)
{
- if(mode==UPDATE_MODE)
+ if(mode==DYNAMIC_UPDATE_MODE)
{
update_meters_buffer();
set_flag_model_updated_as_true();
diff --git a/code/steps/source/model/lcc_hvdc2t_model/CDC4T.cpp b/code/steps/source/model/lcc_hvdc2t_model/CDC4T.cpp
index ddffb19a..7aeff96b 100644
--- a/code/steps/source/model/lcc_hvdc2t_model/CDC4T.cpp
+++ b/code/steps/source/model/lcc_hvdc2t_model/CDC4T.cpp
@@ -270,7 +270,7 @@ void CDC4T::run(DYNAMIC_MODE mode)
dc_current_sensor.set_input(Idc);
dc_current_sensor.run(mode);
- if(mode == UPDATE_MODE)
+ if(mode == DYNAMIC_UPDATE_MODE)
set_flag_model_updated_as_true();
}
diff --git a/code/steps/source/model/lcc_hvdc2t_model/CDC6T.cpp b/code/steps/source/model/lcc_hvdc2t_model/CDC6T.cpp
index 24e6dcf3..701154c6 100644
--- a/code/steps/source/model/lcc_hvdc2t_model/CDC6T.cpp
+++ b/code/steps/source/model/lcc_hvdc2t_model/CDC6T.cpp
@@ -438,7 +438,7 @@ void CDC6T::run(DYNAMIC_MODE mode)
dc_current_sensor.set_input(Idc);
dc_current_sensor.run(mode);
- if(mode == UPDATE_MODE)
+ if(mode == DYNAMIC_UPDATE_MODE)
set_flag_model_updated_as_true();
}
diff --git a/code/steps/source/model/lcc_hvdc2t_model/lcc_hvdc2t_model_test.cpp b/code/steps/source/model/lcc_hvdc2t_model/lcc_hvdc2t_model_test.cpp
index 8439bcad..b9563292 100644
--- a/code/steps/source/model/lcc_hvdc2t_model/lcc_hvdc2t_model_test.cpp
+++ b/code/steps/source/model/lcc_hvdc2t_model/lcc_hvdc2t_model_test.cpp
@@ -244,13 +244,13 @@ void LCC_HVDC2T_MODEL_TEST::test_rectifier_voltage_ramp_response()
vdcr = model->get_converter_dc_voltage_in_kV(converter);
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(vdcr-model->get_converter_dc_voltage_in_kV(RECTIFIER))>1e-6)
vdcr = model->get_converter_dc_voltage_in_kV(RECTIFIER);
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
@@ -276,13 +276,13 @@ void LCC_HVDC2T_MODEL_TEST::test_rectifier_voltage_ramp_response()
vdcr = model->get_converter_dc_voltage_in_kV(converter);
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(vdcr-model->get_converter_dc_voltage_in_kV(RECTIFIER))>1e-6)
vdcr = model->get_converter_dc_voltage_in_kV(RECTIFIER);
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
@@ -301,13 +301,13 @@ void LCC_HVDC2T_MODEL_TEST::test_rectifier_voltage_ramp_response()
vdcr = model->get_converter_dc_voltage_in_kV(converter);
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(vdcr-model->get_converter_dc_voltage_in_kV(RECTIFIER))>1e-6)
vdcr = model->get_converter_dc_voltage_in_kV(RECTIFIER);
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
@@ -329,13 +329,13 @@ void LCC_HVDC2T_MODEL_TEST::test_rectifier_voltage_ramp_response()
vdcr = model->get_converter_dc_voltage_in_kV(converter);
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(vdcr-model->get_converter_dc_voltage_in_kV(RECTIFIER))>1e-6)
vdcr = model->get_converter_dc_voltage_in_kV(RECTIFIER);
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
@@ -354,13 +354,13 @@ void LCC_HVDC2T_MODEL_TEST::test_rectifier_voltage_ramp_response()
vdcr = model->get_converter_dc_voltage_in_kV(converter);
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(vdcr-model->get_converter_dc_voltage_in_kV(RECTIFIER))>1e-6)
vdcr = model->get_converter_dc_voltage_in_kV(RECTIFIER);
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
@@ -410,13 +410,13 @@ void LCC_HVDC2T_MODEL_TEST::test_inverter_voltage_ramp_response()
vdcr = model->get_converter_dc_voltage_in_kV(converter);
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(vdcr-model->get_converter_dc_voltage_in_kV(RECTIFIER))>1e-6)
vdcr = model->get_converter_dc_voltage_in_kV(RECTIFIER);
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
@@ -442,13 +442,13 @@ void LCC_HVDC2T_MODEL_TEST::test_inverter_voltage_ramp_response()
vdcr = model->get_converter_dc_voltage_in_kV(converter);
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(vdcr-model->get_converter_dc_voltage_in_kV(RECTIFIER))>1e-6)
vdcr = model->get_converter_dc_voltage_in_kV(RECTIFIER);
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
@@ -467,13 +467,13 @@ void LCC_HVDC2T_MODEL_TEST::test_inverter_voltage_ramp_response()
vdcr = model->get_converter_dc_voltage_in_kV(converter);
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(vdcr-model->get_converter_dc_voltage_in_kV(RECTIFIER))>1e-6)
vdcr = model->get_converter_dc_voltage_in_kV(RECTIFIER);
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
@@ -495,13 +495,13 @@ void LCC_HVDC2T_MODEL_TEST::test_inverter_voltage_ramp_response()
vdcr = model->get_converter_dc_voltage_in_kV(converter);
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(vdcr-model->get_converter_dc_voltage_in_kV(RECTIFIER))>1e-6)
vdcr = model->get_converter_dc_voltage_in_kV(RECTIFIER);
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
@@ -520,13 +520,13 @@ void LCC_HVDC2T_MODEL_TEST::test_inverter_voltage_ramp_response()
vdcr = model->get_converter_dc_voltage_in_kV(converter);
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(vdcr-model->get_converter_dc_voltage_in_kV(RECTIFIER))>1e-6)
vdcr = model->get_converter_dc_voltage_in_kV(RECTIFIER);
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
@@ -575,13 +575,13 @@ void LCC_HVDC2T_MODEL_TEST::test_manual_block_and_unblock()
vdcr = model->get_converter_dc_voltage_in_kV(converter);
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(vdcr-model->get_converter_dc_voltage_in_kV(RECTIFIER))>1e-6)
vdcr = model->get_converter_dc_voltage_in_kV(RECTIFIER);
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
@@ -589,7 +589,7 @@ void LCC_HVDC2T_MODEL_TEST::test_manual_block_and_unblock()
//cout<<"now go blocking LCC_HVDC2T manually"<manual_block_2t_lcc_hvdc();
//cout<<"now successfully blocked LCC_HVDC2T manually"<run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
@@ -607,18 +607,18 @@ void LCC_HVDC2T_MODEL_TEST::test_manual_block_and_unblock()
vdcr = model->get_converter_dc_voltage_in_kV(converter);
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(vdcr-model->get_converter_dc_voltage_in_kV(RECTIFIER))>1e-6)
vdcr = model->get_converter_dc_voltage_in_kV(RECTIFIER);
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
model->manual_unblock_2t_lcc_hvdc();
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
@@ -636,13 +636,13 @@ void LCC_HVDC2T_MODEL_TEST::test_manual_block_and_unblock()
vdcr = model->get_converter_dc_voltage_in_kV(converter);
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(vdcr-model->get_converter_dc_voltage_in_kV(RECTIFIER))>1e-6)
vdcr = model->get_converter_dc_voltage_in_kV(RECTIFIER);
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
@@ -690,19 +690,19 @@ void LCC_HVDC2T_MODEL_TEST::test_manual_bypass_and_unbypass()
vdcr = model->get_converter_dc_voltage_in_kV(converter);
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(vdcr-model->get_converter_dc_voltage_in_kV(RECTIFIER))>1e-6)
vdcr = model->get_converter_dc_voltage_in_kV(RECTIFIER);
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
model->manual_bypass_2t_lcc_hvdc();
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
@@ -720,18 +720,18 @@ void LCC_HVDC2T_MODEL_TEST::test_manual_bypass_and_unbypass()
vdcr = model->get_converter_dc_voltage_in_kV(converter);
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(vdcr-model->get_converter_dc_voltage_in_kV(RECTIFIER))>1e-6)
vdcr = model->get_converter_dc_voltage_in_kV(RECTIFIER);
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
model->manual_unbypass_2t_lcc_hvdc();
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
@@ -749,13 +749,13 @@ void LCC_HVDC2T_MODEL_TEST::test_manual_bypass_and_unbypass()
vdcr = model->get_converter_dc_voltage_in_kV(converter);
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(vdcr-model->get_converter_dc_voltage_in_kV(RECTIFIER))>1e-6)
vdcr = model->get_converter_dc_voltage_in_kV(RECTIFIER);
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
diff --git a/code/steps/source/model/load_model/CIM6.cpp b/code/steps/source/model/load_model/CIM6.cpp
index 976bbfb5..7c576046 100644
--- a/code/steps/source/model/load_model/CIM6.cpp
+++ b/code/steps/source/model/load_model/CIM6.cpp
@@ -985,7 +985,7 @@ void CIM6::run(DYNAMIC_MODE mode)
speed_block.set_input(-Pelec/speed - Tload);
speed_block.run(mode);
- if(mode==UPDATE_MODE)
+ if(mode==DYNAMIC_UPDATE_MODE)
set_flag_model_updated_as_true();
}
diff --git a/code/steps/source/model/load_model/IEEL.cpp b/code/steps/source/model/load_model/IEEL.cpp
index 6b52dba0..9d3239b4 100644
--- a/code/steps/source/model/load_model/IEEL.cpp
+++ b/code/steps/source/model/load_model/IEEL.cpp
@@ -363,7 +363,7 @@ void IEEL::initialize_to_start()
void IEEL::run(DYNAMIC_MODE mode)
{
synchronize_bus_voltage_and_frequency();
- if(mode==UPDATE_MODE)
+ if(mode==DYNAMIC_UPDATE_MODE)
set_flag_model_updated_as_true();
}
diff --git a/code/steps/source/model/load_model/load_model_test.cpp b/code/steps/source/model/load_model/load_model_test.cpp
index ab41c129..003bc5af 100644
--- a/code/steps/source/model/load_model/load_model_test.cpp
+++ b/code/steps/source/model/load_model/load_model_test.cpp
@@ -227,13 +227,13 @@ void LOAD_MODEL_TEST::test_run_voltage_ramp_response()
P = model->get_load_power_in_MVA().real();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(P-model->get_load_power_in_MVA().real())>1e-6)
P = model->get_load_power_in_MVA().real();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
@@ -252,13 +252,13 @@ void LOAD_MODEL_TEST::test_run_voltage_ramp_response()
P = model->get_load_power_in_MVA().real();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(P - model->get_load_power_in_MVA().real())>1e-6)
P = model->get_load_power_in_MVA().real();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
@@ -275,13 +275,13 @@ void LOAD_MODEL_TEST::test_run_voltage_ramp_response()
P = model->get_load_power_in_MVA().real();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(P - model->get_load_power_in_MVA().real())>1e-6)
P = model->get_load_power_in_MVA().real();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
@@ -318,13 +318,13 @@ void LOAD_MODEL_TEST::test_run_frequency_ramp_response()
P = model->get_load_power_in_MVA().real();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(P-model->get_load_power_in_MVA().real())>1e-6)
P = model->get_load_power_in_MVA().real();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
@@ -345,13 +345,13 @@ void LOAD_MODEL_TEST::test_run_frequency_ramp_response()
P = model->get_load_power_in_MVA().real();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(P - model->get_load_power_in_MVA().real())>1e-6)
P = model->get_load_power_in_MVA().real();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
@@ -368,13 +368,13 @@ void LOAD_MODEL_TEST::test_run_frequency_ramp_response()
P = model->get_load_power_in_MVA().real();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(P - model->get_load_power_in_MVA().real())>1e-6)
P = model->get_load_power_in_MVA().real();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(TIME);
}
diff --git a/code/steps/source/model/load_relay_model/PUFLS.cpp b/code/steps/source/model/load_relay_model/PUFLS.cpp
index 5042ae1e..91610e17 100644
--- a/code/steps/source/model/load_relay_model/PUFLS.cpp
+++ b/code/steps/source/model/load_relay_model/PUFLS.cpp
@@ -356,7 +356,7 @@ void PUFLS::run(DYNAMIC_MODE mode)
append_new_minimum_frequency();
- if(mode==UPDATE_MODE or mode==INTEGRATE_MODE)
+ if(mode==DYNAMIC_UPDATE_MODE or mode==DYNAMIC_INTEGRATE_MODE)
{
unsigned int N = get_number_of_discrete_stage_to_meet_total_continuous_shed_scale();
@@ -392,9 +392,9 @@ void PUFLS::run(DYNAMIC_MODE mode)
}
}
}
- if(mode==UPDATE_MODE)
+ if(mode==DYNAMIC_UPDATE_MODE)
update_continuous_shed_command();
- if(mode==RELAY_MODE)
+ if(mode==DYNAMIC_RELAY_MODE)
try_to_shed_additional_stage();
}
diff --git a/code/steps/source/model/load_relay_model/UFLS.cpp b/code/steps/source/model/load_relay_model/UFLS.cpp
index f9448a2d..4c3b4933 100644
--- a/code/steps/source/model/load_relay_model/UFLS.cpp
+++ b/code/steps/source/model/load_relay_model/UFLS.cpp
@@ -259,7 +259,7 @@ void UFLS::run(DYNAMIC_MODE mode)
frequency_sensor.set_input(freq);
frequency_sensor.run(mode);
- if(mode==RELAY_MODE)
+ if(mode==DYNAMIC_RELAY_MODE)
{
double f = frequency_sensor.get_output();
diff --git a/code/steps/source/model/load_relay_model/UVLS.cpp b/code/steps/source/model/load_relay_model/UVLS.cpp
index 9e1b0e6e..a4b8e4de 100644
--- a/code/steps/source/model/load_relay_model/UVLS.cpp
+++ b/code/steps/source/model/load_relay_model/UVLS.cpp
@@ -259,7 +259,7 @@ void UVLS::run(DYNAMIC_MODE mode)
voltage_sensor.set_input(volt);
voltage_sensor.run(mode);
- if(mode==RELAY_MODE)
+ if(mode==DYNAMIC_RELAY_MODE)
{
double v = voltage_sensor.get_output();
diff --git a/code/steps/source/model/load_relay_model/load_frequency_relay_model_test.cpp b/code/steps/source/model/load_relay_model/load_frequency_relay_model_test.cpp
index 7483d1de..bdb64a24 100644
--- a/code/steps/source/model/load_relay_model/load_frequency_relay_model_test.cpp
+++ b/code/steps/source/model/load_relay_model/load_frequency_relay_model_test.cpp
@@ -53,7 +53,7 @@ void LOAD_FREQUENCY_RELAY_MODEL_TEST::test_get_bus_frequency()
BUS_FREQUENCY_MODEL* bus_model = busptr->get_bus_frequency_model();
- bus_model->run(INITIALIZE_MODE);
+ bus_model->run(DYNAMIC_INITIALIZE_MODE);
bus_model->set_frequency_deviation_in_pu(0.0);
TEST_ASSERT(fabs(model->get_bus_frequency_in_Hz()-50.0*(1.0-0.0))run(INTEGRATE_MODE);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -157,8 +157,8 @@ void LOAD_FREQUENCY_RELAY_MODEL_TEST::run_model(string outputfile)
freq -= (rate*delt);
freq_model->set_frequency_deviation_in_pu(freq/fbase-1.0);
- model->run(INTEGRATE_MODE);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -174,8 +174,8 @@ void LOAD_FREQUENCY_RELAY_MODEL_TEST::run_model(string outputfile)
freq += (rate*delt);
freq_model->set_frequency_deviation_in_pu(freq/fbase-1.0);
- model->run(INTEGRATE_MODE);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -190,8 +190,8 @@ void LOAD_FREQUENCY_RELAY_MODEL_TEST::run_model(string outputfile)
freq -= (rate*delt);
freq_model->set_frequency_deviation_in_pu(freq/fbase-1.0);
- model->run(INTEGRATE_MODE);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -204,8 +204,8 @@ void LOAD_FREQUENCY_RELAY_MODEL_TEST::run_model(string outputfile)
default_toolkit.set_dynamic_simulation_time_in_s(default_toolkit.get_dynamic_simulation_time_in_s()-delt);
break;
}
- model->run(INTEGRATE_MODE);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -223,8 +223,8 @@ void LOAD_FREQUENCY_RELAY_MODEL_TEST::run_model(string outputfile)
freq_model->set_frequency_deviation_in_pu(freq/fbase-1.0);
break;
}
- model->run(INTEGRATE_MODE);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
diff --git a/code/steps/source/model/load_relay_model/load_voltage_relay_model_test.cpp b/code/steps/source/model/load_relay_model/load_voltage_relay_model_test.cpp
index cf83a95d..b28222c3 100644
--- a/code/steps/source/model/load_relay_model/load_voltage_relay_model_test.cpp
+++ b/code/steps/source/model/load_relay_model/load_voltage_relay_model_test.cpp
@@ -126,8 +126,8 @@ void LOAD_VOLTAGE_RELAY_MODEL_TEST::run_model(string outputfile)
default_toolkit.set_dynamic_simulation_time_in_s(default_toolkit.get_dynamic_simulation_time_in_s()-delt);
break;
}
- model->run(INTEGRATE_MODE);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -147,8 +147,8 @@ void LOAD_VOLTAGE_RELAY_MODEL_TEST::run_model(string outputfile)
volt -= (rate*delt);
busptr->set_positive_sequence_voltage_in_pu(volt);
- model->run(INTEGRATE_MODE);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -164,8 +164,8 @@ void LOAD_VOLTAGE_RELAY_MODEL_TEST::run_model(string outputfile)
volt += (rate*delt);
busptr->set_positive_sequence_voltage_in_pu(volt);
- model->run(INTEGRATE_MODE);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -180,8 +180,8 @@ void LOAD_VOLTAGE_RELAY_MODEL_TEST::run_model(string outputfile)
volt -= (rate*delt);
busptr->set_positive_sequence_voltage_in_pu(volt);
- model->run(INTEGRATE_MODE);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -194,8 +194,8 @@ void LOAD_VOLTAGE_RELAY_MODEL_TEST::run_model(string outputfile)
default_toolkit.set_dynamic_simulation_time_in_s(default_toolkit.get_dynamic_simulation_time_in_s()-delt);
break;
}
- model->run(INTEGRATE_MODE);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -213,8 +213,8 @@ void LOAD_VOLTAGE_RELAY_MODEL_TEST::run_model(string outputfile)
busptr->set_positive_sequence_voltage_in_pu(volt);
break;
}
- model->run(INTEGRATE_MODE);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
diff --git a/code/steps/source/model/pvu_models/pv_converter_model/pv_converter_model_test.cpp b/code/steps/source/model/pvu_models/pv_converter_model/pv_converter_model_test.cpp
index f804a6c2..bacee25e 100644
--- a/code/steps/source/model/pvu_models/pv_converter_model/pv_converter_model_test.cpp
+++ b/code/steps/source/model/pvu_models/pv_converter_model/pv_converter_model_test.cpp
@@ -143,13 +143,13 @@ void PV_CONVERTER_MODEL_TEST::run_a_step()
double pelec = model->get_terminal_active_power_in_MW();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(pelec-model->get_terminal_active_power_in_MW())>1e-6)
pelec = model->get_terminal_active_power_in_MW();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
}
void PV_CONVERTER_MODEL_TEST::export_meter_title()
@@ -225,7 +225,7 @@ void PV_CONVERTER_MODEL_TEST::test_active_current_step_response_of_pv_converter_
double ipcmd = model->get_initial_active_current_command_in_pu_based_on_mbase();
model->set_initial_active_current_command_in_pu_based_on_mbase(ipcmd*0.99);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(time);
@@ -285,7 +285,7 @@ void PV_CONVERTER_MODEL_TEST::test_reactive_current_step_response_of_pv_converte
double iqcmd = model->get_initial_reactive_current_command_in_pu_based_on_mbase();
model->set_initial_reactive_current_command_in_pu_based_on_mbase(iqcmd*0.99);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(time);
@@ -348,7 +348,7 @@ void PV_CONVERTER_MODEL_TEST::test_bus_magnitude_step_response_of_pv_converter_m
double vterm = bus->get_positive_sequence_voltage_in_pu();
bus->set_positive_sequence_voltage_in_pu(vterm*0.99);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(time);
@@ -411,7 +411,7 @@ void PV_CONVERTER_MODEL_TEST::test_bus_angle_step_response_of_pv_converter_model
double angle = bus->get_positive_sequence_angle_in_deg();
bus->set_positive_sequence_angle_in_deg(angle+10.0);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(time);
@@ -472,7 +472,7 @@ void PV_CONVERTER_MODEL_TEST::test_variable_step_simulation_with_active_current_
double ipcmd = model->get_initial_active_current_command_in_pu_based_on_mbase();
model->set_initial_active_current_command_in_pu_based_on_mbase(ipcmd*0.9);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(time);
@@ -492,7 +492,7 @@ void PV_CONVERTER_MODEL_TEST::test_variable_step_simulation_with_active_current_
delt *= 2.0;
default_toolkit.set_dynamic_simulation_time_step_in_s(delt);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(time);
@@ -512,7 +512,7 @@ void PV_CONVERTER_MODEL_TEST::test_variable_step_simulation_with_active_current_
delt *= 2.0;
default_toolkit.set_dynamic_simulation_time_step_in_s(delt);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(time);
diff --git a/code/steps/source/model/pvu_models/pv_converter_model/pvcv0.cpp b/code/steps/source/model/pvu_models/pv_converter_model/pvcv0.cpp
index f0046d6b..127a7213 100644
--- a/code/steps/source/model/pvu_models/pv_converter_model/pvcv0.cpp
+++ b/code/steps/source/model/pvu_models/pv_converter_model/pvcv0.cpp
@@ -458,7 +458,7 @@ void PVCV0::run(DYNAMIC_MODE mode)
}
IP = get_active_current_command_in_pu_based_on_mbase();
- if(mode==UPDATE_MODE)
+ if(mode==DYNAMIC_UPDATE_MODE)
set_flag_model_updated_as_true();
}
diff --git a/code/steps/source/model/pvu_models/pv_converter_model/pvcvx.cpp b/code/steps/source/model/pvu_models/pv_converter_model/pvcvx.cpp
index 885209d2..813ed2f9 100644
--- a/code/steps/source/model/pvu_models/pv_converter_model/pvcvx.cpp
+++ b/code/steps/source/model/pvu_models/pv_converter_model/pvcvx.cpp
@@ -360,7 +360,7 @@ void PVCVX::run(DYNAMIC_MODE mode)
{
set_pll_angle_in_deg(angle_in_deg);
}
- if(mode==UPDATE_MODE)
+ if(mode==DYNAMIC_UPDATE_MODE)
set_flag_model_updated_as_true();
}
diff --git a/code/steps/source/model/pvu_models/pv_converter_model/pvgu1.cpp b/code/steps/source/model/pvu_models/pv_converter_model/pvgu1.cpp
index cf43aa1f..fbb9389d 100644
--- a/code/steps/source/model/pvu_models/pv_converter_model/pvgu1.cpp
+++ b/code/steps/source/model/pvu_models/pv_converter_model/pvgu1.cpp
@@ -332,7 +332,7 @@ void PVGU1::run(DYNAMIC_MODE mode)
reactive_voltage_commander.set_input(EQ);
reactive_voltage_commander.run(mode);
- if(mode==UPDATE_MODE)
+ if(mode==DYNAMIC_UPDATE_MODE)
set_flag_model_updated_as_true();
}
diff --git a/code/steps/source/model/pvu_models/pv_electrical_model/pv_electrical_model_test.cpp b/code/steps/source/model/pvu_models/pv_electrical_model/pv_electrical_model_test.cpp
index 695979f4..3902d227 100644
--- a/code/steps/source/model/pvu_models/pv_electrical_model/pv_electrical_model_test.cpp
+++ b/code/steps/source/model/pvu_models/pv_electrical_model/pv_electrical_model_test.cpp
@@ -227,8 +227,8 @@ void PV_ELECTRICAL_MODEL_TEST::run_to_time(double tend)
unsigned int iter_count = 0;
while(true)
{
- model->run(INTEGRATE_MODE);
- pvc_model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
+ pvc_model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(ip-model->get_active_current_command_in_pu_based_on_mbase())<1e-6 and
fabs(iq-model->get_reactive_current_command_in_pu_based_on_mbase())<1e-6)
break;
@@ -239,8 +239,8 @@ void PV_ELECTRICAL_MODEL_TEST::run_to_time(double tend)
}
//osstream<<"Integration at time "<run(UPDATE_MODE);
- pvc_model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
+ pvc_model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
}
diff --git a/code/steps/source/model/pvu_models/pv_electrical_model/pvex.cpp b/code/steps/source/model/pvu_models/pv_electrical_model/pvex.cpp
index d3cbcc89..b9f5bba7 100644
--- a/code/steps/source/model/pvu_models/pv_electrical_model/pvex.cpp
+++ b/code/steps/source/model/pvu_models/pv_electrical_model/pvex.cpp
@@ -836,7 +836,7 @@ void PVEX::run(DYNAMIC_MODE mode)
frequency_integral_controller.run(mode);
//osstream<<"speed = "<get_wt_aerodynamic_model();
double wmin = aerd->get_min_steady_state_turbine_speed_in_pu();
@@ -955,7 +955,7 @@ void PVEX::run(DYNAMIC_MODE mode)
}
//show_information_with_leading_time_stamp(osstream);
- if(mode == UPDATE_MODE)
+ if(mode == DYNAMIC_UPDATE_MODE)
set_flag_model_updated_as_true();
}
diff --git a/code/steps/source/model/sg_models/compensator_model/COMP.cpp b/code/steps/source/model/sg_models/compensator_model/COMP.cpp
index f4e86be0..785a06d3 100644
--- a/code/steps/source/model/sg_models/compensator_model/COMP.cpp
+++ b/code/steps/source/model/sg_models/compensator_model/COMP.cpp
@@ -118,7 +118,7 @@ void COMP::initialize()
void COMP::run(DYNAMIC_MODE mode)
{
- if(mode==UPDATE_MODE)
+ if(mode==DYNAMIC_UPDATE_MODE)
set_flag_model_updated_as_true();
}
diff --git a/code/steps/source/model/sg_models/compensator_model/IEEEVC.cpp b/code/steps/source/model/sg_models/compensator_model/IEEEVC.cpp
index b5be6ac2..411a0b80 100644
--- a/code/steps/source/model/sg_models/compensator_model/IEEEVC.cpp
+++ b/code/steps/source/model/sg_models/compensator_model/IEEEVC.cpp
@@ -127,7 +127,7 @@ void IEEEVC::initialize()
void IEEEVC::run(DYNAMIC_MODE mode)
{
- if(mode==UPDATE_MODE)
+ if(mode==DYNAMIC_UPDATE_MODE)
set_flag_model_updated_as_true();
}
diff --git a/code/steps/source/model/sg_models/compensator_model/PSASPVC.cpp b/code/steps/source/model/sg_models/compensator_model/PSASPVC.cpp
index 28536631..3e5864ca 100644
--- a/code/steps/source/model/sg_models/compensator_model/PSASPVC.cpp
+++ b/code/steps/source/model/sg_models/compensator_model/PSASPVC.cpp
@@ -124,7 +124,7 @@ void PSASPVC::initialize()
void PSASPVC::run(DYNAMIC_MODE mode)
{
- if(mode==UPDATE_MODE)
+ if(mode==DYNAMIC_UPDATE_MODE)
set_flag_model_updated_as_true();
}
diff --git a/code/steps/source/model/sg_models/compensator_model/compensator_model_test.cpp b/code/steps/source/model/sg_models/compensator_model/compensator_model_test.cpp
index f8c2662e..4b0f77b8 100644
--- a/code/steps/source/model/sg_models/compensator_model/compensator_model_test.cpp
+++ b/code/steps/source/model/sg_models/compensator_model/compensator_model_test.cpp
@@ -109,8 +109,8 @@ void COMPENSATOR_MODEL_TEST::update_models()
{
COMPENSATOR_MODEL* model = get_test_compensator_model();
SYNC_GENERATOR_MODEL* genmodel = get_test_sync_generator_model();
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
}
void COMPENSATOR_MODEL_TEST::run_to_time(double tend)
@@ -131,15 +131,15 @@ void COMPENSATOR_MODEL_TEST::run_to_time(double tend)
ecomp = model->get_compensated_voltage_in_pu();
while(true)
{
- genmodel->run(INTEGRATE_MODE);
- model->run(INTEGRATE_MODE);
+ genmodel->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(ecomp-model->get_compensated_voltage_in_pu())>1e-6)
ecomp = model->get_compensated_voltage_in_pu();
else
break;
}
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
diff --git a/code/steps/source/model/sg_models/exciter_model/CSEET1.cpp b/code/steps/source/model/sg_models/exciter_model/CSEET1.cpp
index fade6796..b2067052 100644
--- a/code/steps/source/model/sg_models/exciter_model/CSEET1.cpp
+++ b/code/steps/source/model/sg_models/exciter_model/CSEET1.cpp
@@ -1129,7 +1129,7 @@ void CSEET1::run(DYNAMIC_MODE mode)
}
//cout<<"Ecomp="<run(INTEGRATE_MODE);
- wtgenmodel->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
+ wtgenmodel->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(ip-model->get_active_current_command_in_pu_based_on_mbase())<1e-6 and
fabs(iq-model->get_reactive_current_command_in_pu_based_on_mbase())<1e-6)
break;
@@ -336,8 +336,8 @@ void WT_ELECTRICAL_MODEL_TEST::run_to_time(double tend)
}
//osstream<<"Integration at time "<run(UPDATE_MODE);
- wtgenmodel->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
+ wtgenmodel->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
}
diff --git a/code/steps/source/model/wtg_models/wt_generator_model/wt3g0.cpp b/code/steps/source/model/wtg_models/wt_generator_model/wt3g0.cpp
index 4a68f92d..9eb876bf 100644
--- a/code/steps/source/model/wtg_models/wt_generator_model/wt3g0.cpp
+++ b/code/steps/source/model/wtg_models/wt_generator_model/wt3g0.cpp
@@ -400,7 +400,7 @@ void WT3G0::run(DYNAMIC_MODE mode)
Pll.run(mode);
- if(mode==UPDATE_MODE)
+ if(mode==DYNAMIC_UPDATE_MODE)
set_flag_model_updated_as_true();
}
diff --git a/code/steps/source/model/wtg_models/wt_generator_model/wt3g1.cpp b/code/steps/source/model/wtg_models/wt_generator_model/wt3g1.cpp
index b92d6edc..85ccf531 100644
--- a/code/steps/source/model/wtg_models/wt_generator_model/wt3g1.cpp
+++ b/code/steps/source/model/wtg_models/wt_generator_model/wt3g1.cpp
@@ -361,7 +361,7 @@ void WT3G1::run(DYNAMIC_MODE mode)
{
set_pll_angle_in_deg(angle_in_deg);
}
- if(mode==UPDATE_MODE)
+ if(mode==DYNAMIC_UPDATE_MODE)
set_flag_model_updated_as_true();
}
diff --git a/code/steps/source/model/wtg_models/wt_generator_model/wt3g2.cpp b/code/steps/source/model/wtg_models/wt_generator_model/wt3g2.cpp
index 784010c3..3ba0391e 100644
--- a/code/steps/source/model/wtg_models/wt_generator_model/wt3g2.cpp
+++ b/code/steps/source/model/wtg_models/wt_generator_model/wt3g2.cpp
@@ -465,7 +465,7 @@ void WT3G2::run(DYNAMIC_MODE mode)
set_pll_angle_in_deg(angle_in_deg);
}
- if(mode==UPDATE_MODE)
+ if(mode==DYNAMIC_UPDATE_MODE)
set_flag_model_updated_as_true();
}
diff --git a/code/steps/source/model/wtg_models/wt_generator_model/wt3gx.cpp b/code/steps/source/model/wtg_models/wt_generator_model/wt3gx.cpp
index 1d89db93..0a981df2 100644
--- a/code/steps/source/model/wtg_models/wt_generator_model/wt3gx.cpp
+++ b/code/steps/source/model/wtg_models/wt_generator_model/wt3gx.cpp
@@ -381,7 +381,7 @@ void WT3GX::run(DYNAMIC_MODE mode)
vsg.run(mode);
- if(mode==UPDATE_MODE)
+ if(mode==DYNAMIC_UPDATE_MODE)
set_flag_model_updated_as_true();
}
diff --git a/code/steps/source/model/wtg_models/wt_generator_model/wt_generator_model_test.cpp b/code/steps/source/model/wtg_models/wt_generator_model/wt_generator_model_test.cpp
index 53982771..aab7e60e 100644
--- a/code/steps/source/model/wtg_models/wt_generator_model/wt_generator_model_test.cpp
+++ b/code/steps/source/model/wtg_models/wt_generator_model/wt_generator_model_test.cpp
@@ -145,13 +145,13 @@ void WT_GENERATOR_MODEL_TEST::run_a_step()
double pelec = model->get_terminal_active_power_in_MW();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(pelec-model->get_terminal_active_power_in_MW())>1e-6)
pelec = model->get_terminal_active_power_in_MW();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
}
void WT_GENERATOR_MODEL_TEST::export_meter_title()
@@ -229,7 +229,7 @@ void WT_GENERATOR_MODEL_TEST::test_active_current_step_response_of_wt_generator_
double ipcmd = model->get_initial_active_current_command_in_pu_based_on_mbase();
model->set_initial_active_current_command_in_pu_based_on_mbase(ipcmd*0.99);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(time);
@@ -289,7 +289,7 @@ void WT_GENERATOR_MODEL_TEST::test_reactive_voltage_step_response_of_wt_generato
double eqcmd = model->get_initial_reactive_voltage_command_in_pu();
model->set_initial_reactive_voltage_command_in_pu(eqcmd*0.99);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(time);
@@ -349,7 +349,7 @@ void WT_GENERATOR_MODEL_TEST::test_reactive_current_step_response_of_wt_generato
double iqcmd = model->get_initial_reactive_current_command_in_pu_based_on_mbase();
model->set_initial_reactive_current_command_in_pu_based_on_mbase(iqcmd*0.99);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(time);
@@ -412,7 +412,7 @@ void WT_GENERATOR_MODEL_TEST::test_bus_magnitude_step_response_of_wt_generator_m
double vterm = bus->get_positive_sequence_voltage_in_pu();
bus->set_positive_sequence_voltage_in_pu(vterm*0.99);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(time);
@@ -475,7 +475,7 @@ void WT_GENERATOR_MODEL_TEST::test_bus_angle_step_response_of_wt_generator_model
double angle = bus->get_positive_sequence_angle_in_deg();
bus->set_positive_sequence_angle_in_deg(angle+10.0);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(time);
@@ -536,7 +536,7 @@ void WT_GENERATOR_MODEL_TEST::test_variable_step_simulation_with_active_current_
double ipcmd = model->get_initial_active_current_command_in_pu_based_on_mbase();
model->set_initial_active_current_command_in_pu_based_on_mbase(ipcmd*0.9);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(time);
@@ -556,7 +556,7 @@ void WT_GENERATOR_MODEL_TEST::test_variable_step_simulation_with_active_current_
delt *= 2.0;
default_toolkit.set_dynamic_simulation_time_step_in_s(delt);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(time);
@@ -576,7 +576,7 @@ void WT_GENERATOR_MODEL_TEST::test_variable_step_simulation_with_active_current_
delt *= 2.0;
default_toolkit.set_dynamic_simulation_time_step_in_s(delt);
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values(time);
diff --git a/code/steps/source/model/wtg_models/wt_pitch_model/wt3p0.cpp b/code/steps/source/model/wtg_models/wt_pitch_model/wt3p0.cpp
index 98885554..e32f8638 100644
--- a/code/steps/source/model/wtg_models/wt_pitch_model/wt3p0.cpp
+++ b/code/steps/source/model/wtg_models/wt_pitch_model/wt3p0.cpp
@@ -414,7 +414,7 @@ void WT3P0::run(DYNAMIC_MODE mode)
pitch_integrator.set_input(rate);
pitch_integrator.run(mode);
- if(mode==UPDATE_MODE)
+ if(mode==DYNAMIC_UPDATE_MODE)
set_flag_model_updated_as_true();
}
diff --git a/code/steps/source/model/wtg_models/wt_pitch_model/wt_pitch_model_test.cpp b/code/steps/source/model/wtg_models/wt_pitch_model/wt_pitch_model_test.cpp
index 93c2ea6c..21186083 100644
--- a/code/steps/source/model/wtg_models/wt_pitch_model/wt_pitch_model_test.cpp
+++ b/code/steps/source/model/wtg_models/wt_pitch_model/wt_pitch_model_test.cpp
@@ -371,10 +371,10 @@ void WT_PITCH_MODEL_TEST::update_models()
WT_AERODYNAMIC_MODEL* aerd = get_test_wt_aerodynamic_model();
WT_TURBINE_MODEL* turbine = get_test_wt_turbine_model();
WT_PITCH_MODEL* model = get_test_wt_pitch_model();
- model->run(UPDATE_MODE);
- turbine->run(UPDATE_MODE);
- aerd->run(UPDATE_MODE);
- genmodel->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
+ turbine->run(DYNAMIC_UPDATE_MODE);
+ aerd->run(DYNAMIC_UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -400,19 +400,19 @@ void WT_PITCH_MODEL_TEST::run_to_time(double tend)
double pitch=0.0;
while(true)
{
- model->run(INTEGRATE_MODE);
- turbine->run(INTEGRATE_MODE);
- aerd->run(INTEGRATE_MODE);
- genmodel->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
+ turbine->run(DYNAMIC_INTEGRATE_MODE);
+ aerd->run(DYNAMIC_INTEGRATE_MODE);
+ genmodel->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(pitch-model->get_pitch_angle_in_deg())<1e-6)
break;
pitch = model->get_pitch_angle_in_deg();
}
- model->run(UPDATE_MODE);
- turbine->run(UPDATE_MODE);
- aerd->run(UPDATE_MODE);
- genmodel->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
+ turbine->run(DYNAMIC_UPDATE_MODE);
+ aerd->run(DYNAMIC_UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
}
diff --git a/code/steps/source/model/wtg_models/wt_relay_model/wt_relay_model_test.cpp b/code/steps/source/model/wtg_models/wt_relay_model/wt_relay_model_test.cpp
index 30c14cf7..24f9df06 100644
--- a/code/steps/source/model/wtg_models/wt_relay_model/wt_relay_model_test.cpp
+++ b/code/steps/source/model/wtg_models/wt_relay_model/wt_relay_model_test.cpp
@@ -262,19 +262,19 @@ void WT_RELAY_MODEL_TEST::run_step_response_of_wt_turbine_model_with_pitch_angle
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
apply_1deg_pitch_angle_increase();
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
while(true)
@@ -289,13 +289,13 @@ void WT_RELAY_MODEL_TEST::run_step_response_of_wt_turbine_model_with_pitch_angle
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -344,19 +344,19 @@ void WT_RELAY_MODEL_TEST::run_step_response_of_wt_turbine_model_with_pitch_angle
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
apply_1deg_pitch_angle_increase();
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
while(true)
@@ -371,13 +371,13 @@ void WT_RELAY_MODEL_TEST::run_step_response_of_wt_turbine_model_with_pitch_angle
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -427,19 +427,19 @@ void WT_RELAY_MODEL_TEST::run_step_response_of_wt_turbine_model_with_pitch_angle
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
apply_1deg_pitch_angle_increase();
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
while(true)
@@ -454,13 +454,13 @@ void WT_RELAY_MODEL_TEST::run_step_response_of_wt_turbine_model_with_pitch_angle
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -516,22 +516,22 @@ void WT_RELAY_MODEL_TEST::run_step_response_of_wt_turbine_model_with_generator_p
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- genmodel->run(INTEGRATE_MODE);
- model->run(INTEGRATE_MODE);
+ genmodel->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
apply_10_percent_power_order_drop();
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
while(true)
@@ -546,15 +546,15 @@ void WT_RELAY_MODEL_TEST::run_step_response_of_wt_turbine_model_with_generator_p
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- genmodel->run(INTEGRATE_MODE);
- model->run(INTEGRATE_MODE);
+ genmodel->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -597,22 +597,22 @@ void WT_RELAY_MODEL_TEST::run_step_response_of_wt_turbine_model_with_generator_p
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- genmodel->run(INTEGRATE_MODE);
- model->run(INTEGRATE_MODE);
+ genmodel->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
apply_10_percent_power_order_drop();
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
while(true)
@@ -627,15 +627,15 @@ void WT_RELAY_MODEL_TEST::run_step_response_of_wt_turbine_model_with_generator_p
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- genmodel->run(INTEGRATE_MODE);
- model->run(INTEGRATE_MODE);
+ genmodel->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -679,22 +679,22 @@ void WT_RELAY_MODEL_TEST::run_step_response_of_wt_turbine_model_with_generator_p
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- genmodel->run(INTEGRATE_MODE);
- model->run(INTEGRATE_MODE);
+ genmodel->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
apply_10_percent_power_order_drop();
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
while(true)
@@ -709,15 +709,15 @@ void WT_RELAY_MODEL_TEST::run_step_response_of_wt_turbine_model_with_generator_p
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- genmodel->run(INTEGRATE_MODE);
- model->run(INTEGRATE_MODE);
+ genmodel->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
diff --git a/code/steps/source/model/wtg_models/wt_relay_model/wtrly0.cpp b/code/steps/source/model/wtg_models/wt_relay_model/wtrly0.cpp
index a2363dae..f349a014 100644
--- a/code/steps/source/model/wtg_models/wt_relay_model/wtrly0.cpp
+++ b/code/steps/source/model/wtg_models/wt_relay_model/wtrly0.cpp
@@ -368,7 +368,7 @@ void WTRLY0::initialize()
void WTRLY0::run(DYNAMIC_MODE mode)
{
- if(mode==RELAY_MODE)
+ if(mode==DYNAMIC_RELAY_MODE)
{
check_wind_speed_relay();
check_rotor_speed_relay();
diff --git a/code/steps/source/model/wtg_models/wt_relay_model/wtvrtrly1.cpp b/code/steps/source/model/wtg_models/wt_relay_model/wtvrtrly1.cpp
index 933a708d..4047c60a 100644
--- a/code/steps/source/model/wtg_models/wt_relay_model/wtvrtrly1.cpp
+++ b/code/steps/source/model/wtg_models/wt_relay_model/wtvrtrly1.cpp
@@ -211,7 +211,7 @@ void WTVRTRLY1::initialize()
void WTVRTRLY1::run(DYNAMIC_MODE mode)
{
- if(mode==RELAY_MODE)
+ if(mode==DYNAMIC_RELAY_MODE)
{
lvrt.check_vrt_relay();
hvrt.check_vrt_relay();
diff --git a/code/steps/source/model/wtg_models/wt_turbine_model/wt3t0.cpp b/code/steps/source/model/wtg_models/wt_turbine_model/wt3t0.cpp
index d1745cb5..92da4a1f 100644
--- a/code/steps/source/model/wtg_models/wt_turbine_model/wt3t0.cpp
+++ b/code/steps/source/model/wtg_models/wt_turbine_model/wt3t0.cpp
@@ -268,7 +268,7 @@ void WT3T0::run(DYNAMIC_MODE mode)
generator_rotor_angle_block.set_input(generator_inertia_block.get_output()+1.0-get_initial_wind_turbine_speed_in_pu_from_wt_areodynamic_model());
generator_rotor_angle_block.run(mode);
- if(mode==UPDATE_MODE)
+ if(mode==DYNAMIC_UPDATE_MODE)
{
set_flag_model_updated_as_true();
/*WT_AERODYNAMIC_MODEL* aerd = wtgen->get_wt_aerodynamic_model();
diff --git a/code/steps/source/model/wtg_models/wt_turbine_model/wt_turbine_model_test.cpp b/code/steps/source/model/wtg_models/wt_turbine_model/wt_turbine_model_test.cpp
index 1760a377..0e253964 100644
--- a/code/steps/source/model/wtg_models/wt_turbine_model/wt_turbine_model_test.cpp
+++ b/code/steps/source/model/wtg_models/wt_turbine_model/wt_turbine_model_test.cpp
@@ -263,19 +263,19 @@ void WT_TURBINE_MODEL_TEST::run_step_response_of_wt_turbine_model_with_pitch_ang
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
apply_1deg_pitch_angle_increase();
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
while(true)
@@ -290,13 +290,13 @@ void WT_TURBINE_MODEL_TEST::run_step_response_of_wt_turbine_model_with_pitch_ang
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -345,19 +345,19 @@ void WT_TURBINE_MODEL_TEST::run_step_response_of_wt_turbine_model_with_pitch_ang
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
apply_1deg_pitch_angle_increase();
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
while(true)
@@ -372,13 +372,13 @@ void WT_TURBINE_MODEL_TEST::run_step_response_of_wt_turbine_model_with_pitch_ang
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -428,19 +428,19 @@ void WT_TURBINE_MODEL_TEST::run_step_response_of_wt_turbine_model_with_pitch_ang
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
apply_1deg_pitch_angle_increase();
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
while(true)
@@ -455,13 +455,13 @@ void WT_TURBINE_MODEL_TEST::run_step_response_of_wt_turbine_model_with_pitch_ang
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- model->run(INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- model->run(UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -517,22 +517,22 @@ void WT_TURBINE_MODEL_TEST::run_step_response_of_wt_turbine_model_with_generator
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- genmodel->run(INTEGRATE_MODE);
- model->run(INTEGRATE_MODE);
+ genmodel->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
apply_10_percent_power_order_drop();
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
while(true)
@@ -547,15 +547,15 @@ void WT_TURBINE_MODEL_TEST::run_step_response_of_wt_turbine_model_with_generator
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- genmodel->run(INTEGRATE_MODE);
- model->run(INTEGRATE_MODE);
+ genmodel->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -598,22 +598,22 @@ void WT_TURBINE_MODEL_TEST::run_step_response_of_wt_turbine_model_with_generator
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- genmodel->run(INTEGRATE_MODE);
- model->run(INTEGRATE_MODE);
+ genmodel->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
apply_10_percent_power_order_drop();
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
while(true)
@@ -628,15 +628,15 @@ void WT_TURBINE_MODEL_TEST::run_step_response_of_wt_turbine_model_with_generator
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- genmodel->run(INTEGRATE_MODE);
- model->run(INTEGRATE_MODE);
+ genmodel->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
@@ -680,22 +680,22 @@ void WT_TURBINE_MODEL_TEST::run_step_response_of_wt_turbine_model_with_generator
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- genmodel->run(INTEGRATE_MODE);
- model->run(INTEGRATE_MODE);
+ genmodel->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
apply_10_percent_power_order_drop();
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
while(true)
@@ -710,15 +710,15 @@ void WT_TURBINE_MODEL_TEST::run_step_response_of_wt_turbine_model_with_generator
generator_speed = model->get_generator_speed_in_pu();
while(true)
{
- genmodel->run(INTEGRATE_MODE);
- model->run(INTEGRATE_MODE);
+ genmodel->run(DYNAMIC_INTEGRATE_MODE);
+ model->run(DYNAMIC_INTEGRATE_MODE);
if(fabs(generator_speed-model->get_generator_speed_in_pu())>1e-6)
generator_speed = model->get_generator_speed_in_pu();
else
break;
}
- genmodel->run(UPDATE_MODE);
- model->run(UPDATE_MODE);
+ genmodel->run(DYNAMIC_UPDATE_MODE);
+ model->run(DYNAMIC_UPDATE_MODE);
export_meter_values();
}
diff --git a/code/steps/source/model/wtg_models/wt_vrt_model/wtvrt3.cpp b/code/steps/source/model/wtg_models/wt_vrt_model/wtvrt3.cpp
index 3f535a10..7334829f 100644
--- a/code/steps/source/model/wtg_models/wt_vrt_model/wtvrt3.cpp
+++ b/code/steps/source/model/wtg_models/wt_vrt_model/wtvrt3.cpp
@@ -956,7 +956,7 @@ void WTVRT3::initialize()
void WTVRT3::run(DYNAMIC_MODE mode)
{
- if(mode == UPDATE_MODE)
+ if(mode == DYNAMIC_UPDATE_MODE)
{
if(hvrt.get_vrt_status() == VRT_NORMAL_STATUS)
lvrt.check_vrt_status();
diff --git a/code/steps/source/toolkit/dynamic_simulator/dynamic_simulator.cpp b/code/steps/source/toolkit/dynamic_simulator/dynamic_simulator.cpp
index 7c1ff7d0..a761858b 100644
--- a/code/steps/source/toolkit/dynamic_simulator/dynamic_simulator.cpp
+++ b/code/steps/source/toolkit/dynamic_simulator/dynamic_simulator.cpp
@@ -68,6 +68,8 @@ void DYNAMICS_SIMULATOR::clear()
set_rotor_angle_stability_threshold_in_deg(360.0);
generators_in_islands.clear();
flag_rotor_angle_stable = true;
+ set_time_step_threshold_when_leading_part_of_bus_frequency_model_is_enabled_in_s(0.1);
+ set_k_for_leading_part_of_bus_frequency_model(3.0);
}
void DYNAMICS_SIMULATOR::set_dynamic_simulation_time_step_in_s(double delt)
@@ -219,6 +221,16 @@ void DYNAMICS_SIMULATOR::set_rotor_angle_stability_threshold_in_deg(double angle
this->rotor_angle_stability_threshold_in_deg = angle_th;
}
+void DYNAMICS_SIMULATOR::set_time_step_threshold_when_leading_part_of_bus_frequency_model_is_enabled_in_s(double delt)
+{
+ time_step_threshold_when_leading_part_of_bus_frequency_model_is_enabled = delt;
+}
+
+void DYNAMICS_SIMULATOR::set_k_for_leading_part_of_bus_frequency_model(double k)
+{
+ k_for_leading_part_of_bus_frequency_model = k;
+}
+
/*void DYNAMICS_SIMULATOR::set_current_simulation_time_in_s(double time)
{
TIME = time;
@@ -289,6 +301,16 @@ double DYNAMICS_SIMULATOR::get_rotor_angle_stability_threshold_in_deg() const
return this->rotor_angle_stability_threshold_in_deg;
}
+double DYNAMICS_SIMULATOR::get_time_step_threshold_when_leading_part_of_bus_frequency_model_is_enabled_in_s() const
+{
+ return time_step_threshold_when_leading_part_of_bus_frequency_model_is_enabled;
+}
+
+double DYNAMICS_SIMULATOR::get_k_for_leading_part_of_bus_frequency_model() const
+{
+ return k_for_leading_part_of_bus_frequency_model;
+}
+
void DYNAMICS_SIMULATOR::show_dynamic_simulator_configuration() const
{
ostringstream osstream;
@@ -305,6 +327,8 @@ void DYNAMICS_SIMULATOR::show_dynamic_simulator_configuration() const
<<"Network solution accelerator: "<(system_clock::now()-clock_start);
time_elapse_in_a_step = tduration.count()*0.001;
@@ -1118,7 +1142,7 @@ void DYNAMICS_SIMULATOR::run_a_step()
save_meter_values();
}
-void DYNAMICS_SIMULATOR::update_with_event()
+void DYNAMICS_SIMULATOR::update_with_event(DYNAMIC_EVENT_TYPE event_type)
{
auto clock_start = system_clock::now();
microseconds_elapse_of_differential_equations_in_a_step = 0;
@@ -1155,8 +1179,17 @@ void DYNAMICS_SIMULATOR::update_with_event()
else
break;
}
- update();
- update_bus_frequency_blocks_when_applying_event();
+ switch(event_type)
+ {
+ case FAULT_OR_OPERATION_EVENT:
+ update();
+ break;
+ case TIME_STEP_CHANGE_EVENT:
+ default:
+ update_when_time_step_is_change();
+ break;
+ }
+ update_bus_frequency_blocks_when_applying_event(event_type);
auto tduration = duration_cast(system_clock::now()-clock_start);
time_elapse_in_a_step = tduration.count()*0.001;
@@ -1169,49 +1202,66 @@ void DYNAMICS_SIMULATOR::update_with_event()
void DYNAMICS_SIMULATOR::integrate()
{
//clock_t start = clock();
- run_all_models(INTEGRATE_MODE);
+ run_all_models(DYNAMIC_INTEGRATE_MODE);
//cout<<" elapsed time for integration: "<1)
- {
- char buffer[STEPS_MAX_TEMP_CHAR_BUFFER_SIZE];
- snprintf(buffer, STEPS_MAX_TEMP_CHAR_BUFFER_SIZE, "Failed to solve network in %u iterations when updating at time %f s.",
- current_max_network_iteration, TIME);
- toolkit->show_information_with_leading_time_stamp(buffer);
+ unsigned int max_update_iter = get_max_update_iteration();
+ unsigned int iter = 0;
+ while(iter1)
+ {
+ char buffer[STEPS_MAX_TEMP_CHAR_BUFFER_SIZE];
+ if(mode==DYNAMIC_UPDATE_MODE)
+ snprintf(buffer, STEPS_MAX_TEMP_CHAR_BUFFER_SIZE, "Failed to solve network in %u iterations when updating at time %f s in DYNAMIC_UPDATE_MODE.",
+ current_max_network_iteration, TIME);
+ else
+ snprintf(buffer, STEPS_MAX_TEMP_CHAR_BUFFER_SIZE, "Failed to solve network in %u iterations when updating at time %f s in DYNAMIC_UPDATE_TIME_STEP_MODE.",
+ current_max_network_iteration, TIME);
+ toolkit->show_information_with_leading_time_stamp(buffer);
+ }
}
}
-void DYNAMICS_SIMULATOR::update_relay_models()
+void DYNAMICS_SIMULATOR::check_relay_events()
{
disable_relay_action_flag();
- run_all_models(RELAY_MODE);
+ run_all_models(DYNAMIC_RELAY_MODE);
- if(get_relay_actiion_flag()==true)
+ if(is_relay_action_detected()==true)
update();
}
@@ -1377,7 +1427,7 @@ void DYNAMICS_SIMULATOR::run_bus_frequency_blocks(DYNAMIC_MODE mode)
microseconds_elapse_of_differential_equations_in_a_step += tdurationx.count();
}
-void DYNAMICS_SIMULATOR::update_bus_frequency_blocks_when_applying_event()
+void DYNAMICS_SIMULATOR::update_bus_frequency_blocks_when_applying_event(DYNAMIC_EVENT_TYPE type)
{
unsigned int n = in_service_buses.size();
@@ -1389,7 +1439,7 @@ void DYNAMICS_SIMULATOR::update_bus_frequency_blocks_when_applying_event()
#endif // ENABLE_OPENMP_FOR_DYNAMIC_SIMULATOR
for(unsigned int i=0; iget_bus_frequency_model())->update_for_applying_event();
+ (in_service_buses[i]->get_bus_frequency_model())->update_for_applying_event(type);
/*BUS* bus = in_service_buses[i];
BUS_FREQUENCY_MODEL* model = bus->get_bus_frequency_model();
model->update_for_applying_event();*/
@@ -1406,7 +1456,7 @@ void DYNAMICS_SIMULATOR::disable_relay_action_flag()
relay_action_flag = false;
}
-bool DYNAMICS_SIMULATOR::get_relay_actiion_flag() const
+bool DYNAMICS_SIMULATOR::is_relay_action_detected() const
{
return relay_action_flag;
}
@@ -1695,7 +1745,7 @@ void DYNAMICS_SIMULATOR::update_vsc_hvdcs_converter_model()
for(unsigned int j=0; j!=m ; ++j)
{
if(models[j]!=NULL)
- models[j]->run(UPDATE_MODE);
+ models[j]->run(DYNAMIC_UPDATE_MODE);
}
}
}
@@ -2541,9 +2591,15 @@ void DYNAMICS_SIMULATOR::build_jacobian()
}
-void DYNAMICS_SIMULATOR::change_dynamic_simulator_time_step(double newDELT)
+void DYNAMICS_SIMULATOR::change_dynamic_simulator_time_step_in_s(double delt)
{
- set_dynamic_simulation_time_step_in_s(newDELT);
+ ostringstream osstream;
+ osstream<<"System dynamic simulation time step is changed from "<show_information_with_leading_time_stamp(osstream);
+
+ set_dynamic_simulation_time_step_in_s(delt);
+
+ update_with_event(TIME_STEP_CHANGE_EVENT);
}
diff --git a/python/stepspy-current/README.md b/python/stepspy-current/README.md
index d59f5e4e..560e3d88 100644
--- a/python/stepspy-current/README.md
+++ b/python/stepspy-current/README.md
@@ -19,9 +19,10 @@ stepspy is a Python module of Simulation Toolkit for Electrical Power Systems (S
stepspy is a Python module of Simulation Toolkit for Electrical Power Systems (STEPS). It provides wrapper of APIs of STEPS in a dynamic library.
-STEPS is a simulation toolkit for powerflow, short circuit and dynamic simulation of large-scale power systems. It provides detailed models of bus, line, transformer, HVDC, VSC-HVDC, generator, wind turbine generator, photovoltaic unit, load, and fixed shunt. For more information about STEPS, see (https://gitee.com/lichgang/steps/ or https://github.com/changgang/steps).
+STEPS is a simulation toolkit for powerflow, short circuit and dynamic simulation of large-scale power systems. It provides detailed models of bus, ac line, transformer, 2 terminal LCC HVDC, VSC-HVDC, generator, wind turbine generator, photovoltaic unit, load, and fixed shunt. For more information about STEPS, see (https://gitee.com/lichgang/steps/ or https://github.com/changgang/steps).
## Release Note
+- 2.2.0. March 24, 2024. Add API change_dynamic_simulation_time_step() for manually changing dynamic simulation time step.
- 2.1.0. Nov. 2, 2023. Add API to check if NAN is detected in powerflow solution: is_nan_detected_in_powerflow_soulution, and get_powerflow_convergence_status
- 2.0.0. Oct. 16, 2023. Major version. Add short circuit analysis functions.
- 1.6.2. Oct. 13, 2023. Add option to select libSTEPS version when calling STEPS().
diff --git a/python/stepspy-current/setup.py b/python/stepspy-current/setup.py
index d1cc9cef..9cfc9d50 100644
--- a/python/stepspy-current/setup.py
+++ b/python/stepspy-current/setup.py
@@ -5,7 +5,7 @@
setuptools.setup(
name="stepspy",
- version="2.1.0",
+ version="2.2.0",
author="Changgang Li",
author_email="lichgang@sdu.edu.cn",
description="Python module of Simulation Toolkit for Electrical Power Systems",
diff --git a/python/stepspy-current/stepspy/__init__.py b/python/stepspy-current/stepspy/__init__.py
index 0c48ba93..31e8e507 100644
--- a/python/stepspy-current/stepspy/__init__.py
+++ b/python/stepspy-current/stepspy/__init__.py
@@ -4,8 +4,8 @@
"""
__all__ = ['help']
__author__ = "Changgang Li "
-__date__ = "Oct 20, 2020"
-__version__ = "1.5.3"
+__date__ = "March 24, 2024"
+__version__ = "2.2.0"
from .stepspy import STEPS
from .pouch import POUCH, POUCH_CSV, POUCH_STEPS
diff --git a/python/stepspy-current/stepspy/libsteps/pylibsteps.py b/python/stepspy-current/stepspy/libsteps/pylibsteps.py
index 1896942a..9d122a25 100644
--- a/python/stepspy-current/stepspy/libsteps/pylibsteps.py
+++ b/python/stepspy-current/stepspy/libsteps/pylibsteps.py
@@ -798,6 +798,9 @@ def load_library(libsteps_file):
libsteps.api_get_basic_meter_value.restype = c_double
libsteps.api_get_basic_meter_value.argtypes = (c_char_p, c_uint)
+ libsteps.api_change_dynamic_simulation_time_step.restype = None
+ libsteps.api_change_dynamic_simulation_time_step.argtypes = (c_double, c_uint)
+
libsteps.api_set_bus_fault.restype = None
libsteps.api_set_bus_fault.argtypes = (c_uint, c_char_p, c_double, c_double, c_uint)
libsteps.api_clear_bus_fault.restype = None
diff --git a/python/stepspy-current/stepspy/stepspy.py b/python/stepspy-current/stepspy/stepspy.py
index fae10cba..2d9ec4f1 100644
--- a/python/stepspy-current/stepspy/stepspy.py
+++ b/python/stepspy-current/stepspy/stepspy.py
@@ -4279,7 +4279,7 @@ def set_short_circuit_bus_fault(self, bus, fault_type, fault_shunt):
Example:
bus = 1
shunt = (0.0, -2e4)
- simulator.set_bus_fault(bus, "three phase fault", shunt)
+ simulator.set_short_circuit_bus_fault(bus, "three phase fault", shunt)
"""
global STEPS_LIB
fault_type = self.__get_c_char_p_of_string(fault_type)
@@ -5847,6 +5847,20 @@ def get_basic_meter_value(self, meter_name):
global STEPS_LIB
return STEPS_LIB.api_get_basic_meter_value(meter_name, self.toolkit_index)
+ def change_dynamic_simulation_time_step(self, delt):
+ """
+ Change dynamic simulation time step.
+ Args:
+ (1) delt: new time step in seconds.
+ Rets: N/A
+ Tips: N/A
+ Example:
+ simulator.change_dynamic_simulation_time_step(0.01)
+ """
+ global STEPS_LIB
+ STEPS_LIB.api_change_dynamic_simulation_time_step(delt, self.toolkit_index)
+ return
+
def set_bus_fault(self, bus, fault_type, fault_shunt):
"""
Set bus fault.