Skip to main content

AreaDefinition

Struct AreaDefinition 

Source
pub struct AreaDefinition {
    pub of_bus: Vec<Option<usize>>,
    pub targets: Vec<f64>,
    pub factors: Vec<f64>,
    pub tolerance: f64,
    pub max_outer_iter: usize,
}
Expand description

Which buses belong to which control area, what each area is scheduled to export, and who adjusts to get there.

Fields§

§of_bus: Vec<Option<usize>>

Area index per bus, indexed by Bus::idx. None means the bus is in no area — its injections are nobody’s to schedule, and any branch it shares with an area counts as that area’s boundary.

§targets: Vec<f64>

Scheduled net export per area, per-unit. Positive is exporting, the sign convention ENTSO-E net positions use.

§factors: Vec<f64>

Participation weight per bus. Normalized within each area, so only relative magnitudes matter and raw megawatt headroom can be passed.

§tolerance: f64

Convergence tolerance on an area’s remaining mismatch, per-unit.

§max_outer_iter: usize

Cap on outer passes.

Implementations§

Source§

impl AreaDefinition

Source

pub fn uniform( buses: &[Bus], of_bus: Vec<Option<usize>>, n_areas: usize, ) -> Self

Every generator bus — Slack and PV — participates equally within its own area, with every area scheduled for zero net export.

A zero target is rarely what a real schedule says, but it is the meaningful default: it asks each area to serve its own load, which is the reading of “no interchange agreed”.

Source

pub fn by_generation( buses: &[Bus], of_bus: Vec<Option<usize>>, n_areas: usize, ) -> Self

Weighted by each bus’s own scheduled generation, whatever its bus type.

§Why this differs from uniform, and from distributed slack

SlackDistribution::uniform participates Slack and PV buses only, on the grounds that a positive injection at a PQ bus is a fixed schedule rather than a machine under governor control. That reasoning is about frequency response, and it is right: a machine not on governor control does not pick up imbalance.

A net position is not frequency response. It is met by redispatch — a scheduling action over the hour — and a generator held at a fixed active set-point is precisely the machine an operator redispatches. Excluding it makes whole areas uncontrollable: in two_area_case.xiidm, both of AREA2’s generators are voltageRegulatorOn="false" and so arrive as PQ buses, leaving that area with no participant at all under uniform and its −400 MW schedule unreachable.

So this weights by p_spec.max(0.0) at every bus. An area whose generation is all at fixed set-points is dispatchable; a load bus, with no positive injection, still is not.

Trait Implementations§

Source§

impl Clone for AreaDefinition

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 AreaDefinition

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

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
Source§

impl<T> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

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

Source§

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> DistributionExt for T
where T: ?Sized,

Source§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

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.
Source§

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

Source§

fn vzip(self) -> V