rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
exact_function_plaplace.m
Go to the documentation of this file.
1 function res = exact_function_plaplace(glob, params)
2 %function res = exact_function_plaplace(glob, params)
3 % This is the first function from
4 % http://eqworld.ipmnet.ru/en/solutions/npde/npde1201.pdf
5 %
6 % This implements the function
7 % ``
8 % u(x,y,t) = \left(
9 % -\frac{\lambda p}{m} x
10 % - \frac{\lambda^2}{m} t
11 % + A
12 % \right)^{\frac{1}{p}}
13 % ``
14 % solving the PDE
15 % ``
16 % \partial_t u = - \partial_x \left( u^p \partial_x u \right)
17 % ``
18 % where '[x,y]' is given by 'glob', and the function parameters are read from
19 % 'params'. We use this function for an EOC test of our newton_model().
20 %
21 % parameters:
22 % glob: global coordinate vectors
23 % params: parameter specifying the function
24 %
25 % required fields of params:
26 % t: time instance at which the spatial solution is computed
27 %
28 % optional fields of params:
29 % plaplace_A: scalar specifying constant `A` (Default = 1.0)
30 % plaplace_lambda: scalar specifying constant `\lambda` (Default = 0.8)
31 % diff_p: scalar specifying the exponent constant 'p' (Default = 0.5)
32 % diff_m: scalar specifying the constant 'm' (Default = 1.0)
33 
34  t = params.t;
35 
36  if ~isfield(params, 'plaplace_A')
37  params.plaplace_A = 1.20;
38  end
39 
40  if ~isfield(params, 'plaplace_lambda')
41  params.plaplace_lambda = 0.8;
42  end
43  %A = params.plaplace_A;
44  %lambda = params.plaplace_lambda;
45 
46  if ~isfield(params, 'diff_p')
47  params.diff_p = 0.5;
48  end
49  %p = params.diff_p;
50 
51  if ~isfield(params, 'diff_m')
52  params.diff_m = 1.0;
53  end
54  %m = params.diff_m;
55 
56  X = glob(:,1);
57  %Y = glob(:,2);
58 
59 % res = (-lambda * p/m * X - lambda^2*p/m*t + A).^(1/p);
60 
61  res = X + t;
62 
function res = exact_function_plaplace(glob, params)
This is the first function from http://eqworld.ipmnet.ru/en/solutions/npde/npde1201.pdf.