function [ uex, uexx ] = exact ( x ) % % [ uex, uexx ] = exact ( x ) % % EXACT returns the value of the exact solution U and its derivative dU/dX at X. % % X(*) is the point or points of evaluation. % % UEX(*) is the value of U at X. % UEXX(*) is the value of dU/dX at X. % n = length ( x ); uex(1:n) = sin ( pi * x(1:n) ); uexx(1:n) = pi * cos ( pi * x(1:n) );