All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.powsybl.openloadflow.ac.equations.AbstractShuntCompensatorEquationTerm Maven / Gradle / Ivy

/**
 * Copyright (c) 2022, RTE (http://www.rte-france.com)
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 * SPDX-License-Identifier: MPL-2.0
 */
package com.powsybl.openloadflow.ac.equations;

import com.powsybl.openloadflow.equations.AbstractElementEquationTerm;
import com.powsybl.openloadflow.equations.Variable;
import com.powsybl.openloadflow.equations.VariableSet;
import com.powsybl.openloadflow.network.LfBus;
import com.powsybl.openloadflow.network.LfShunt;

import java.util.Objects;

/**
 * @author Geoffroy Jamgotchian {@literal }
 */
public abstract class AbstractShuntCompensatorEquationTerm extends AbstractElementEquationTerm {

    protected final Variable vVar;

    protected AbstractShuntCompensatorEquationTerm(LfShunt shunt, LfBus bus, VariableSet variableSet) {
        super(shunt);
        Objects.requireNonNull(bus);
        Objects.requireNonNull(variableSet);
        vVar = variableSet.getVariable(bus.getNum(), AcVariableType.BUS_V);
    }

    protected double v() {
        return sv.get(vVar.getRow());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy