function [] = prob_13_11_c() % % Written by: % -- % John L. Weatherwax 2006-09-05 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- close all; v_l = [ 1 1 ]; v_r = [ 0.1 4 ]; q = linspace( 0.01, 2, 100 ); figure; hold on; % plot the state v_l: % hsvl = plot( v_l(1), v_l(2), 'b.', 'MarkerSize', 15 ); % plot one-integral/Hugoniot curves through v_l: % qu_prod = v_l(1)*v_l(2); u1 = qu_prod ./ q; hvlc = plot( q, u1, '-b' ); % plot the state v_r: % hsvr = plot( v_r(1), v_r(2), 'r.', 'MarkerSize', 15 ); % plot two-integal/Hugoniot curves through v_r: % u2 = repmat(v_r(2),1,length(q)); hvrc = plot( q, u2, '-r' ); % Plot the middle state (intersection of the two wave curves): % q_star = v_l(1)*v_l(2)/v_r(2); u_star = v_r(2); hvs = plot( q_star, u_star, 'k.', 'MarkerSize', 15 ); % Add some labels: % axis( [ 0 2 0 10 ] ); xlabel( 'q' ); ylabel( 'u' ); grid on; legend( [ hsvl hvlc hsvr hvrc hvs ], { ... '(q_l,v_l)', 'wave curve through v_l', ... '(q_r,v_r)', 'wave curve through v_r', ... '(q_*,v_*): Riemann intersection point' } ); saveas( gcf, 'prob_13_11_pt_c_pp.eps', 'psc2' ); % Draw the x-t diagram: % figure; hold on; line( [ 0; v_r(2)*1 ], [ 0 ; 1 ] ); line( [ 0; 0 ], [ 0 ; 1 ] ); text( -.5, .5, '(q_l,u_l)' ); text( .5, .5, '(q_*,u_r)' ); text( 1.5, .2, '(q_r,u_r)' ); text( 1.6, .5, '\lambda^2 = u_r' ); axis( [ -1 2 0 1 ] ); xlabel( 'x' ); ylabel( 't' ); %grid on; saveas( gcf, 'prob_13_11_pt_c_xt.eps', 'psc2' );