11.07.2015 Views

Advanced Programming Guide

Advanced Programming Guide

Advanced Programming Guide

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2.5 Extending Maple • 39The userinfo Command You can give the user details about proceduresimplifications using the userinfo command. The ‘simplify/&^‘ procedureprints an informative message if you set infolevel[simplify] orinfolevel[all] to greater than or equal to least 2.> ‘simplify/&^‘ := proc( x )> local a, b, c;> if typematch( x,> ’‘&^‘’( ’‘&^‘’( a::anything, b::anything ),> c::anything ) ) then> userinfo(2, simplify, "applying the associative law");> a &^ ( b &^ c );> else> x;> end if;> end proc:Applying the associative law simplifies some products of Hamiltonians.> x &^ I &^ J &^ K;((x &^ I) &^ J) &^ K> simplify(%);−xIf you set infolevel[simplify] to a sufficiently large value, Mapleprints information on the methods used by simplify while attempting tosimplify your expression.> infolevel[simplify] := 5;infolevel simplify := 5> w &^ x &^ y &^ z;((w &^ x) &^ y) &^ z> simplify(%);simplify/&^:simplify/&^:"applying the associative law""applying the associative law"

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

Saved successfully!

Ooh no, something went wrong!