20 capacitance <= std::numeric_limits<Real>::epsilon())
21 throw std::invalid_argument(
22 "DC capacitance must be finite and safely greater than zero.");
28 Matrix::Constant(1, 1, 1.0 / capacitance),
29 Matrix::Identity(1, 1), Matrix::Zero(1, 1));
34 throw std::logic_error(
35 "setParameters() must be called before capacitor initialization.");
40 std::abs(voltage.imag()) > std::numeric_limits<Real>::epsilon())
41 throw std::invalid_argument(
42 "DC initial capacitor voltage must be a finite real scalar value.");
44 (**mX)(0, 0) = voltage.real();
45 (**mIntfVoltage)(0, 0) = voltage.real();
46 (**mIntfCurrent)(0, 0) = 0.0;
Capacitor(String uid, String name, Logger::Level logLevel=Logger::Level::off)
void setParameters(Real capacitance)
void initializeFromNodesAndTerminals(Real frequency) override final
Initializes Component variables according to power flow data stored in Nodes.
const Attribute< Real >::Ptr mCapacitance
Capacitance [F].
SimPowerComp< Real >::Ptr clone(String name) override final
Returns a modified copy of the component with the given suffix added to the name and without.
void validateDCTerminals() const
TwoTerminalITypeSSNComp(String uid, String name, Logger::Level logLevel=Logger::Level::off)
void setParameters(const Matrix &A, const Matrix &B, const Matrix &C, const Matrix &D)
String uid()
Returns unique id.
AttributeList::Ptr mAttributes
Attribute List.
spdlog::level::level_enum Level
static bool isFinite(Real value)
std::shared_ptr< SimPowerComp< VarType > > Ptr
Complex initialSingleVoltage(UInt index)
Logger::Level mLogLevel
Component logger control for internal variables.
bool mParametersSet
Flag indicating that parameters are set via setParameters() function.
static std::shared_ptr< Capacitor > make(Args &&...args)
std::complex< Real > Complex