function value = ff ( x, problem ) %% FF evaluates the right hand side function F(X) at any point X. % % Modified: % % 03 November 2006 % % Author: % % Max Gunzburger % Teresa Hodge % % MATLAB translation by John Burkardt % % Parameters: % % Input, real X, the evaluation point. % % Input, integer PROBLEM, indicates the problem being solved. % 1, U=1-x**4, P=1, Q=1, F=1.0+12.0*x**2-x**4. % 2, U=cos(0.5*pi*x), P=1, Q=0, F=0.25*pi*pi*cos(0.5*pi*x). % % Output, real VALUE, the value of F(X). % % % Test problem 1 % if ( problem == 1 ) value = 1.0 + 12.0 * x^2 - x^4; % % Test problem 2 % elseif ( problem == 2 ) value = 0.25 * pi * pi * cos ( 0.5 * pi * x ); end