rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
lin_evol_get_output.m
Go to the documentation of this file.
1 function [y,data] = lin_evol_get_output(model, varargin)
2 %lin_evol_get_output_detailed(model, varargin)
3 %
4 %Function returns the output which should be optimized.
5 %It performs a detailed/reduced simulation (considering varagin = reduced_data or detailed_data) for the mu set in model and returns the
6 %output (the average concentration in the lower right quadrant).
7 %
8 % in the struct data additional data can be returned
9 %
10 % Markus Dihlmann 04.02.2010
11 data = [];
12 
13 if isfield(varargin{1},'grid')
14  model_data = varargin{1};
15  if length(varargin)>1
16  mu= varargin{2};
17 % if (mu(1)<0)||(mu(1)>1)||(mu(2)<0)||(mu(2)>1)
18 % keyboard;
19 % end
20  model = set_mu_to_optimize(model, mu);
21  end
22  %perform detailed simulation with actual parameter set
23  model.compute_derivative_info = 0;
24  sim_data = detailed_simulation(model,model_data);
25 
26  y = sim_data.y(end);
27  %y=y(2);
28  if(model.verbose>=8)
29  disp('detailed simulation output result:')
30  y
31  end
32 
33 else
34  reduced_data = varargin{1};
35  %perform reduced simulation
36  if length(varargin)>1
37  mu= varargin{2};
38 % if (mu(1)<0)||(mu(1)>1)||(mu(2)<0)||(mu(2)>1)
39 % keyboard;
40 % end
41  model = set_mu_to_optimize(model, mu);
42  end
43  model.compute_derivative_info = 0;
44  sim_data =rb_simulation(model, reduced_data);
45  %if isempty(model_data)
46  % model_data = gen_model_data(model);
47  %end
48  %disp('rewrite lin_evol_get_output for faster evaluation');
49  % sim_data = model.rb_reconstruction(model, model_data, detailed_data, sim_data);
50  y=sim_data.s(end);
51  %y=sim_data.s(end);
52  if(model.verbose>=8)
53  disp('reduced simulation output result:')
54  y
55  end
56 
57  data.nRB = sim_data.nRB;
58 
59 end
function y = lin_evol_get_output_detailed(model, varargin)
lin_evol_get_output_detailed(model, varargin)
function model = set_mu_to_optimize(model, x, varargin)
Funcion sets the parameters that are to be optimized to the values given by x Also usable for optimiz...
function [ y , data ] = lin_evol_get_output(model, varargin)
lin_evol_get_output_detailed(model, varargin)