1
$\begingroup$

I have a quintic Hermite basis functions [-1,1] for FEM applications, I wanted to check if it's nodal functionals are proper. Could someone explain nodal functionals in details and give an example of how to check them. By nodal functionals, I meant N_i[phi_j] = delta_ij, where phi_j are my basis functions on [-1,1]. Nodal functionals act on functions.

Here are my basis functions enter image description here

And here is the interpolation of a simple sinusoid

enter image description here

I took zero'th, first and second derivatives of all of my basis functions and arrived at what looks like an identity matrix. enter image description here

I presume for the fourth basis function Python could not do floating point arithmetic very well. However, it seems to be close to 0 and 1 accordingly.

def N1(x):
  return -3*x**5/16 + 5*x**3/8 - 15*x/16 + 1/2

def dN1(x):
  return -15*x**4/16 + 15*x**2/8 - 15/16

def ddN1(x):
  return -60*x**3/16 + 30*x/8

def N2(x):
  return 3*x**5/16 - 5*x**3/8 + 15*x/16 + 1/2

def dN2(x):
  return 15*x**4/16 - 15*x**2/8 + 15/16

def ddN2(x):
  return 60*x/16 - 30*x/8

def N3(x):
  return -3*x**5/16 + x**4/16 + 5*x**3/8 - 3*x**2/8 - 7*x/16 + 5/16

def dN3(x):
  return -15*x**4/16 + 4*x**3/16 + 15*x**2/8 - 6*x/8 -7/16

def ddN3(x):
  return -60*x**3/16 + 12*x**2/16 + 30*x/8 - 6/8

def N4(x):
  return -3*x**5/16 - x**4/16 + 5*x**3/8 + 3*x**2/8 - 7*x/16 - 5/16

def dN4(x):
  return -15*x**4/16 - 4*x**3/16 + 15*x**2/8 + 6*x/7 - 7/16

def ddN4(x):
  return -60*x**3/16 - 12*x**2/16 + 30*x/8 + 6/8 

def N5(x):
  return -x**5/16 + x**4/16 + x**3/8 - x**2/8 - x/16 + 1/16

def dN5(x):
  return -5*x**4/16 + 4*x**3/16 + 3*x**2/8 - 2*x/8 - 1/16

def ddN5(x):
  return -20*x**3/16 + 12*x**2/16 + 6*x/8 - 2/8

def N6(x):
  return x**5/16 + x**4/16 - x**3/8 - x**2/8 + x/16 + 1/16

def dN6(x):
  return 5*x**4/16 + 4*x**3/16 - 3*x**2/8 - 2*x/8 + 1/16

def ddN6(x):
  return 20*x**3/16 + 12*x**2/16 - 6*x/8 - 2/8


funcs = [N1,N2,N3,N4,N5,N6]

Using these basis functions and calculating the following gave such answers

print(N1(-1), N1(1), dN1(-1), dN1(1), ddN1(-1), ddN1(1))
print(N2(-1), N2(1), dN2(-1), dN2(1), ddN2(-1), ddN2(1))
print(N3(-1), N3(1), dN3(-1), dN3(1), ddN3(-1), ddN3(1))
print(N4(-1), N4(1), dN4(-1), dN4(1), ddN4(-1), ddN4(1))
print(N5(-1), N5(1), dN5(-1), dN5(1), ddN5(-1), ddN5(1))
print(N6(-1), N6(1), dN6(-1), dN6(1), ddN6(-1), ddN6(1))
$\endgroup$
6
  • $\begingroup$ I already checked the basis functions by interpolating a simple sinusoidal function, but I wanted to have a more mathematical approach, using nodal functionals. $\endgroup$
    – Nomad
    Commented Feb 9 at 12:08
  • $\begingroup$ What do you mean by "nodal functionals"? Are you referring to nodal basis functions? Also, "proper" refer to them being correct? $\endgroup$
    – nicoguaro
    Commented Feb 9 at 12:20
  • $\begingroup$ Yes, by nodal functionals, I meant N_i[phi_j] = delta_ij, where phi_j are my basis functions on [-1,1]. Nodal functionals act on functions. $\endgroup$
    – Nomad
    Commented Feb 9 at 12:35
  • $\begingroup$ Also, would be highly appreciated if someone could help me how to correctly create a macro mesh out of a refined mesh. $\endgroup$
    – Nomad
    Commented Feb 9 at 12:52
  • 1
    $\begingroup$ In your case, the functionals are $f \mapsto f(1)$, $f \mapsto f(-1)$, $f \mapsto f'(1)$, $f \mapsto f'(-1)$, $f \mapsto f''(1)$, and $f \mapsto f''(-1)$. Let's call them $\mathcal{L}_i$. You need to confirm that your basis functions $f_j$ satisfy $\mathcal{L}_i(f_j) = \delta_{ij}$. That is, for each basis element only one functional should evaluate to $1$ while the rest yields $0$. $\endgroup$
    – cos_theta
    Commented Feb 9 at 12:56

1 Answer 1

2
$\begingroup$

If you have functions $\phi_1,\ldots,\phi_n : \mathbb{R}\to \mathbb{R}$ they satisfy the Lagrange property on $x_1,\ldots,x_n\in\mathbb{R}$ if $\phi_j(x_i) = \delta_{ij}$. This allows linear combinations of those $u(x) = \sum_{j=1}^n y_j\phi_j(x)$ to be interpolating at the points since $$u(x_i) = \sum_{j=1}^n y_j \phi_j(x_i) = \sum_{j=1}^n y_j \delta_{ij} = y_i.$$

More generally, if you have functions $$\phi_{0,1}, \ldots, \phi_{p,1}, \phi_{0,2},\ldots,\phi_{p,2}, \ldots, \phi_{0,n},\ldots,\phi_{p,n},$$ they satisfy the Hermite-Lagrange property of degree $p$ on $x_1,\ldots,x_n$ if $$\frac{d^k\phi_{l,j}}{dx^l}(x_i) = \delta_{ij}\delta_{kl}.$$ This means that the functions and their derivatives up to degree $p$ are interpolating at the points. This is the case since: $$\frac{d^ku}{dx^k}(x_i) = \sum_{l=0}^p \sum_{j=0}^n y_{l,j}\frac{d^k\phi_{l,j}}{dx^k}(x_i) = \sum_{l=0}^p \sum_{j=1}^n y_{l,j} \delta_{ij}\delta_{kl} = y_{k,i}.$$

In your case $x_1 = -1$ and $x_2 = 1$ and $\phi_{0,1}(x)$ is the first row and $\phi_{0,2}(x)$ is the second row of your matrix. You can check that $\phi_{0,j}(x_i) = \delta_{ij}$ by plugging $-1$ and $1$ in these polynomials. If this is indeed an Hermite polynomial you should also be able to verify that $\phi_{l,j}(x_i) = 0$ for $l\geq 0$ by taking derivatives and plugging in $-1$ and $1$. A similar thing holds for the remaining functions, except that the third and 4th probably interpolate first derivatives, and the last two interpolate the second derivatives at the endpoints.

The "nodal functionals" are just a fancy way of calling the evaluation functionals (composed with derivatives in the Hermite case) at the nodes. That is $N_i = \delta_{x_i}$ such that $N_i\phi_j = \delta_{x_i}\phi_j = \phi_j(x_i)$, or $N_{k,i} = \delta_{x_i} \circ \frac{d^k}{dx^k}$ such that $$N_{k,i}\phi_{l,j} = \left(\delta_{x_i} \circ \frac{d^k}{dx^k}\right)\phi_{l,j}(x) = \frac{d^k\phi_{l,j}}{dx^k}(x_i).$$ With those you can write what I did in a fancy way: $$N_{k,i}\phi_{l,j} = \frac{d^k\phi_{l,j}}{dx^l}(x_i)= \delta_{ij}\delta_{kl}.$$

$\endgroup$
17
  • $\begingroup$ Do you mean I just need to plug in -1 and 1 to each of my basis functions and their respective first and second derivatives and when I plug these values in each of the basis functions, only one of them should 1, and the same goes for the second basis function and so on? $\endgroup$
    – Nomad
    Commented Feb 9 at 14:30
  • $\begingroup$ @NurbekSaidnassim Yes $\frac{d^k\phi_{l,j}}{dx^k}(x_i)$ should be one only for $i=j$ and $k=l$ and zero for the other $x_j$ and the other derivatives. In fact that's how you derive the above functions (there are also available closed-form expressions for the general Hermite-Lagrange basis functions too but they are not pretty). $\endgroup$
    – lightxbulb
    Commented Feb 9 at 14:34
  • $\begingroup$ @lightxbulb, yes that's what I explained in a previous post and how I derived the ones for the quintic interpolation. $\endgroup$
    – nicoguaro
    Commented Feb 9 at 22:24
  • 1
    $\begingroup$ @NurbekSaidnassim "I am not sure what you mean by Hermite - Lagrange property" - yet it is in my answer. The requirement that the matrix that you printed be equal to the identity is the Hermite-Lagrange property in matrix form, i.e. the interpolation property of the basis functions w.r.t. the nodal functionals. Unsurprisingly you have a typo in dN4 which lead you to a non-identity matrix. It's not floating point precision, it's just sloppy coding. $\endgroup$
    – lightxbulb
    Commented Feb 10 at 18:36
  • 1
    $\begingroup$ @NurbekSaidnassim That's an entirely separate question that probably deserves its own thread. Also it's not done by coarsifying the mesh - you just tie the derivatives at the inner nodes which reduces the degrees of freedom by 2 in your case by per inner node. $\endgroup$
    – lightxbulb
    Commented Feb 10 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.