View Full Version : Quick Question on Maple Usage
Lyuokdea
May19-06, 01:31 AM
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
pervect
May19-06, 01:55 AM
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.
Lyuokdea
May19-06, 01:57 AM
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.
~Lyuokdea
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.
~Lyuokdea
You can do this with the assume command :
>assume(n, integer);
>cos(n*Pi);
result : (-1)^n
Lyuokdea
May19-06, 02:13 AM
sweet, thanks man
~Lyuokdea
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.