rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
plot_sim_data.m
1 function p = plot_sim_data(dmodel,model_data,sim_data,plot_params)
2 % function p = plot_sim_data(dmodel,model_data,sim_data,plot_params)
3 % plots the simulation data as returned by detailed_simulation()
4 %
5 % Parameters:
6 % sim_data: simulation data structure as returned by detailed_simulation()
7 % plot_params: structure which controls the plot output
8 %
9 % Optional fields of plot_params:
10 % plot_title: title of the plot (default = 'trajectory')
11 % plot_output_title: title of the output functional plot (default = 'output')
12 % axis_equal: flag equalizing the axes ratio
13 %
14 % Required fields of sim_data:
15 % U: DOF vector of solution snapshots
16 %
17 % Required fields of sim_data:
18 % y: DOF vector of output function
19 %
20 % Return values:
21 % p : Matlab GUI handle to figure window
22 
23 % Bernard Haasdonk 4.9.2009
24 
25 ddescr = dmodel.descr;
26 
27 if ~isfield(plot_params,'plot_title')
28  plot_title = 'trajectory';
29 else
30  plot_title = plot_params.plot_title;
31 end;
32 
33 if ~isfield(plot_params,'plot_output_title')
34  plot_output_title = 'output';
35 else
36  plot_output_title = plot_params.plot_output_title;
37 end;
38 
39 % plot sequence
40 plot_params.title = plot_title;
41 if ~isfield(plot_params,'plot')
42  plot_params.plot = ddescr.plot;
43 end
44 plot_params.axis_equal = 1;
45 p = plot_sequence(sim_data.U,model_data.grid,plot_params);
46 
47 % plot output functional
48 if ddescr.compute_output_functional
49  p2 = figure;
50  plot(sim_data.s);
51  title(plot_output_title);
52  p = [p,p2];
53 end;
54 
function p = plot_sequence(varargin)
plotting a sequence of data slices on polygonal 2d grid (constructed from params if empty) and provid...
Definition: plot_sequence.m:17
function p = plot_sim_data(model, model_data, sim_data, plot_params)
function performing the plot of the simulation results as specified in model.
Definition: plot_sim_data.m:17