Hat functions

Let’s define a set of 6 nodes (i.e., \(n=5\) in our formulas).

using FundamentalsNumericalComputation
t = [0, 0.075, 0.25, 0.55, 0.7, 1]
6-element Array{Float64,1}:
 0.0
 0.075
 0.25
 0.55
 0.7
 1.0

We plot the hat functions \(H_0,\ldots,H_5\).

plot([x->FNC.hatfun(x,t,k) for k=0:5],0,1,label="",
    xlabel="\$x\$", ylabel="\$H_k(x)\$", title="Hat functions")