Estimator
Estimator (base class)
- class onwards.estimators.Estimator(wt: Turbine, meas: list, states: list, req_state: list, avail_states: list)
Bases:
object
Inits a Estimator object
Prototype class for user defined Estimator objects. Estimator converts th Turbine’s measurements, m_wt, to the Turbine’s state, s_wt.
\[\mathbf{m}_{wt} \rightarrow \mathbf{\hat{s}}_{wt}\]The ith state, s_wt^i, is computed from the sensors measurements possibly along with previously computed states, s_wt^J, with J : j < i
\[\mathbf{\hat{s}}_{wt}^i = \mathbf{\hat{s}}_{wt}^i(\mathbf{m}_{wt}, \mathbf{\hat{s}}_{wt}^J)\]- Parameters
meas (list) – List of the measurements meas required by the Estimator.
states (list) – List of the Turbine’s states computed by the Estimator.
req_state (list) – List of the Turbine’s states required by the Estimator.
avail_states (list) – List of the Turbine’s states available.
- Raises
Exception – If the requested Turbine’s state is not (yet) available.
Exception – If the requested Turbine’s measurement is not available.
- reset()
Resets the Estimator to its original state.
- update()
Computes the current value of the Estimator’s state(s).
The corresponding state(s) should be updated in the parent Turbine object:
self.wt.states['myState'] = myValue
Est_ct_fromthrust
- class onwards.estimators.ct_fromthrust.Est_ct_fromthrust(wt: Turbine, avail_states: list, est_args: dict)
Bases:
onwards.estimators.estimator.Estimator
Computes the thrust coefficient,
ct
, from the measured thrust,T
, and from the estimated incident velocity,u_inc
, and yaw angle,yaw
.- Input(s) states
Rotor incident velocity (
u_inc
) [ms-1]Yaw (
yaw
) [rad]
- Input(s) measurements
Thrust (
T
) [N]
- State(s) computed
Thrust coefficient (
ct
) [-]
Est_fld_fromdata
- class onwards.estimators.fld_fromdata.Est_fld_fromdata(wt: Turbine, avail_states: list, est_args: dict)
Bases:
onwards.estimators.estimator.Estimator
Extract the turbine state directly from the Sensor data.
- Input(s) states
None
- Input(s) measurements
User defined (cfr
Est_fld_fromdata.update()
)
- State(s) computed
User defined (cfr
Est_fld_fromdata.update()
)
Est_ufswfs_waked
- class onwards.estimators.ufswfs_waked.Est_ufswfs_waked(wt: Turbine, avail_states: list, est_args: dict)
Bases:
onwards.estimators.estimator.Estimator
Corrects the ambient streamwise velocity if the wind turbine is waked.
- Input(s) states
Incident streamwise velocity component (
u_inc
) [ms-1]Incident spanwise velocity component (
w_inc
) [ms-1]
- Input(s) measurements
None
- State(s) computed
Estimated ambient streamwise velocity component (
u_fs
) [ms-1]Estimated ambient spanwise velocity component (
w_fs
) [ms-1]
Est_uincti_kfbem
StateExport
- class onwards.estimators.stateExport.StateExportBuffer(wt: Turbine, export_args: dict)
Bases:
object
Saves the wind turbine estimated states fo future simulations.
Along with the
SensorsPreprocessed
class, it allows direct feed through of the sensors measurements to theFarm.lag_solver
.This allows for fast computations when evaluating the performances of the Lagrangian (ie: skips the turbine states estimation step).
- Parameters
wt (Turbine) – Parent Turbine object.
export_args (dict) –
Dictionary containing the Estimators’s export parameters.
Available options:
- name
(str) - Name of the subdirectory (this subdirectory is created inside
Farm.data_dir
).- overwrite
(bool, optional) - Overwrite export data if set to True, by default False.
- user_field
(List[str], optional) - List of the measurements, m_wt, not part of the turbine state, s_wt, that should be appended to the exported state vector. By default, empty list.
- Raises
ValueError – If no subdirectory
name
is provided.OSError – If the export directory already exist.
ValueError – If a conflict is detected between
user_field
andTurbine.states
.
Example
- Once an Estimator has been exported exported:
>>> est_args = { >>> 'export' = { 'name' : 'my_dir', >>> 'overwrite' : True, >>> 'export_user_field': ['myField'] >>> ... >>> }
- One may load it using:
>>> snrs_args = { >>> 'type': 'SensorsPreprocessed', >>> 'name': 'my_dir' >>> }
- save()
Exports the StateExportBuffer object.
- update()
Updates the StateExportBuffer object.