rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
Functions
RB_greedy_extension.m File Reference

function performing a greedy search loop for reduced basis generation. More...

Go to the source code of this file.

Functions

function [
detailed_data ,
reduced_data ] = 
RB_greedy_extension (model, detailed_data)
 function performing a greedy search loop for reduced basis generation. More...
 

Detailed Description

function performing a greedy search loop for reduced basis generation.

Definition in file RB_greedy_extension.m.

Function Documentation

function [ detailed_data , reduced_data ] = RB_greedy_extension (   model,
  detailed_data 
)

function performing a greedy search loop for reduced basis generation.

In each iteration the parameter vector with maximum posterior estimator or true error is selected for "refinement". An orthonormal basis is generated.

The detailed_data is expected to be reasonably filled, that rb_simulations are possible with the given arguments, i.e. gen_reduced_data(model, detailed_data). That means, that it also can contain an existing basis, which is then extended in this loop. the offline_data for after the last extension is optionally returned.

The stopping of the extention is performed, if

  • model.RB_stop_epsilon is reached: basis vectors are added until the maximum posterior estimator is smaller than this value. M_val can be ommited in this case.
  • model.RB_stop_max_val_train_ratio: basis vectors are added until the ratio r of the max estimator on a validation set M_val with the estimator on the training set M is larger than r_max. M_val is required in this case
  • model.RB_stop_timeout: basis vectors are added until toc gives a time exceeding a maximum level given
  • model.RB_stop_Nmax: If given number of basis vectors in full basis is obtained.
  • model.p_part_early_refinement is set to one and the estimated number of basis vectors necessary to reach etol is higher than RB_stop_Nmax.
The following fields are created/extended in detailed_data.RB_info
  • M_first_errs : a vector with the initial error-estimator for each M_train. Is determined to check, whether any extension has to be performed or not.
  • stopped_on_epsilon : flag indicating whether epsilon-stop-crit is reached
  • stopped_on_timeout: flag indicating whether timeout is reached
  • stopped_on_Nmax: flag indicating whether Nmax is reached
  • stopped_on_max_val_train_ratio: flag indicating whether epsilon-stop-crit is reached
  • stopped_on_empty_extension : flag indicating, whether the last extension failed due to accuracy problems, i.e. new basis-vector already in span of existing.
  • stopped_on_Nlimit_estimation: flag indicating ifthe extension process was stopped, because it was estimated that more than Nmax basis vectoras are needed to reach etol. Partition of the parameter domain can be initiated.
  • max_err_sequence : the decreasing maximum posterior estimators or true errors in each iteration, which are present AFTER the respective basis extension. So in case of stopped_on_epsilon, the last entry of this field should be smaller than the desired epsilon. The first entry is the maximal initial error/estimator.
  • mu_sequence : sequence of mu_values chosen for basis extension i.e. list of worst-estimator mu_values as the columns of the matrix mu_values. The last entry corresponds to the errors/estimator values AFTER the last basis extension.
  • N_sequence : sequence of basis sizes AFTER each extension. First entry is basis size before first extension.
  • r_value_sequence : ratios of val/train error-estimator in case of validation set providing, AFTER the respective basis-extension.
  • toc_value_sequence : toc_values after each basis extension
  • M_last_errs : the posterior estimators for all mu in M_train at final time AFTER the last respective basis extension
Required fields in detailed_data.RB_info
  • M_train : matrix with parameter-vectors as columns, over which greedy search is to be performed.
  • M_val : matrix with parameter-vectors as columns, which are used for validation. Only required, if the field model.stop_on_max_val_train_ratio is set)
The following fields of detailed_data are created/extended
  • RB : is extended by the number of basis-vectors, overall being the orthonormal basis
  • RB_info : the fields of this info-structure are extended, as described above

additional fields as required by the selected extension algorithm and the reduced-basis-simulation must be set in model.

Parameters
modelmodel
detailed_datadetailed data
Return values
detailed_datadetailed data
reduced_datareduced data
Required fields of model:
  • RB_extension_algorithm —  function pointer to either RB_extension_max_error_snapshot() or RB_extension_PCA_fixspace()
  • RB_error_indicator —  either estimator or error indicating, whether an aposteriori indicator or true error is to be used
  • RB_detailed_val_savepath —  path to the detailed data of the validation set in validation mode. Is generated if not available.
  • RB_detailed_train_savepath —  path to the detailed data of the training set. Is generated if not available. Is only required in case of error mode instead of estimator
  • RB_stop_max_val_train_ratio —  RB stop max val train ratio
  • save_detailed_simulations —  save detailed simulations
  • get_rb_size —  get rb size
  • mu_names —  a string array containing the symbolic names of the parameter vector \(\mu\)
  • N —  N
  • RB_stop_epsilon —  RB stop epsilon
  • RB_stop_Nmax —  RB stop Nmax
  • RB_stop_timeout —  RB stop timeout
  • p_part_early_refinement —  p part early refinement
  • RB_save_temp_detailed_data —  RB save temp detailed data
  • verbose —  flag indicating the verbosity level of informative output
  • get_rb_from_detailed_data —  function RB=f(detailed_data) returning the reduced basis vectors stored in a detailed_data structure.
  • set_rb_in_detailed_data —  function detailed_data=f(detailed_data, newRB) updating the reduced basis vectors stored in detailed_data by assigning them to newRB.
  • get_inner_product_matrix —  function W=f(model_data) returning the mass matrix \(W\) for inner product computation \(\langle u,v \rangle = u^t W v\).
  • orthonormalize —  orthonormalize
Required fields of detailed_data:
  • RB_info.M_val —  RB info.M val
  • RB_info.M_train —  RB info.M train
Generated fields of detailed_data:
  • RB_info —  RB info
  • RB_info.max_err_sequence —  RB info.max err sequence
  • RB_info.mu_sequence —  RB info.mu sequence
  • RB_info.mu_ind_seq —  RB info.mu ind seq
  • RB_info.r_value_sequence —  RB info.r value sequence
  • RB_info.toc_value_sequence —  RB info.toc value sequence
  • RB_info.N_sequence —  RB info.N sequence
  • N —  N

Definition at line 17 of file RB_greedy_extension.m.

Here is the call graph for this function: