% Script: TestProb53
% Description:  Contains test problem for use by Steady
% Try alpha = 1, beta = 2, d = pi/6 for this problem
% The alternate map to ln won't work at all here...no exp decay.
% This is Example 5.3 of paper.  First execute this file,
% then execute "TestSteady".

% Problem parameters
global G = 0.5; % flux rhs in BC.
global A = 1; % coefficient of c(0) in BC
global B = -0.5; % coefficient of c'(0) in BC
global edecay = 0; % exponential decay (0=false)

% DEFINE EXACT SOLUTION

function retval = csoln(x)
% usage: csoln(x)
% description: this computes the solution function csoln(x)

retval = (1+x^2)/(1-x+x^4);

endfunction

%

function retval = csolnp(x)
% usage: csolnp(x)
% description: this computes the solution derivative csoln'(x)

tmp = (1-x+x^4);
retval = (2*x*tmp - (1+x^2)*(4*x^3-1))/tmp^2;

endfunction

%

function retval = csolnpp(x)
% usage: csolnpp(x)
% description: this computes the solution's second derivative csoln''(x)

retval = 2*(2-12*x^4-6*x^2+6*x^5+3*x^8-2*x^3+10*x^6)/(1-x+x^4)^3;

endfunction

% DEFINE THE COEFFICIENTS:

function retval = D(x)
% usage: D(x)
% description: this computes the fcn D(x)
% Reminder: If you change this, you must also change Dp

retval =  1 - exp(-2*x)/2;

endfunction

%

function retval = Dp(x)
% usage: Dp(x)
% description: this computes the fcn D'(x)

retval =  exp(-2*x);

endfunction

%

function retval = v(x)
% usage: v(x)
% description: this computes the fcn v(x)
% Reminder: If you change this, you must also change vp

retval = 1;
%retval =  1 - exp(-2.5*x)/3;

endfunction

%

function retval = vp(x)
% usage: vp(x)
% description: this computes the fcn v'(x)

retval = 0;
%retval =  1 - exp(-2.5*x)/3;

endfunction

%

function retval = lam(x)
% usage: lam(x)
% description: this computes the fcn lam(x)

retval = 1;

endfunction

%

function retval = f(x)
% usage: f(x)
% description: this computes the fcn f(x)

% computer generated by Maple
t1 = x*x;
t2 = t1*x;
t3 = t1*t1;
t4 = t3*x;
t5 = t3*t3;
t6 = t3*t2;
t7 = t3*t1;
t8 = t5*x;
t11 = exp(-2.0*x);
t21 = t5*t1+t11-17.0*t11*t3+4.0*t11*t6+6.0*t11*t4+ ...
3.0*t11*t5+9.0*t11*t7+2.0*t11*t8+t11*t2-t11*x-3.0*t11*t1; 
t23 = 1.0-x+t3;
t24 = t23*t23;
retval = (-2.0+11.0*t1-t2-x+32.0*t3-14.0*t4-5.0*t5-6.0*t6-17.0*t7- ...
2.0*t8+t21)/t24/t23;

endfunction

% DEFINE THE WEIGHT FUNCTION

function retval = p(x)
% REMINDER:  p(0) must equal 1
% usage: p(x)
% description: this computes the weight fcn p(x)

% If you change this, you must also change pp(x)
retval = exp(-x);
%retval = 1/(1+x^2);

endfunction

%

function retval = pp(x)
% usage: pp(x)
% description: this computes the bdy fcn p'(x)

retval = -exp(-x);
%retval = -2*x/(1+x^2)^2;

endfunction

%

