Question: Integral of product of B-splines

I wrote the following procedure that evaluates i-th B-spline basis function of degree n over the knot vector T:

N := proc(i, n, t, T)

if (n = 0) then
    if ((t >= T[i]) and (t < T[i+1])) then
        return 1.0:
    else
        return 0.0:
    fi:
fi:

return (evalf((t-T[i])/(T[i+n]-T[i]))*N(i, n-1, t, T) + evalf((T[i+n+1]-t)/(T[i+n+1]-T[i+1]))*N(i+1, n-1, t, T)):

end proc:

 

Now, I want to compute

int(N(i, n, t, T)*N(j, n, t, T), t=0..1, numeric),

where i, n and T are given. However, Maple evaluates N and, since t is unknown, I get the following error:

"Error, (in N) cannot determine if this expression is true or false: .1 <= t and t < .25"

In http://www.maplesoft.com/support/help/Maple/view.aspx?path=evalf/Int  I read that in order to integrate a procedure, one should write (see the example given there)

evalf(Int(N*N, 0..1));

however, in my case, It will not work because I must pass the known parameters i, n and T. Is there a way to solve my problem?

 

 

 

 

Please Wait...