PDEtools[declare]  declare a function for compact display
PDEtools[undeclare]  undeclare a function for compact display

Calling Sequence


declare(f(x), g(x, y), '...')
declare(expr)
declare(prime = x)
declare(prime)
declare(copyasdisplayed = truefalse)
declare(copyasdisplayed)
undeclare(f(x), '...')
undeclare(expr)
undeclare(prime)
undeclare(all)
ON
OFF
show


Parameters


f(x)



function to be printed with compact display

expr



set, list, or sequence of expressions

prime = x



equation indicating the differentiation variable to be displayed with a prime, or just the keyword prime to query about its value

copyasdisplayed = ..



equation where the righthand side is true or false (the default), or just the keyword copyasdisplayed to query about its value; when true, displayed output of declared functions and derivates is copied & pasted "as displayed", instead of the default behavior which is "as entered"

quiet



(optional) perform declarations without having information displayed on the screen





Description


•

The purpose of this set of commands, declare, undeclare, show, ON, OFF, is to permit a simple, compact display of functions and derivatives on the screen. Typically, one declares functions by using declare(f(x, y, z)) with the result that is displayed as (that is, only its name) as well as occurrences of indexed , say as in are displayed as . This avoids a significant part of redundant information on the screen. One can declare the prime variable and many functions at once.

•

This scheme also displays all differentiation variables as indices, and permits declaring a prime variable so that, for functions of one variable, derivatives with respect to that declared prime variable are displayed with a prime.

•

Different from macro and alias, this set of commands works with 'print/foo' routines, so it does not change the output, only its typesetting on the screen.

•

When declare is called with an algebraic expression, each unknown function in the expression gets "declared".


Note: you cannot declare for compact display known functions of the mathematical language (cos, sin, etc.).

•

If no arguments are given to declare, the values of the copyasdisplayed, prime, and declared variables are reported. If the arguments prime or copyasdisplayed  just the keywords  are given, the corresponding values are reported.

•

The command undeclare accepts the same types of arguments as declare does, that is, a function, a sequence of functions, or an algebraic expression. It is used to "undo" declarations previously done by using declare.

•

declare and undeclare by default print informative messages when they are called. By using the optional argument 'quiet' these messages are suppressed.

•

When declare is first called, the scheme for compact display is turned ON. However, to turn explicit the actual value of an expression being displayed compactly, you can toggle this feature OFF. Two macros ON and OFF are provided for that purpose. Also, in the ON mode, the macro show displays the last expression in OFF mode.

•

These functions are part of the PDEtools package, and so they can be used in the form declare(..) and undeclare(..) only after executing the command with(PDEtools). However, they can always be accessed through the long form of the command by using PDEtools[declare](..) or PDEtools[undeclare](..).



Compatibility


•

The PDEtools[declare] command was updated in Maple 18.

•

The copyasdisplayed = .. parameter was introduced in Maple 18.



Examples


Declare y(x) to be displayed as y, and x to be the 'prime' differentiation variable.
>


>


 (1) 
Check the declarations.
>


 (2) 
>


 (3) 
Following is an ODE displayed by using the scheme for compact printing.
>


 (4) 
Turn the scheme OFF, print the ODE, and then turn the scheme ON again. Compare the results.
>


>


 (5) 
>


>


 (6) 
Use the show command to display the ODE in standard format, to copy and paste to an input line, but keep the scheme ON.
>


 (7) 
>


 (8) 
Now undeclare all the functions.
>


 (9) 
>


 (10) 
>


 (11) 
>


 (12) 
>


Here is a PDE example.
>


 (13) 
>


>


 (14) 
During a working session, declare the main function of the problem to avoid redundant information throughout the solution.
>


 (15) 
>


 (16) 
You can declare all the functions in a given DE or PDE directly.
>


 (17) 
>


 (18) 
It is also possible to selectively undeclare one (or many) functions. When doing that, one can give the function or its name.
>


 (19) 
>


 (20) 
>


 (21) 
>


 (22) 
>


>


 (23) 

