Question: how to use evalindets on anything except some specific functions?

evalindets API says 

             evalindets( expr, atype, transformer, rest )

Where the transformer will be applied on any indents of atype.

But I want to be able to do the opposit, i.e. 

             evalindets( expr, except_this_atype, transformer, rest )

ie. apply the transformer on everything except those of atype.

Here is a concrete example and what I tried.

I get result of apply inverse Fourier transform which can have some terms in it which can not be evaluated. Like this

Y:=(s+1)/s^2+Int(sqrt(s^2),s);
expr:=inttrans:-invlaplace(Y,s,t);

Now I want to evaluate the above at some specific value of t, say t=0 but I do not want change/touch any "t" inside invlaplace(....) function. 

If I just do 

eval(expr,t=0)

So I tried evalindets with flat option and used for atype anything, then inside the transformer, check if op(0,X) is invlaplace (i.e the head), and if so, skip it. But it did not work

Y:=(s+1)/s^2+Int(sqrt(s^2),s);
expr:=inttrans:-invlaplace(Y,s,t);
evalindets[flat](expr,anything,X->`if`( evalb(op(0,X)='invlaplace'),X,eval(X,t=0)));
evalindets[flat](expr,anything,X->`if`( op(0,X)='invlaplace',X,eval(X,t=0)));



Currently what I do to make this to work, is to first replace the "t" inside invlaplace by another unused symbol, then do the eval to change t, then replace the symbol back to t.

Like this, and this works:

Y:=(s+1)/s^2+Int(sqrt(s^2),s);
expr:=inttrans:-invlaplace(Y,s,t);
expr:=evalindets[flat](expr,'specfunc(anything,invlaplace)',X->eval(X,t=T));
expr:=eval(expr,t=0);
expr:=eval(expr,T=t);

Is it possible to do the above using one call to evalindets?  Why did the check I had the above using `if`(...) not work?

It will be really useful if evalindets had option NOT atype,  in addition of just atype.

i.e. tell it to do the transformation on everything except the type given.

Maple 2024.2

 

Please Wait...