Integrating BSplineCurve in Maple 8

Hello everybody,

does anyone know how to integrate the output of BsplineCurve in maple 8? I can plot it over a given interval, but if I try to perform the corresponding definite integral, I get the following error message:

Error, (in int) wrong number (or type) of arguments

as opposed to the output of the Spline routine, which can be integrated without problems.

Thank you for your help.

gulliet's picture

Piecewise vs Parametric Form

I do not have Maple 8 at hand, but the issue seems to be related to the structure of the result returned by both functions. Spline returns a piecewise function, whereas BSplineCurve returns a parametric function. So the first structure can be directly integrated. Here is what we can read in Maple 11 online help for Spline,

The Spline routine computes a degree d piecewise polynomial in variable v that approximates the points {(x0, y0), (x1, y1), ..., (xn, yn)}.

and for BSplineCurve,

The resulting curve is in parametric form [xf(v), yf(v), v=a..b], where xf(v) and yf(v) are piecewise functions of v, and a..b is the range over which the B-spline curve is defined.

with(CurveFitting):
Spline([[0,0],[1,1],[2,4],[3,3]], v);

                /       1     4  3         14   41     42  2      3  
       piecewise|v < 1, - v + - v , v < 2, -- - -- v + -- v  - 2 v , 
                \       5     5            5    5      5             

           114   151     54  2   6  3\
         - --- + --- v - -- v  + - v |
            5     5      5       5   /

type(%, piecewise);
                                    true

Does this match your problem with Maple 8?

Regards,
--
Jean-Marc

Thank you, that is indeed

Thank you, that is indeed the core of the problem

Robert Israel's picture

BSplineCurve

The output of BSplineCurve is in parametric form [x(t), y(t), t=a..b]. If by "integrate the output" you mean you want int(y,x=x[a]..x[b]), that would be

Thus:

> C:= BSplineCurve(..., t);
  int(C[2]*diff(C[1],t), C[3]);

Thanks a lot, I guess that

Thanks a lot, I guess that will certainly be helpful. It is nevertheless interesting that the plot command works when specifying a given x-range.

JacquesC's picture

Why plot works

That is because you can give a parametric definition to plot. How to do that? Why, by giving a list with 3 elements [f(t), g(t), t=a..b], that's how. Hum, rather like the output of BSplineCurve!

That's not a coincidence at all. In fact, parametric plot came first, and then some clever designer [I don't know who in this case, but I do have a guess] reused that same data-structure for the output of BSplineCurve, so as to obtain automatic composability!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}