Question: dynamic build of piecewise function

Hi,

 

I would like to build a piecewise function automatically.

I would like something like this but with 33 pieces:

> piecewise(0<=t and t<1, f[1](t)[i][j], 1<=t and t<2, f[2](t-1)[i][j], 2<=t and t<3, f[3](t-2)[i][j], ...,0);

I tried to use the seq command, and it worked with the condition argument of piecewise.:

> seq(1-q<=t and t<q,q=1..3);
          -t <= 0 and t < 1, -1 - t <= 0 and t < 2, -2 - t <= 0 and t < 3

However, when trying to add also the function piece, it results in an error.

>  seq(1-q<=t and t<q, f[q](t+1-q)[i][j],q=1..3);
Error, wrong number (or type) of parameters in function seq

Is there a sophisticated way for building maple expressions and calling them?

Best regards,

Zoltan Faigl

Please Wait...