-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add vsg_model and vsgcontrol model. not tested. need to rename VSG0 a…
…nd VSG1 model for VSCHVDC
Showing
8 changed files
with
798 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#ifndef VSG_MODEL_H | ||
#define VSG_MODEL_H | ||
|
||
#include "header/model/model.h" | ||
#include "header/device/bus.h" | ||
#include <complex> | ||
|
||
class SOURCE; | ||
class WT_GENERATOR; | ||
class PV_UNIT; | ||
class ENERGY_STORAGE; | ||
|
||
class VSG_MODEL : public MODEL | ||
{ | ||
/* | ||
input: device active, reactive power and terminal voltage | ||
output: voltage magnitude and angle of internal voltage source | ||
*/ | ||
public: | ||
VSG_MODEL(STEPS& toolkit); | ||
virtual ~VSG_MODEL(); | ||
virtual string get_model_type() const; | ||
|
||
SOURCE* get_source_pointer() const; | ||
WT_GENERATOR* get_wt_generator_pointer() const; | ||
PV_UNIT* get_pv_unit_pointer() const; | ||
ENERGY_STORAGE* get_enerage_storage_pointer() const; | ||
|
||
double get_mbase_in_MVA() const; | ||
double get_one_over_mbase_in_one_over_MVA() const; | ||
|
||
complex<double> get_terminal_complex_power_in_pu_based_on_mbase() const; | ||
double get_terminal_voltage_in_pu() const; | ||
complex<double> get_terminal_complex_voltage_in_pu() const; | ||
double get_terminal_voltage_angle_in_rad() const; | ||
double get_bus_base_frequency_in_Hz() const; | ||
double get_bus_base_angle_speed_in_radps() const; | ||
complex<double> get_source_impedance_in_pu_based_on_mbase() const; | ||
|
||
void set_Pref_in_pu_based_on_mbase(double P); | ||
void set_Qref_in_pu_based_on_mbase(double Q); | ||
void set_Vref_in_pu(double V); | ||
|
||
double get_Pref_in_pu_based_on_mbase() const; | ||
double get_Qref_in_pu_based_on_mbase() const; | ||
double get_Vref_in_pu() const; | ||
|
||
double get_virtual_speed_in_pu() const; | ||
public: // specific model level | ||
virtual double get_virtual_speed_deviation_in_pu() const = 0; | ||
virtual double get_virtual_angle_in_rad() const = 0; | ||
virtual double get_virtual_voltage_in_pu() const = 0; | ||
|
||
virtual string get_model_name() const = 0; | ||
|
||
virtual bool setup_model_with_steps_string_vector(vector<string>& data) = 0; | ||
virtual bool setup_model_with_psse_string(string data) = 0; | ||
virtual bool setup_model_with_bpa_string(string data) = 0; | ||
|
||
virtual void setup_block_toolkit_and_parameters() = 0; | ||
|
||
virtual void initialize() = 0; | ||
virtual void run(DYNAMIC_MODE mode) = 0; | ||
|
||
virtual void check() = 0; | ||
virtual void clear() = 0; | ||
virtual void report() = 0; | ||
virtual void save() = 0; | ||
virtual string get_standard_psse_string(bool export_internal_bus_number=false) const = 0; | ||
|
||
virtual void prepare_model_data_table() = 0; | ||
virtual double get_model_data_with_name(string par_name) const = 0; | ||
virtual void set_model_data_with_name(string par_name, double value) = 0; | ||
virtual double get_minimum_nonzero_time_constant_in_s() = 0; | ||
|
||
virtual void prepare_model_internal_variable_table() = 0; | ||
virtual double get_model_internal_variable_with_name(string var_name)= 0; | ||
|
||
virtual string get_dynamic_data_in_psse_format() const = 0; | ||
virtual string get_dynamic_data_in_bpa_format() const = 0; | ||
virtual string get_dynamic_data_in_steps_format() const = 0; | ||
private: | ||
double Pref, Qref, Vref; | ||
}; | ||
#endif // VSG_MODEL_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#ifndef VSG0_H | ||
#define VSG0_H | ||
|
||
#include "header/model/vsg_model/vsg_model.h" | ||
#include "header/block/integral_block.h" | ||
#include <complex> | ||
|
||
class VSGCONTROL0 : public VSG_MODEL | ||
{ | ||
public: | ||
VSGCONTROL0(STEPS& toolkit); | ||
VSGCONTROL0(const VSGCONTROL0& model); | ||
virtual ~VSGCONTROL0(); | ||
virtual VSGCONTROL0& operator=(const VSGCONTROL0& model); | ||
|
||
void set_Tj_in_s(double Tj); | ||
void set_D(double D); | ||
void set_Ku(double Ku); | ||
void set_Te_in_s(double Ke); | ||
|
||
double get_Tj_in_s() const; | ||
double get_D() const; | ||
double get_Ku() const; | ||
double get_Te_in_s() const; | ||
|
||
public: // specific model level | ||
virtual string get_model_name() const; | ||
|
||
virtual bool setup_model_with_steps_string_vector(vector<string>& data); | ||
virtual bool setup_model_with_psse_string(string data); | ||
virtual bool setup_model_with_bpa_string(string data); | ||
|
||
virtual void setup_block_toolkit_and_parameters(); | ||
|
||
virtual void initialize(); | ||
virtual void run(DYNAMIC_MODE mode); | ||
|
||
virtual void check(); | ||
virtual void clear(); | ||
virtual void report(); | ||
virtual void save(); | ||
virtual string get_standard_psse_string(bool export_internal_bus_number=false) const; | ||
|
||
virtual void prepare_model_data_table(); | ||
virtual double get_model_data_with_name(string par_name) const; | ||
virtual void set_model_data_with_name(string par_name, double value); | ||
virtual double get_minimum_nonzero_time_constant_in_s(); | ||
|
||
virtual void prepare_model_internal_variable_table(); | ||
virtual double get_model_internal_variable_with_name(string var_name); | ||
|
||
virtual string get_dynamic_data_in_psse_format() const; | ||
virtual string get_dynamic_data_in_bpa_format() const; | ||
virtual string get_dynamic_data_in_steps_format() const; | ||
|
||
virtual double get_virtual_speed_deviation_in_pu() const; | ||
virtual double get_virtual_angle_in_rad() const; | ||
virtual double get_virtual_voltage_in_pu() const; | ||
private: | ||
void copy_from_const_model(const VSGCONTROL0& model); | ||
private: | ||
double D, Ku; | ||
INTEGRAL_BLOCK virtual_speed_deviation_block, virtual_angle_block, virtual_voltage_block; | ||
|
||
}; | ||
#endif // VSG0_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.