% Script: TestPar61 % Description: Contains test problem for use by TestParab.m % Try alpha = 1, beta = 1, d = pi/3 for this example % This example is used in the paper related to 6.1 % Problem parameters global A = 1.0; % 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,t) % usage: csoln(x,t) % description: this computes the solution function csoln(x) retval = (1-cos(pi*t/4))*exp(-t*x^2/8); 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,t) % usage: f(x,t) % description: this computes the fcn f(x,t) % computer generated by Maple t1 = x*x; t2 = t*t1; t4 = exp(-t2/8.0); t6 = 0.3141592653589793E1*t/4.0; t7 = cos(t6); t11 = exp(-2.0*x); t12 = t11*t; t15 = t1*x; t18 = t7*x; t20 = t1*t7; t22 = t*t; t23 = t22*t1; t31 = t22*t15; t34 = t11*t7; t38 = -32.0-8.0*t2*t7-4.0*t12*x-4.0*t15*t7+32.0*t18-8.0*t20+ ... 2.0*t23+4.0*t12-t23*t11-8.0*t12*t1-4.0*t12*t7-2.0*t31*t7+t31*t34+4.0*t12*t18; t50 = sin(t6); t60 = t23*t34+8.0*t12*t20+8.0*t2+8.0*t1+4.0*t15-8.0*t-32.0*x+ ... 2.0*t31+8.0*t*t7-8.0*x*t50*0.3141592653589793E1-2.0*t23*t7- ... 16.0*t50*0.3141592653589793E1-t31*t11+32.0*t7; retval = -t4*(t38+t60)/(1.0+x)/32.0; endfunction % function retval = rho(x) % usage: rho(x) % description: this computes the fcn rho(x) retval = (2+x)/(1+x); endfunction % function retval = G(t) % usage: G(t) % description: this computes the fcn boundary term G(t) retval =1 - cos(pi*t/4); endfunction % function retval = g(x) % usage: g(x) % description: this computes the initial condition g(x) retval = csoln(x,0); 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 %