Page 1 of 1
functional form of "hat functions"
Posted: November 5th, 2007, 4:05 pm
by erstwhile
i can't remember the functional form of these functions that you use in the theory of distirbutions ...if you have a region equal to zero at and below X0 and also at and above X1, but equal to unity between X0+a and X1-a,then you can hook these regions together using a hat function that is continuous at X0 and X0+a, and is differentiable to all orders at all points.i used this in mathematical physics (functions having "compact support") in the mid 1980s and can't remember the functional forms of the hat functions.vaguely it was something like exponentials of ratios of some kind of function ...can anyone fill me in?thanks
functional form of "hat functions"
Posted: November 5th, 2007, 4:18 pm
by Cuchulainn
I used hat functions in FEM but these are piecewise polynomials of degree 1 (hence 'hat') and have compact support on a small interval [x-h, x+h] and they zero at the end points and equal to 1 at x. You can write a function as a linear combination of hat functions. But the exponential part is not clear, is this some kind of smoothing? It might be uniform in the middel with exponential tails. see your pm
functional form of "hat functions"
Posted: November 5th, 2007, 4:54 pm
by Alan
Try f(x) = exp -[(x - c)/(x-b)]^2 to connect your b = X0 and your c = X0+aregards, p.s. oops, this does not have d^n f/dx^n = 0 at x = c for all n >= 1, but will leave it until somebody posts the real answeranother try:f(x) = exp -[(x-b)^(-2) exp(-1/(x-c)^2)] = exp(h(x))We have f(b) = 0; f(c) = exp(0) = 1; (good)f'(x) = h'(x) f(x), so f'(b) = 0, f'(c) = h'(c) f(c) = 0; (good)f''(x) = [h''(x) + (h'(x))^2] f(x); so f''(b) = 0; f''(c) = [h''(c) + (h'(c))^2] f(c) = 0. (good)Looks promising to me.
functional form of "hat functions"
Posted: November 5th, 2007, 6:50 pm
by erstwhile
Ah - got it ...F(x)=(A/a)exp[-a^2/(a^2-x^2)]F(x) is defined this way in the interval -a<x<+a and is taken to be zero outside this interval.All derivatives exist to all orders and at +/- a they vanish identically, assuming the value zero at these points.Very handy for smoothing out jumps when you have a root-finder!Thanks guys
functional form of "hat functions"
Posted: November 5th, 2007, 8:24 pm
by Cuchulainn
QuoteF(x)=(A/a)exp[-a^2/(a^2-x^2)]F(x) is defined this way in the interval -a<x<+a and is taken to be zero outside this interval.A mollifier! Indeed C infinity smooth on R(n) space and compact support.
functional form of "hat functions"
Posted: June 28th, 2009, 6:49 am
by Cuchulainn
A belated post. The canonical mollifier (KO Friedrichs) in 1d and 2d are defined by the formula and useful for smoothing functions (even in sense of distributions). They might be useful..double mollifier(double x){ // Basis mollifier on [-1,1] double d = fabs(x); if (d < 1) { return exp(- 1.0/(1.0 - d*d)); } return 0.0;}double mollifier2D(double x, double y){ return mollifier(x) * mollifier(y);}
functional form of "hat functions"
Posted: June 28th, 2009, 6:59 am
by Cuchulainn
Here is a graph of 2d smoothers
functional form of "hat functions"
Posted: June 16th, 2013, 11:11 am
by Cuchulainn
QuoteOriginally posted by: erstwhileAh - got it ...F(x)=(A/a)exp[-a^2/(a^2-x^2)]F(x) is defined this way in the interval -a<x<+a and is taken to be zero outside this interval.All derivatives exist to all orders and at +/- a they vanish identically, assuming the value zero at these points.EW and all,Let's say we have a linear polynomial p(x) (hat function)p(x) = 1 + x, for -1 <= x <= 0p(x) = 1 -x , for 0 <= x <= 1p(x) = 0 outside the interval [-1,1]Can we use the mollifier to smooth the kink at x = 0 and get a curve that is infinitely differentiable?An analytic formula for all values in [-1,1] would be ideal, or at least something that can easily be computed.