Commit cd65c989 authored by Jim Nutaro's avatar Jim Nutaro
Browse files

Lump resistive shunt capacitors into the load

parent ec28fba1
......@@ -96,7 +96,8 @@ void ElectricalData::initialize_circuit()
lines[i].B = Complex(0.0,0.0);
lines[i].Z = 1.0/lines[i].y;
lines[i].R = real(lines[i].Z);
assert(imag(lines[i].Z) > 0.0);
if (imag(lines[i].Z) <= 0.0)
cerr << "Line " << lines[i].to << " -> " << lines[i].from << " has negative reactance." << endl;
lines[i].L = imag(lines[i].Z)/(2.0*pi*freq);
}
// Calculate load parameters
......@@ -106,8 +107,8 @@ void ElectricalData::initialize_circuit()
nodes[i].y = nodes[i].Z = Complex(0.0,0.0);
if (nodes[i].B != Complex(0.0,0.0))
{
assert(real(nodes[i].B) == 0.0);
if (imag(nodes[i].B) < 0.0)
// If its not a pure capacitance, then lump it into the load
if (imag(nodes[i].B) < 0.0 || real(nodes[i].B) > 0.0)
nodes[i].y += nodes[i].B;
// Charging as capacitance
else
......
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