andes.core.param.NumParam#

class andes.core.param.NumParam(default: float | str | ~typing.Callable | None = None, name: str | None = None, tex_name: str | None = None, info: str | None = None, unit: str | None = None, vrange: ~typing.List | ~typing.Tuple | None = None, vtype: ~typing.Type | None = <class 'float'>, iconvert: ~typing.Callable | None = None, oconvert: ~typing.Callable | None = None, non_zero: bool = False, non_positive: bool = False, non_negative: bool = False, mandatory: bool = False, power: bool = False, ipower: bool = False, voltage: bool = False, current: bool = False, z: bool = False, y: bool = False, r: bool = False, g: bool = False, dc_voltage: bool = False, dc_current: bool = False, export: bool = True)[source]#

A computational numerical parameter.

Parameters defined using this class will have their v field converted to a NumPy array after adding.

The original input values will be copied to vin, and the system-base per-unit conversion coefficients (through multiplication) will be stored in pu_coeff.

Parameters:
defaultstr or float, optional

The default value of this parameter if no value is provided

namestr, optional

Name of this parameter. If not provided, name will be set to the attribute name of the owner model.

tex_namestr, optional

LaTeX-formatted parameter name. If not provided, tex_name will be assigned the same as name.

infostr, optional

A description of this parameter

mandatorybool

True if this parameter is mandatory

unitstr, optional

Unit of the parameter

vrangelist, tuple, optional

Typical value range

vtypetype, optional

Type of the v field. The default is float.

Other Parameters:
Snstr

Name of the parameter for the device base power.

Vnstr

Name of the parameter for the device base voltage.

non_zerobool

True if this parameter must be non-zero. non_zero can be combined with non_positive or non_negative.

non_positivebool

True if this parameter must be non-positive.

non_negativebool

True if this parameter must be non-negative.

mandatorybool

True if this parameter must not be None.

powerbool

True if this parameter is a power per-unit quantity under the device base.

iconvertcallable

Callable to convert input data from excel or others to the internal v field.

oconvertcallable

Callable to convert input data from internal type to a serializable type.

ipowerbool

True if this parameter is an inverse-power per-unit quantity under the device base.

voltagebool

True if the parameter is a voltage pu quantity under the device base.

currentbool

True if the parameter is a current pu quantity under the device base.

zbool

True if the parameter is an AC impedance pu quantity under the device base.

ybool

True if the parameter is an AC admittance pu quantity under the device base.

rbool

True if the parameter is a DC resistance pu quantity under the device base.

gbool

True if the parameter is a DC conductance pu quantity under the device base.

dc_currentbool

True if the parameter is a DC current pu quantity under device base.

dc_voltagebool

True if the parameter is a DC voltage pu quantity under device base.

__init__(default: float | str | ~typing.Callable | None = None, name: str | None = None, tex_name: str | None = None, info: str | None = None, unit: str | None = None, vrange: ~typing.List | ~typing.Tuple | None = None, vtype: ~typing.Type | None = <class 'float'>, iconvert: ~typing.Callable | None = None, oconvert: ~typing.Callable | None = None, non_zero: bool = False, non_positive: bool = False, non_negative: bool = False, mandatory: bool = False, power: bool = False, ipower: bool = False, voltage: bool = False, current: bool = False, z: bool = False, y: bool = False, r: bool = False, g: bool = False, dc_voltage: bool = False, dc_current: bool = False, export: bool = True)[source]#

Methods

add([value])

Add a value to the parameter value list.

get_names()

Return self.name in a list.

get_property(property_name)

Check the boolean value of the given property.

restore()

Restore parameter to the original input by copying self.vin to self.v.

set(pos, attr, value)

Set attributes of the BaseParam class to new values at the given positions.

set_all(attr, value)

Set attributes of the BaseParam class to new values for all positions.

set_pu_coeff(coeff)

Store p.u.

to_array()

Converts field v to the NumPy array type.

Attributes

class_name

Return the class name.

n

Return the count of elements in the value array.