Commit bf7ab94c authored by Sergey Litvinov's avatar Sergey Litvinov

Update del.m

parent 750b00f8
......@@ -11,8 +11,10 @@ y = rand(n, 1);
function w = wk(r)
global rc
A = 1;
r /= rc; r *= 2;
if r < 1; w = 1 - 3/2*r^2
r = abs(r); r /= rc; r *= 2;
if r < 1; w = (r^2*(3*r-6)+4)/4;
elseif r < 2; w = -(r-2)^3/4;
else w = 0; endif
endfunction
function r = wrap(r, r0)
......@@ -36,6 +38,6 @@ for i = 1:n; for j = 1:n
if i == j; continue; endif
r = dist(i, j);
if r > rc; continue; endif
w = wk(i)
d(i) += wk(r);
endfor; endfor
......@@ -31,3 +31,8 @@ f00: horner(f00);
f10: factor(f10);
draw2d(explicit(f00, x, 0, 1), explicit(f10, x, 1, 2)) $
i2(e, lo, hi):=integrate(%pi*'x*e, 'x, lo, hi);
I: i2(f00, 0, 1) + i2(f10, 1, 2);
A: 1/I;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment