1 function s=thermalblock_output_function(model_data)
3 % output computation: Integral over boundary segment
11 zero_y_ind=find(p(2,:)==0); %find indices with y=0
14 x_value=x_values(zero_y_ind); %corresponding x values with y=0
16 [x_value_sort,i]=sort(x_value); %sort vector
18 u_zero_y=u(zero_y_ind); %u values at y=0
19 u_zero_y_sort=u_zero_y(i); %corresponding u values sorted
21 %the following section tests,
if the vector x_value contains 0,1, because
22 %we want to compute the integral in the intervall [0,1].
25 u_zero=interp1(x_value_sort, u_zero_y_sort,0,
'cubic');
26 u_zero_y_sort=[u_zero,u_zero_y_sort];
31 u_one = interp1(x_value_sort,u_zero_y_sort,1,
'cubic');
32 u_zero_y_sort=[u_zero_y_sort,u_one];
35 s = trapz(x_value_sort, u_zero_y_sort);
37 if model.plot_output == 1
39 plot(x_value_sort, u_zero_y_sort)