% Script: TestInvProb1 % Description: Contains test problem for use by TestInvSteady % Try alpha = 1, bta = 1, d = pi/3 for this example. % The alternate conformal to ln works, albeit not as well, % and *without* economization. % Forward problem is Example 5.1 of MS paper. % Problem parameters global G = 1; % 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 = 1; % exponential decay (0=false) % DEFINE EXACT SOLUTION function retval = csoln(x) % usage: csoln(x) % description: this computes the solution function csoln(x) retval = exp(-(x/2)^2); endfunction % function retval = csolnp(x) % usage: csolnp(x) % description: this computes the solution derivative csoln'(x) retval = -0.5*x*exp(-(x/2)^2); endfunction % function retval = csolnpp(x) % usage: csolnpp(x) % description: this computes the solution's second derivative csoln''(x) retval = (-0.5+0.25*x^2)*exp(-(x/2)^2); 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; endfunction % function retval = vp(x) % usage: vp(x) % description: this computes the fcn v'(x) retval = 0; 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 t4 = exp(-x*(8.0+x)/4); t7 = x*x; t8 = t7/4.0; t9 = exp(-t8); t13 = exp(-t8-2.0*x); retval = x*t4/2+3.0/2.0*t9-t13/4-t7*t9/4+t7*t13/8-x*t9/2; 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.^2); retval = exp(-x); endfunction % function retval = pp(x) % usage: pp(x) % description: this computes the bdy fcn p'(x) %retval = -2*x*exp(-x^2); retval = -exp(-x); endfunction %