rbmatlab  1.13.10
 All Classes Namespaces Files Functions Variables Groups Pages
t_part_rb_reconstruction.m
Go to the documentation of this file.
1 function sim_data = t_part_rb_reconstruction(model, detailed_data, sim_data)
2 %function sim_data = t_part_rb_reconstruction(model, detailed_data,
3 %sim_data)
4 %
5 % function making an rb reconstruciton for t-partition models.
6 % In t-partition there is an overlap at the border of time-partitions. At
7 % the border the initial value of the next t-partition is discarded and the
8 % last timestep solution of the foregoing t-partition is kept.
9 %
10 %
11 
12 % Markus Dihlmann 15.02.2011
13 
14 base_model = model.base_model;
15 
16 nr_t_parts = length(sim_data.t_part_sim_data); %number of t-partitions
17 
18 t_part_sim_data = sim_data.t_part_sim_data;
19 
20 %rb_reconstruction of the sim_data in every partition
21 for ind = 1:nr_t_parts
22  t_part_sim_data{ind} = rb_reconstruction(base_model, detailed_data.t_part_detailed_data{ind},t_part_sim_data{ind});
23 end
24 
25 %putting together global sim_data cutting off first step in each partition
26 %(except initial partition);
27 sim_data.U = t_part_sim_data{1}.U;
28 
29 if nr_t_parts>1
30  if ~model.transition_model
31  for ind = 2:nr_t_parts
32  len=size(t_part_sim_data{ind}.U,2);
33  sim_data.U = [sim_data.U,t_part_sim_data{ind}.U(:,2:len)];
34  end
35  else
36  for ind = 2:nr_t_parts
37  sim_data.U = [sim_data.U,t_part_sim_data{ind}.U];
38  end
39  end
40 end
41 
42 
43 sim_data.t_part_sim_data = t_part_sim_data;