12.07.2015 Views

Learning Guide Learning Guide

Learning Guide Learning Guide

Learning Guide Learning Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

184 • Chapter 5: Evaluation and SimplificationUse the combination select(hastype,...) to select the operands ofan expression that contain a certain type.> select( hastype, expr, ‘+‘ );(3 + x) sin(1 + √ π)If you are interested in the subexpressions of a certain type ratherthan the operands that contain them, use the indets command.> indets( expr, ‘+‘ );{3 + x, 1 + √ π}The two RootOfs in sol above are of type RootOf. Since the twoRootOfs are identical, the set that indets returns contains only one element.> indets( sol, RootOf );{RootOf(_Z 6 − b 2 − a _Z 5 )}Not all commands are their own type, as is RootOf, but you canuse the structured type specfunc(type, name). This type matches thefunction name with arguments of type type.> type( diff(y(x), x), specfunc(anything, diff) );trueYou can use this to find all the derivatives in a large differential equation.> DE := expand( diff( cos(y(t)+t)*sin(t*z(t)), t ) )> + diff(x(t), t);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!