Commit e2b694e9 authored by James Nutaro (1qn)'s avatar James Nutaro (1qn)
Browse files

Experimenting with extra damping in the generator

parent a690693a
......@@ -135,7 +135,9 @@ string createGenerator(string busName, ElectricalData::bus_data_t data)
string result;
string varName;
string Ef = generatorExcitor(busName);
string Hstr = number(2.0*data.genr.H);
string Hstr = number(data.genr.H);
string Pt = "pt_"+busName;
string wt = "wt_"+busName;
string w = omega(busName);
string Pm = mech_power(busName);
string Pe = "pe_"+busName;
......@@ -158,19 +160,31 @@ string createGenerator(string busName, ElectricalData::bus_data_t data)
result += Pe+"="+powerDraw+";\n";
stateVars.insert(state_var_init_t(generatorAngle(busName),0.0));
stateVars.insert(state_var_init_t(w,data.genr.w0));
stateVars.insert(state_var_init_t(wt,data.genr.w0));
stateVars.insert(state_var_init_t(Pm,data.genr.Pm0));
stateVars.insert(state_var_init_t(Pt,data.genr.Pm0));
stateVars.insert(state_var_init_t(C,data.genr.Pm0));
stateVars.insert(state_var_init_t(Pref,data.genr.Pm0));
stateVars.insert(state_var_init_t(Ef,0.0));
result += "der("+Ef+")=0.0;\n";
result += "der("+generatorAngle(busName)+")="+w+";\n";
result += "der("+w+")=("+Pt+"-"+Pe+")/"+Hstr+";\n";
result += "der("+wt+")=("+Pm+"-"+Pt+")/"+Hstr+";\n";
result += "der("+Pt+")=("+wt+"-"+w+"-1E-1*"+Pt+")/1E-5;\n";
result += "der("+C+")="+number(data.genr.Tspd1)+"*("+Pref+"-"+number(data.genr.R)+
"*"+wt+"-"+C+");\n";
result += string("der(")+Pm+")="+
number(data.genr.Tspd2)+"*("+C+"-"+Pm+");\n";
result += "der("+Pref+")=-"+number(data.genr.Agc)+"*"+wt+";\n";
// Comment these out and see the next comment block to keep the generators still
result += "der("+Ef+")="+number(data.genr.G)+"*("+Pm+"-"+Pe+"-"+number(data.genr.K)+"*"+Ef+");\n";
/* result += "der("+Ef+")="+number(data.genr.G)+"*("+Pm+"-"+Pe+"-"+number(data.genr.K)+"*"+Ef+");\n";
result += "der("+generatorAngle(busName)+")="+w+";\n";
result += "der("+w+")=("+Pm+"-"+Pe+")/"+Hstr+";\n";
result += "der("+C+")="+number(data.genr.Tspd1)+"*("+Pref+"-"+number(data.genr.R)+
"*"+w+"-"+C+");\n";
result += string("der(")+Pm+")="+
number(data.genr.Tspd2)+"*("+C+"-"+Pm+");\n";
result += "der("+Pref+")=-"+number(data.genr.Agc)+"*"+w+";\n";
result += "der("+Pref+")=-"+number(data.genr.Agc)+"*"+w+";\n"; */
/* result += "der("+Ef+")=0.0;\n";
result += "der("+generatorAngle(busName)+")=0;\n";
result += "der("+w+")=0;\n";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment