function [] = lagrange_graphs(loga, ax, ay, a_theta_x, a_theta_y, a_radial_x, a_radial_y, Gx, Gy) % lagrange_function.m % used by lagrange.m % See also LAGRANGE. % change log: % 1998-09-02:DAV: started by David Cary ' graphing results ...' figure % use +6 to convert from log(Mm/s^2) to log(m/s^2). imagesc( loga + 6 ) title('log10(acceleration magnitude m/s^2)') colorbar zoom on axis equal drawnow %% countour(X, Y, Z, number_of_countours) figure % use +6 to convert from log(Mm/s^2) to log(m/s^2). contour(Gx, Gy, loga + 6, 14); axis equal colorbar zoom on title('log10(acceleration magnitude m/s^2)') xlabel('position in Mm') ylabel('position in Mm') drawnow %% countour(X, Y, Z, [list of contour Z values]) figure % use +6 to convert from log(Mm/s^2) to log(m/s^2). contour(Gx, Gy, loga + 6, -9:3); axis equal colorbar zoom on title('log10(acceleration magnitude m/s^2)') xlabel('position in Mm') ylabel('position in Mm') drawnow % select about 1/10 of the vectors % as "interesting" small accelerations. I = sort(loga(:)); num_vectors = min( ceil(length(I)/10), 1000 ); max_loga = I(num_vectors); [I2] = find( loga < max_loga ); [I,J] = find( loga < max_loga );% This seems redundant. figure %quiver(J,I, ax(I2), ay(I2) ) quiver(Gx(J),Gy(I), ax(I2), ay(I2) ) axis equal title('acceleration vector') xlabel('position in Mm') ylabel('position in Mm') zoom on drawnow figure quiver(Gx(J),Gy(I), a_theta_x(I2), a_theta_y(I2) ) axis equal title('tangential acceleration vector') xlabel('position in Mm') ylabel('position in Mm') zoom on drawnow % avoid using quiver for very detailed graphs -- % -- it rapidly runs out of RAM. if( prod(size(loga)) < 10000 ), % looking for small accelerations, so % clip painful accelerations to some maximum value % (but leave pointed the same direction) figure I = find( max_loga < loga ); normalize = 10.^(max_loga - loga); clipped_ax = ax; clipped_ax(I) = normalize(I) .* ax(I); clipped_ay = ay; clipped_ay(I) = normalize(I) .* ay(I); quiver(Gx, Gy, clipped_ax, clipped_ay) axis equal title('acceleration vector') xlabel('position in Mm') ylabel('position in Mm') zoom on drawnow end; % draw radial information figure loga_radial = log( sqrt( a_radial_x.^2 + a_radial_y.^2) )/log(10); imagesc( loga_radial + 6 ) title('log10(radial acceleration magnitude m/2^2)') colorbar zoom on drawnow % end draw radial information % draw tangential information loga_theta = log( sqrt(a_theta_x.^2 + a_theta_y.^2) )/log(10); figure % use +6 to convert from log(Mm/s^2) to log(m/s^2). imagesc( loga_theta + 6 ) title('log10(tangential acceleration magnitude m/s^2)') colorbar zoom on axis equal drawnow %% countour(X, Y, Z, number_of_countours) figure % use +6 to convert from log(Mm/s^2) to log(m/s^2). contour(Gx, Gy, loga_theta + 6, 14); title('log10(tangential acceleration magnitude m/s^2)') xlabel('position in Mm') ylabel('position in Mm') colorbar axis equal zoom on drawnow % avoid using quiver for very detailed graphs -- % -- it rapidly runs out of RAM. if( prod(size(loga_theta)) < 10000 ), % looking for small accelerations, so % clip painful accelerations to some maximum value % (but leave pointed the same direction) % select about 1/10 of the vectors % as "interesting" small accelerations. I = sort(loga_theta(:)); num_vectors = min( ceil(length(I)/10), 1000 ); max_loga_theta = I(num_vectors); figure I = find( max_loga_theta < loga_theta ); normalize = 10.^(max_loga_theta - loga_theta); clipped_ax = a_theta_x; clipped_ax(I) = normalize(I) .* a_theta_x(I); clipped_ay = a_theta_y; clipped_ay(I) = normalize(I) .* a_theta_y(I); quiver(Gx, Gy, clipped_ax, clipped_ay) axis equal title('tangential acceleration vector (not to scale)') xlabel('position in Mm') ylabel('position in Mm') zoom on drawnow end; % end draw tangential information ' done !' % end lagrange_function.m