Maple Tips
Home Up Maple Tips MATLAB Tips PSpice Tips Verilog

 

Initialization File

Put commands that you want to run each time in a file called maple.ini located in the Maple lib directory. If it doesn't exist, you can make one using a text editor. Maple will execute commands in your initialization file each time it starts up.

A basic startup file might look like this:

# Use EE notation for complex numbers
# (use 'j' as sqrt of -1, not I)
alias(I=I, j=sqrt(-1)):

# Report numerical values using a
#reduced number of digits
Digits := 6:

Procedures

You can define a procedure for equations that you use frequently. Suppose you want to do the operation ab+c a lot. You can set up a function so all you have type is "f(2,4,5)" instead of
"2*4+5" (not a great deal of time savings in this example, but I'm sure you can think of cases where it would help). Here's how:

> f := (a,b,c) -> a*b+c;
             f := (a,b,c) -> a b + c
> f(2,4,5);
             13

As another example, doing parallel resistor (impedance) calculations is much easier using a procedure:

> para := (a,b) -> 1/(1/a + 1/b);