function [] = prob_16_1_pt_a() % % Written by: % -- % John L. Weatherwax 2006-09-07 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- close all; x_grid = linspace( -3, +3, 25 ); indlt = find( x_grid <= 0 ); indgt = find( x_grid > 0 ); % Draw the x-t diagram solution to this Riemann problem (at time="time"): % time=1.0; fpqr = 12; % the characteristic speeds in the right state x_grid_at_time = zeros(size(x_grid)); x_grid_at_time(indlt) = x_grid(indlt); x_grid_at_time(indgt) = x_grid(indgt) + fpqr*time; figure; hold on; %line( [ x_grid; x_grid_at_time ], [ zeros(size(x_grid)) ; time*ones(size(x_grid)) ] ); line( [ x_grid; x_grid_at_time ], [ 0; time ] ); %axis( [ -1 2 0 1 ] ); xlabel( 'x' ); ylabel( 't' ); %grid on; saveas( gcf, 'prob_16_1_pt_a.eps', 'psc2' );