Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Quick Question on Maple Usage

  1. May 19, 2006 #1
    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?

  2. jcsd
  3. May 19, 2006 #2


    User Avatar
    Staff Emeritus
    Science Advisor

    I don't quite understand the problem. This should be basically automatic in maple.

    If for instance you write

    n := 2;

    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.
  4. May 19, 2006 #3
    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 with out a bunch of messy cos factors that will either be 1 or 0.

  5. May 19, 2006 #4
    You can do this with the assume command :
    >assume(n, integer);
    result : (-1)^n
  6. May 19, 2006 #5
    sweet, thanks man

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook