pub struct ModelChain {
pub system: PVSystem,
pub location: Location,
pub surface_tilt: f64,
pub surface_azimuth: f64,
pub inverter_pac0: f64,
pub inverter_eta: f64,
pub config: ModelChainConfig,
}Expand description
Orchestrates the full PV system performance simulation pipeline.
Fields§
§system: PVSystem§location: Location§surface_tilt: f64§surface_azimuth: f64§inverter_pac0: f64§inverter_eta: f64§config: ModelChainConfigImplementations§
Source§impl ModelChain
impl ModelChain
Sourcepub fn new(
system: PVSystem,
location: Location,
surface_tilt: f64,
surface_azimuth: f64,
inverter_pac0: f64,
inverter_eta: f64,
) -> Self
pub fn new( system: PVSystem, location: Location, surface_tilt: f64, surface_azimuth: f64, inverter_pac0: f64, inverter_eta: f64, ) -> Self
Create a new ModelChain with explicit parameters (legacy constructor).
Sourcepub fn with_config(
system: PVSystem,
location: Location,
surface_tilt: f64,
surface_azimuth: f64,
inverter_pac0: f64,
inverter_eta: f64,
config: ModelChainConfig,
) -> Self
pub fn with_config( system: PVSystem, location: Location, surface_tilt: f64, surface_azimuth: f64, inverter_pac0: f64, inverter_eta: f64, config: ModelChainConfig, ) -> Self
Create a ModelChain with a custom configuration.
Sourcepub fn with_pvwatts(
system: PVSystem,
location: Location,
surface_tilt: f64,
surface_azimuth: f64,
inverter_pac0: f64,
inverter_eta: f64,
) -> Self
pub fn with_pvwatts( system: PVSystem, location: Location, surface_tilt: f64, surface_azimuth: f64, inverter_pac0: f64, inverter_eta: f64, ) -> Self
Factory: PVWatts-style configuration.
Uses PVWatts DC/AC, Physical AOI, PVWatts temperature, Perez transposition.
Sourcepub fn with_sapm(
system: PVSystem,
location: Location,
surface_tilt: f64,
surface_azimuth: f64,
inverter_pac0: f64,
inverter_eta: f64,
) -> Self
pub fn with_sapm( system: PVSystem, location: Location, surface_tilt: f64, surface_azimuth: f64, inverter_pac0: f64, inverter_eta: f64, ) -> Self
Factory: SAPM-style configuration.
Uses PVWatts DC, PVWatts AC, ASHRAE AOI, SAPM temperature, HayDavies transposition.
Sourcepub fn run_model(
&self,
time: DateTime<Tz>,
_ghi: f64,
dni: f64,
dhi: f64,
temp_air: f64,
_wind_speed: f64,
) -> Result<SimulationResult, SpaError>
pub fn run_model( &self, time: DateTime<Tz>, _ghi: f64, dni: f64, dhi: f64, temp_air: f64, _wind_speed: f64, ) -> Result<SimulationResult, SpaError>
Run the model for a single timestep with given weather data (legacy API).
Sourcepub fn run_model_from_weather(
&self,
weather: &WeatherInput,
) -> Result<ModelChainResult, SpaError>
pub fn run_model_from_weather( &self, weather: &WeatherInput, ) -> Result<ModelChainResult, SpaError>
Run the full simulation pipeline from weather data.
Steps: solar position -> airmass -> AOI -> transposition -> AOI modifier -> spectral modifier -> effective irradiance -> cell temperature -> DC power -> AC power.
Sourcepub fn run_model_from_poa(
&self,
input: &POAInput,
) -> Result<ModelChainResult, SpaError>
pub fn run_model_from_poa( &self, input: &POAInput, ) -> Result<ModelChainResult, SpaError>
Run the simulation starting from plane-of-array irradiance data.
Skips transposition step but still computes solar position for airmass.
Sourcepub fn run_model_from_effective_irradiance(
&self,
input: &EffectiveIrradianceInput,
) -> Result<ModelChainResult, SpaError>
pub fn run_model_from_effective_irradiance( &self, input: &EffectiveIrradianceInput, ) -> Result<ModelChainResult, SpaError>
Run the simulation starting from effective irradiance.
Skips solar position, transposition, AOI, and spectral steps.
Sourcepub fn complete_irradiance(
&self,
weather: &WeatherInput,
) -> Result<(f64, f64, f64), SpaError>
pub fn complete_irradiance( &self, weather: &WeatherInput, ) -> Result<(f64, f64, f64), SpaError>
Fill missing GHI, DNI, or DHI using the Erbs decomposition model.
If all three are provided, returns them as-is. If GHI is provided but DNI or DHI are missing, uses Erbs to decompose. If GHI is missing but DNI and DHI are provided, computes GHI = DNI * cos(zenith) + DHI.
Auto Trait Implementations§
impl Freeze for ModelChain
impl !RefUnwindSafe for ModelChain
impl !Send for ModelChain
impl !Sync for ModelChain
impl Unpin for ModelChain
impl UnsafeUnpin for ModelChain
impl !UnwindSafe for ModelChain
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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