/// IEEE 421.5-2005 type AC3A model. The model represents the field-controlled alternator-rectifier excitation systems designated type AC3A. These excitation systems include an alternator main exciter with non-controlled rectifiers. The exciter employs self-excitation, and the voltage regulator power is derived from the exciter output voltage. Therefore, this system has an additional nonlinearity, simulated by the use of a multiplier whose inputs are the voltage regulator command signal, Va, and the exciter output voltage, Efd, times KR. This model is applicable to excitation systems employing static voltage regulators. Reference: IEEE 421.5-2005, 6.3.
#[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize)]
pub struct ExcIEEEAC3A {
#[serde(flatten)]
pub base: super::ExcitationSystemDynamics,
/// Value of Efd at which feedback gain changes (EFDN) (> 0). Typical value = 2,36.
#[serde(skip_serializing_if = "Option::is_none")]
pub efdn: Option<f64>,
/// Voltage regulator gain (KA) (> 0). Typical value = 45,62.
#[serde(skip_serializing_if = "Option::is_none")]
pub ka: Option<f64>,
/// Rectifier loading factor proportional to commutating reactance (KC) (>= 0). Typical value = 0,104.
#[serde(skip_serializing_if = "Option::is_none")]
pub kc: Option<f64>,
/// Demagnetizing factor, a function of exciter alternator reactances (KD) (>= 0). Typical value = 0,499.
#[serde(skip_serializing_if = "Option::is_none")]
pub kd: Option<f64>,
/// Exciter constant related to self-excited field (KE). Typical value = 1.
#[serde(skip_serializing_if = "Option::is_none")]
pub ke: Option<f64>,
/// Excitation control system stabilizer gains (KF) (>= 0). Typical value = 0,143.
#[serde(skip_serializing_if = "Option::is_none")]
pub kf: Option<f64>,
/// Excitation control system stabilizer gain (KN) (>= 0). Typical value = 0,05.
#[serde(skip_serializing_if = "Option::is_none")]
pub kn: Option<f64>,
/// Constant associated with regulator and alternator field power supply (KR) (> 0). Typical value = 3,77.
#[serde(skip_serializing_if = "Option::is_none")]
pub kr: Option<f64>,
/// Exciter saturation function value at the corresponding exciter voltage, VE1, back of commutating reactance (SE[VE1]) (>= 0). Typical value = 1,143.
#[serde(skip_serializing_if = "Option::is_none")]
pub seve1: Option<f64>,
/// Exciter saturation function value at the corresponding exciter voltage, VE2, back of commutating reactance (SE[VE2]) (>= 0). Typical value = 0,1.
#[serde(skip_serializing_if = "Option::is_none")]
pub seve2: Option<f64>,
/// Voltage regulator time constant (TA) (> 0). Typical value = 0,013.
#[serde(skip_serializing_if = "Option::is_none")]
pub ta: Option<f64>,
/// Voltage regulator time constant (TB) (>= 0). Typical value = 0.
#[serde(skip_serializing_if = "Option::is_none")]
pub tb: Option<f64>,
/// Voltage regulator time constant (TC) (>= 0). Typical value = 0.
#[serde(skip_serializing_if = "Option::is_none")]
pub tc: Option<f64>,
/// Exciter time constant, integration rate associated with exciter control (TE) (> 0). Typical value = 1,17.
#[serde(skip_serializing_if = "Option::is_none")]
pub te: Option<f64>,
/// Excitation control system stabilizer time constant (TF) (> 0). Typical value = 1.
#[serde(skip_serializing_if = "Option::is_none")]
pub tf: Option<f64>,
/// Maximum voltage regulator output (VAMAX) (> 0). Typical value = 1.
#[serde(skip_serializing_if = "Option::is_none")]
pub vamax: Option<f64>,
/// Minimum voltage regulator output (VAMIN) (< 0). Typical value = -0,95.
#[serde(skip_serializing_if = "Option::is_none")]
pub vamin: Option<f64>,
/// Exciter alternator output voltages back of commutating reactance at which saturation is defined (VE1) (> 0). Typical value = 6,24.
#[serde(skip_serializing_if = "Option::is_none")]
pub ve1: Option<f64>,
/// Exciter alternator output voltages back of commutating reactance at which saturation is defined (VE2) (> 0). Typical value = 4,68.
#[serde(skip_serializing_if = "Option::is_none")]
pub ve2: Option<f64>,
/// Minimum exciter voltage output (VEMIN) (<= 0). Typical value = 0.
#[serde(skip_serializing_if = "Option::is_none")]
pub vemin: Option<f64>,
/// Exciter field current limit reference (VFEMAX) (>= 0). Typical value = 16.
#[serde(skip_serializing_if = "Option::is_none")]
pub vfemax: Option<f64>,
}
impl crate::base::CimElement for ExcIEEEAC3A {
fn mrid(&self) -> &str { &self.base.base.base.id }
fn type_name(&self) -> &'static str { "ExcIEEEAC3A" }
fn as_any(&self) -> &dyn std::any::Any { self }
fn to_json_value(&self) -> serde_json::Value {
serde_json::to_value(self).unwrap_or(serde_json::Value::Null)
}
fn to_block(&self) -> crate::base::RdfBlock {
let mut block = self.base.to_block();
block.type_name = "ExcIEEEAC3A".to_string();
if let Some(v) = self.efdn {
block.fields.insert("ExcIEEEAC3A.efdn".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.ka {
block.fields.insert("ExcIEEEAC3A.ka".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.kc {
block.fields.insert("ExcIEEEAC3A.kc".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.kd {
block.fields.insert("ExcIEEEAC3A.kd".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.ke {
block.fields.insert("ExcIEEEAC3A.ke".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.kf {
block.fields.insert("ExcIEEEAC3A.kf".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.kn {
block.fields.insert("ExcIEEEAC3A.kn".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.kr {
block.fields.insert("ExcIEEEAC3A.kr".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.seve1 {
block.fields.insert("ExcIEEEAC3A.seve1".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.seve2 {
block.fields.insert("ExcIEEEAC3A.seve2".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.ta {
block.fields.insert("ExcIEEEAC3A.ta".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.tb {
block.fields.insert("ExcIEEEAC3A.tb".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.tc {
block.fields.insert("ExcIEEEAC3A.tc".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.te {
block.fields.insert("ExcIEEEAC3A.te".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.tf {
block.fields.insert("ExcIEEEAC3A.tf".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.vamax {
block.fields.insert("ExcIEEEAC3A.vamax".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.vamin {
block.fields.insert("ExcIEEEAC3A.vamin".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.ve1 {
block.fields.insert("ExcIEEEAC3A.ve1".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.ve2 {
block.fields.insert("ExcIEEEAC3A.ve2".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.vemin {
block.fields.insert("ExcIEEEAC3A.vemin".into(), crate::base::FieldValue::Text(v.to_string()));
}
if let Some(v) = self.vfemax {
block.fields.insert("ExcIEEEAC3A.vfemax".into(), crate::base::FieldValue::Text(v.to_string()));
}
block
}
}
impl ExcIEEEAC3A {
pub fn from_block(b: &crate::base::RdfBlock) -> Self {
let mut obj = Self::default();
obj.base.base.base.id.clone_from(&b.mrid);
for (key, val) in &b.fields {
match key.as_str() {
"ExcIEEEAC3A.efdn" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.efdn = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.efdn = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.ka" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.ka = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.ka = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.kc" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.kc = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.kc = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.kd" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.kd = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.kd = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.ke" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.ke = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.ke = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.kf" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.kf = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.kf = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.kn" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.kn = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.kn = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.kr" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.kr = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.kr = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.seve1" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.seve1 = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.seve1 = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.seve2" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.seve2 = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.seve2 = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.ta" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.ta = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.ta = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.tb" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.tb = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.tb = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.tc" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.tc = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.tc = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.te" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.te = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.te = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.tf" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.tf = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.tf = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.vamax" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.vamax = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.vamax = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.vamin" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.vamin = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.vamin = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.ve1" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.ve1 = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.ve1 = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.ve2" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.ve2 = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.ve2 = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.vemin" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.vemin = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.vemin = Some(v); } }
}
_ => {}
}
}
"ExcIEEEAC3A.vfemax" => {
match val {
crate::base::FieldValue::Text(sv) => { if let Ok(v) = sv.trim().parse() { obj.vfemax = Some(v); } }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { if let Ok(v) = sv.trim().parse() { obj.vfemax = Some(v); } }
}
_ => {}
}
}
"ExcitationSystemDynamics.SynchronousMachineDynamics" => {
if let crate::base::FieldValue::Resource(sv) = val {
obj.base.synchronous_machine_dynamics = Some(crate::base::MridRef { mrid: sv.clone() });
}
}
"DynamicsFunctionBlock.enabled" => {
match val {
crate::base::FieldValue::Text(sv) => { obj.base.base.enabled = Some(sv.trim() == "true"); }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { obj.base.base.enabled = Some(sv.trim() == "true"); }
}
_ => {}
}
}
"IdentifiedObject.description" => {
match val {
crate::base::FieldValue::Text(sv) => { obj.base.base.base.description = sv.clone(); }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { obj.base.base.base.description = sv.clone(); }
}
_ => {}
}
}
"IdentifiedObject.energyIdentCodeEic" => {
match val {
crate::base::FieldValue::Text(sv) => { obj.base.base.base.energy_ident_code_eic = sv.clone(); }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { obj.base.base.base.energy_ident_code_eic = sv.clone(); }
}
_ => {}
}
}
"IdentifiedObject.mRID" => {
match val {
crate::base::FieldValue::Text(sv) => { obj.base.base.base.m_rid = sv.clone(); }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { obj.base.base.base.m_rid = sv.clone(); }
}
_ => {}
}
}
"IdentifiedObject.name" => {
match val {
crate::base::FieldValue::Text(sv) => { obj.base.base.base.name = sv.clone(); }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { obj.base.base.base.name = sv.clone(); }
}
_ => {}
}
}
"IdentifiedObject.shortName" => {
match val {
crate::base::FieldValue::Text(sv) => { obj.base.base.base.short_name = sv.clone(); }
crate::base::FieldValue::TextList(svs) => {
if let Some(sv) = svs.last() { obj.base.base.base.short_name = sv.clone(); }
}
_ => {}
}
}
_ => {}
}
}
obj
}
}