function dof_time_hist % Copyright 2004, J.E. Akin. All rights reserved. % ------------------------------------------------------ % Matlab time-history of value at sys DOF % ------------------------------------------------------ % c_x = x coordinates of nod_per_el line element % msh_typ_nodes = connectivity list for elements, nt x nod_per_el % loop = corners for nod_per_el line element % nod_per_el = Nodes per element % np = Number of Points % nt = Number of elements % pre_e = Element items before connectivity list pre_e = 0 ; % pre_p = Nodal items before coordinates pre_p = 1; % msh_bc_xyz = Nodal coordinates (with preceeding data) % t_x = x coordinates of nod_per_el corners load dof_history.tmp ; % Set control data: number of points np = size (dof_history,1) ; % number of nodal points fprintf ('Read %g time-history sets \n', np) max_p = size (dof_history,2) - pre_p -1 ; % space dimension fprintf ('with %g nodal dof values \n', max_p) dof = dof_history (1, 1) ; fprintf ('for dof number %g \n', dof) x (np) = 0. ; % pre-allocate array x y (np) = 0. ; % pre-allocate array y x = dof_history (1:np, 2) ; % extract x column y = dof_history(:, 3) ; % Cite max, min values [V_X, L_X] = max (y) ; [V_N, L_N] = min (y) ; fprintf ('Max value is %g at step %g \n', V_X, (L_X-1)) fprintf ('Min value is %g at step %g \n', V_N, (L_N-1)) null (1:np) = V_N ; % Initialize plots xmax = max (x) ; xmin = min (x) ; ymax = max (y) ; ymin = min (y) ; if ( ymax == ymin ) if ( abs (ymax) > 0 ) ymax = ymax + abs (ymax)/20. ; ymin = ymin - abs (ymin)/20. ; end % if end % if clf % clear graphics axis ([xmin, xmax, ymin, ymax]) % set axes hold on % hold image for plots xlabel ('Time') title(['FEA Time-History for Degree of Freedom ', ... int2str(dof)']) ylabel (['DOF Value (max = ', ... num2str(V_X), ', min = ', num2str(V_N), ')']) % plot dof values plot (x, y, 'k-') plot (x, y, 'ko') grid % label max min points %b v_text = sprintf ('---min') ; %b text (x(L_N), V_N, v_text) ; %b v_text = sprintf ('---max') ; %b text (x(L_X), V_X, [v_text]) ; % -depsc -tiff % for an eps version hold off % end of dof_time_hist