Items tagged with indets

Feed

indets(AA(MM(AA(X1,X2),B2),MM(AA(B2,X3),X5)));
this can get a list of X1,X2,B2,X3,X5

propositionsentence := MM(AA("it", "run"), "maple"):
indets(propositionsentence);

but this can not get "it", "run", "maple"

how to do this in case this in maple 12?
 

Hello,

I would like to extract from a equation only the list of variables depending of time.

eq:= x0(t)+sin(alpha0(t))*sin(gamma0(t))*sin(beta0(t))*xb[1]-sin(alpha0(t))*sin(beta0(t))*cos(gamma0(t))*zb[1]-sin(alpha0(t))*cos(beta0(t))*yb[1]+cos(alpha0(t))*sin(gamma0(t))*zb[1]+cos(alpha0(t))*cos(gamma0(t))*xb[1]-l2[1]*(sin(psi[1](t))*sin(alpha0(t))*sin(gamma0(t))*sin(beta0(t))-cos(psi[1](t))*sin(alpha0(t))*sin(beta0(t))*cos(gamma0(t))+sin(psi[1](t))*cos(alpha0(t))*cos(gamma0(t))+cos(psi[1](t))*cos(alpha0(t))*sin(gamma0(t)))-l3[1]*(sin(theta[1](t))*sin(psi[1](t))*sin(alpha0(t))*sin(beta0(t))*cos(gamma0(t))+sin(theta[1](t))*cos(psi[1](t))*sin(alpha0(t))*sin(gamma0(t))*sin(beta0(t))+cos(theta[1](t))*sin(psi[1](t))*sin(alpha0(t))*sin(gamma0(t))*sin(beta0(t))-cos(theta[1](t))*cos(psi[1](t))*sin(alpha0(t))*sin(beta0(t))*cos(gamma0(t))-sin(theta[1](t))*sin(psi[1](t))*cos(alpha0(t))*sin(gamma0(t))+sin(theta[1](t))*cos(psi[1](t))*cos(alpha0(t))*cos(gamma0(t))+cos(theta[1](t))*sin(psi[1](t))*cos(alpha0(t))*cos(gamma0(t))+cos(theta[1](t))*cos(psi[1](t))*cos(alpha0(t))*sin(gamma0(t)))-xp[1](t) = 0;

I think the indets function should help be.

indets(lhs(eq)-rhs(eq), function(t))

The last argument of the indets is wrong but should enable to explain my need.

Thanks a lot for your help

Can anyone tell me what is going on in the following worksheet? 


restart:

 

The following type  matches any second-or-higher-order derivative specified in D form with independent variables. You don't need to understand how this type works---which is, admittedly, convoluted---in order to understand the rest of this post.


TypeTools:-AddType(
     HODD,
     {typefunc(
           name,
           typefunc(
                name,
                {'`@@`'(identical(D), posint),
                 And(specindex(posint, D), satisfies(D-> nops([op(D)]) > 1))
                }
           )
      )
     }
);

 

Here's an expression which is simply a sum of various types of derivatives. Note that the first and last terms only differ in the dependent variable name.


expr:=
     D[1,2](u)(x,t) + diff(u(x,t), x, t) + diff(f(x),x$2) +
     diff(f(t),t) + (D@@3)(f)(x) + D(g)(x) + D[1,2](v)(x,t)
;

(D[1, 2](u))(x, t)+diff(diff(u(x, t), t), x)+diff(diff(f(x), x), x)+diff(f(t), t)+((D@@3)(f))(x)+(D(g))(x)+(D[1, 2](v))(x, t)

I1:= indets(expr, HODD);

{(D[1, 2](u))(x, t), (D[1, 2](v))(x, t), ((D@@3)(f))(x)}

The above result is as expected: Ds of order greater than 1 are selected; diffs are not. Now I try to extract the diffs also.

 

indets(expr, HODD &under (convert, D));

{diff(diff(f(x), x), x), diff(diff(u(x, t), t), x), (D[1, 2](v))(x, t), ((D@@3)(f))(x)}

The above result is missing D[1,2](u)(x,t) even though it contains the syntactically identical term D[1,2](v)(x,t)! Running trace  on `type/&under` shows that it never gets called for that missing term! So, the problem is not in &under. A further test shows that if the missing term is put elsewhere in expr (after restart, of course) then the indets works okay.

 

The following result is even weirder. One would expect that for any types T1 and T2 and any expression expr, that indets(expr, {T1, T2}) would equal indets(expr, T1) union indets(expr, T2), right? One would expect that even if there were a bug with one of the individual indets calls, right? So, note that I1 above contains the first term of expr, yet ...

indets(expr, {HODD, HODD &under (convert, D)});

{diff(diff(f(x), x), x), diff(diff(u(x, t), t), x), (D[1, 2](v))(x, t), ((D@@3)(f))(x)}

I get the same results if put the type explicitly in the indets calls rather than using AddType. I get the same results in Maple 16 and 18. So, what's going on?

 


Download indets.mw

Page 1 of 1