Using Variables in Maple for Quantum Calculations and Fourier Analysis

  • Context: Maple 
  • Thread starter Thread starter Lyuokdea
  • Start date Start date
  • Tags Tags
    Maple
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
4 replies · 3K views
Lyuokdea
Messages
154
Reaction score
0
Is there anyway to use a variable in Maple but assign the variable to be an integer, or a multiple of 2Pi, or to be a real number, or anything like that?

For instance, I want to do a quantum calculation, involving Fourier analysis, but I want the computer to know that the n's and m's I'm inputting need to be integers, otherwise I get cos(n*x) factors flying around, how do I make this look nicer?

~Lyuokdea
 
Physics news on Phys.org
I don't quite understand the problem. This should be basically automatic in maple.

If for instance you write

n := 2;
cos(n*x);

you should see nice-looking formulas. For multiples of pi, use

n := 2 * Pi;

There are some subtle differences between Pi and pi in maple, if you don't like the results you get with one, try the other.
 
right, but I don't want n to be 2, I want to see the results in terms of n, so that I know which factors are coming up, but I want it to assume n is an integer so that it integrates without a bunch of messy cos factors that will either be 1 or 0.

~Lyuokdea
 
Lyuokdea said:
right, but I don't want n to be 2, I want to see the results in terms of n, so that I know which factors are coming up, but I want it to assume n is an integer so that it integrates without a bunch of messy cos factors that will either be 1 or 0.

~Lyuokdea
You can do this with the assume command :
>assume(n, integer);
>cos(n*Pi);
result : (-1)^n
 
sweet, thanks man

~Lyuokdea