Skip to main content

McOpfDroop

Struct McOpfDroop 

Source
#[non_exhaustive]
pub struct McOpfDroop { pub monitors: Vec<(usize, Option<usize>)>, pub knots: Vec<f64>, pub values: Vec<f64>, pub epsilon: f64, }
Expand description

Smooth clipped piecewise-linear controller, with SI-derived per-unit knots.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§monitors: Vec<(usize, Option<usize>)>

Voltage-difference terminal pairs; None means physical ground. Multiple pairs use averaged magnitudes.

§knots: Vec<f64>

Strictly increasing voltage knots divided by V_base.

§values: Vec<f64>

Control power at each knot, divided by S_base.

§epsilon: f64

Positive softplus smoothing width in per-unit voltage.

Implementations§

Source§

impl McOpfDroop

Source

pub fn calc_terms(&self) -> McOpfDroopTerms

The curve’s terms, the one statement of the smoothed piecewise linear curve: calc_control sums them and a symbolic model builds its expression from them.

Source

pub fn calc_monitored_voltage(&self, voltage: &[Complex64]) -> f64

The mean monitored voltage magnitude: |V_p − V_n| over the monitor pairs (V_n = 0 for ground), averaged, from per unit terminal voltages indexed like the preparation’s terminals.

Source

pub fn calc_control(&self, voltage: f64) -> McOpfDroopValue

The curve’s control power at the monitored voltage voltage and its slope: the piecewise linear curve through (knots, values) with each corner smoothed by a softplus of width epsilon,

c(v) = values₀ + Σⱼ sⱼ ε (softplus((v − kⱼ)/ε) − softplus((v − kⱼ₊₁)/ε)),
sⱼ = (valuesⱼ₊₁ − valuesⱼ) / (kⱼ₊₁ − kⱼ).

The one droop evaluation: the OPF residual, its validation and its parameter sensitivities read it.

Source

pub fn calc_parameter_derivative( &self, voltage: f64, d_knots: &[f64], d_values: &[f64], d_epsilon: f64, ) -> McOpfDroopValue

The directional derivative of calc_control along a change (d_knots, d_values, d_epsilon) of the curve’s parameters, at a fixed monitored voltage: the change of the control power (value) and of its voltage slope (slope).

§Panics

When d_knots or d_values is shorter than the curve.

Trait Implementations§

Source§

impl Clone for McOpfDroop

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for McOpfDroop

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for McOpfDroop

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for McOpfDroop

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V