Maple Using Variables in Maple for Quantum Calculations and Fourier Analysis

  • Thread starter Thread starter Lyuokdea
  • Start date Start date
  • Tags Tags
    Maple
AI Thread Summary
In Maple, to ensure that variables like n and m are treated as integers or specific types (such as multiples of 2Pi) during calculations, the 'assume' command is essential. By using 'assume(n, integer)', users can instruct Maple to consider n as an integer, which simplifies integration and avoids complications with cosine factors that could result in values of 1 or 0. This allows for clearer results in terms of n, maintaining the integrity of quantum calculations and Fourier analysis without messy outputs. Additionally, users should be aware of the differences between Pi and pi in Maple to achieve the desired formatting in results.
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
 

Similar threads

Replies
1
Views
2K
Replies
3
Views
3K
Replies
6
Views
2K
Replies
3
Views
3K
Back
Top