Question: How to find all derivatives in expression that are used for initial conditions?

I gave up on this. I know how to find all normal derivatives such as diff(y(x),x) and diff(y(x),x$2) so on in expression. 

But now I want to find all those used for initial conditions, which do not have x in them. This makes it harder.

These have the form   D(y)(0) or (D@@2)(y)(1) and so on.

I tried indets and select and many other things, but can't figure how to tell Maple to find these in expression. Here is an example.

Given

expr:=y(3)+y(8)+5*(D@@2)(y)(4)+Pi+3*exp(2)+77*D(y)(0)+1/(D@@4)(y)(7);

I'd like to get list that has in it only the derivatives and nothing else, anywhere they show, which will be

{(D@@2)(y)(4) , D(y)(0) , (D@@4)(y)(7) }

some of the things I tried are

indets(expr,'satisfies'(s->op(0,s)=(D@@n)(y) and n::integer) );
indets(expr,'specfunc(anything, D)');
indets(expr,'specfunc(anything, (D@@anything)(y))');

And many more. I still struggle with structured types in Maple.

In the above, we can assume the dependent variable is always same which is the 'y' symbol.

I can do the above using patmatch. But I am trying to move away from that in Maple and use types.

For reference, this is what I do using another software. I am trying to do the same in Maple, but using structured types and not patmatch.

Iam sure there is a way to do this in Maple using structured types, but so far not able to figure the syntax needed.

Maple 2025.1

Please Wait...