function value = ff ( x ) %% FF evaluates the function F in the differential equation. % % Discussion: % % This is the function F(X) that appears on the right hand % side of the equation: % % -d/dx ( P(x) * dU(x)/dx ) + Q(x) * U(x) = F(x) % % Modified: % % 05 November 2006 % % Parameters: % % Input, real X, the evaluation point. % % Output, real VALUE, the value of F(X). % % % Find out which problem we're working on. % problem = get_problem ( 'DUMMY' ); if ( problem == 1 ) value = 0.0; elseif ( problem == 2 ) value = -2.0 * x; elseif ( problem == 3 ) value = 0.25 * pi^2 * sin ( 0.5 * pi * x ); elseif ( problem == 4 ) value = 0.25 * pi^2 * cos ( 0.5 * pi * x ); elseif ( problem == 5 ) beta = get_beta ( 'DUMMY' ); value = - ( x^beta ) + ( x^( beta + 2.0 ) ) ... / ( ( beta + 2.0 ) * ( beta + 1.0 ) ); elseif ( problem == 6 ) alpha = get_alpha ( 'DUMMY' ); value = 2.0 * alpha * ( x - 0.5 ) ... / ( alpha^2 + ( x - 0.5 )^2 )^2; end