/* MOD_V2.0 * Copyright (c) 2012 OpenDA Association * All rights reserved. * * This file is part of OpenDA. * * OpenDA is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * OpenDA is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with OpenDA. If not, see . */ using System; namespace OpenDA.DotNet.Interfaces { public interface IStochModelInstance : IModelInstance { /********************************* *** State And Parameter Exchange *********************************/ /// /// Get the full set of state variables from a model. /// /// A Vector containing the values of all state variables in the model. IVector State { get; } /// /// Peform a state variable += alpha * vector operation on each state variable in the model. /// /// The alpha in state variable += alpha * vector. /// A Vector containing the values for the axpy-operation on all state variables in the model. void AxpyOnState(double alpha, IVector vector); /* Parameters*/ /// /// Get the full set of parameters from a model. /// Set the full set of parameters for a model. /// /// A Vector containing the values of all parameters in the model. IVector Parameters { get; set; } /// /// Peform a parameter += alpha * vector operation on each parameter in the model. /// /// The alpha in parameter += alpha * vector. /// A Vector containing the values for the axpy-operation on all parameters in the model. void AxpyOnParameters(double alpha, IVector vector); /// /// Get the uncertainty of the tochastic model's state at initial time /// or uncertainty of background at the current time. /// This method is not used for computing the analysis in Kalman filter type algorithms! /// /// A Stochastic Vector containing uncertainty for the state. IStochVector StateUncertainty { get; } /// /// Get the uncenrtainty for the stochastic model's parameters. /// /// A Stochastic Vector containing the uncertainty for the parameters. IStochVector ParameterUncertainty { get; } /// /// Get the stochastic model's white noise. /// /// The time stamp or time span to retreive the noise for. /// A Stochastic Vector containing the white noise. IStochVector[] GetWhiteNoiseUncertainty(ITime time); /* Stochastic forcing, model uncertainty or weak constraints */ /// /// Boolean flag indicating WhiteNoiseUncertainty is same for all times /// /// True if WhiteNoiseUncertainty is same for all times. bool IsWhiteNoiseStationary { get; } /// /// Get a set of white noise from a model for the requested timespan. /// /// use this timespan as a selection /// A Vector containing the values of all white noise in the model. ITime[] GetWhiteNoiseTimes(ITime timeSpan); /// /// Get the full set of white noise from a model. /// /// use this timespan as a selection /// A Vector containing the values of all white noise in the model. IVector[] GetWhiteNoise(ITime timeSpan); /// /// Set the full set of white noise of a model. /// /// An array of Vectors containing white noise for some span. void SetWhiteNoise(IVector[] whiteNoise); /// /// Peform a white noise element += alpha * vector operation on each white noise element in the model. /// /// A Vector containing the values for the axpy-operation on all white noise in the model. /// The alpha in white noise element += alpha * vector. void AxpyOnWhiteNoise(double alpha, IVector[] vector); /// /// Set or unset automatic generation of noise within the stochastic model /// /// rue to set and false to unset. void SetAutomaticNoiseGeneration(bool value); /************************************** *** Matching to observations * TODO How to handle missing values. * TODO How to handle subselection within a model **************************************/ /// /// Get model values corresponding to a number of observations /// /// An ObservationDescriptions object with meta data for the observations /// vector with the model values corresponding to each observation given in the descriptions IVector GetObservedValues(IObservationDescriptions observationDescriptions); /// /// Tell model that it can expect to be asked for model values corresponding to the observations /// described. The model can make arrangement to save these values. The method compute run over a long /// interval at once, not stopping at each time with observations. This is meant to increase the performance /// especially of calibration algorithms. /// /// An ObservationDescriptions object with meta data for the observations void AnnounceObservedValues(IObservationDescriptions observationDescriptions); /************************************** *** Scaling **************************************/ /// /// Get model suggested scaling for the state to improve the preconditioning of the /// data-assimilation. This can eg. be based on some norm or size of cells. /// /// A Vector containing values for all state variables in the model. IVector StateScaling { get; } /// ///Get model suggested scaling for applying a Schur-product on the state /// /// The observation descriptions. /// An array of Vectors (one per obs) containing scaling values for each obs. IVector[] GetStateScaling(IObservationDescriptions observationDescriptions); } }