DPsim
Loading...
Searching...
No Matches
EMT_Ph3_PiecewiseLinearInductor.h
1// SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, EONERC, RWTH Aachen University
2// SPDX-License-Identifier: MPL-2.0
3
4#pragma once
5
6#include <vector>
7
8#include <dpsim-models/EMT/EMT_Ph3_TwoTerminalVTypeVariableSSNComp.h>
9
10namespace CPS {
11namespace EMT {
12namespace Ph3 {
13
32class PiecewiseLinearInductor final
33 : public TwoTerminalVTypeVariableSSNComp,
34 public SharedFactory<PiecewiseLinearInductor> {
35private:
36 std::vector<Real> mFluxBreakpoints;
37 std::vector<Real> mCurrentBreakpoints;
38
39 std::pair<Real, Real> slopeAndOffsetFromFlux(Real flux) const;
40
41protected:
42 Bool updateComponentParameters() override final;
43
44public:
45 using SharedFactory<PiecewiseLinearInductor>::make;
46
47 PiecewiseLinearInductor(String uid, String name,
48 Logger::Level logLevel = Logger::Level::off);
49 PiecewiseLinearInductor(String name,
50 Logger::Level logLevel = Logger::Level::off)
51 : PiecewiseLinearInductor(name, name, logLevel) {}
52
53 SimPowerComp<Real>::Ptr clone(String name) override final;
54
55 void setParameters(const std::vector<Real> &fluxBreakpoints,
56 const std::vector<Real> &currentBreakpoints);
57};
58
59} // namespace Ph3
60} // namespace EMT
61} // namespace CPS
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.
String uid()
Returns unique id.