Hello folks,
There are not many resources on Maxima on internet, that's why I thought to write a series of tutorials.
I had conducted one workshop on Maxima in KTHM college and I intend to conduct more workshops on Maxima and other related softwares (Pari GP, Sage) at KTHM College. Interested candidates can contact me at manas.princeton@gmail.com.
For those who don't know what Maxima is all about, it's a Computer Algebra System (CAS). It can be used to solve a variety of problems in Mathematics including but not limited to algebra, limits, derivatives, integration, ODE, trigonometry, graph plotting, graph theory and what not!
In these tuts I'll show you how to use Maxima for most common mathematical problems.
Let's start.
Download the latest copy of Maxima from here. http://sourceforge.net/projects/maxima/files/
After installation, locate and start the application named wxMaxima.
PART 1 - Maxima as a Calculator
Write this: 1+1;
In Maxima, each statement must be terminated in order to carry on execution. There are two ways to do this. Either use ; or $ at the end of statement.
The difference between these two is
; executes and shows the output.
$ only executes WITHOUT showing the output.
What you see above is called as a cell. Now we have to evaluate the cell. Again, two ways.
Go to Cell menu at the top and click 'evaluate'. OR Press SHIFT + ENTER.
Here is how it looks after evaluation.
Note the symbols %i1 and %o1.
i stands for input. o stands for output. 1 stands for cell number. This is nothing but pointers.
Let's do more calculations.
These are pretty self explanatory. 5!=120.
% sign means last output here (that is 120).
The third statement %o1 - it's 2. It is the output of first cell. So you can see the output of this stmt (%o6) as 200.
Note the difference between 1/3 and 1.0/3.0
When you use decimal point, it essentially considers the number as a floating number and evaluates the fraction. Otherwise, it just simplifies the numbers and give you output in rational number format.
(Try doing 2/6)
Let's see how to define variables and assign value to them.
Suppose a & b be our variables.
To assign value to variable use : operator.
The variables are accessible throughout the worksheet and not just a particular cell.
To check the value assigned to variable, simply execute a;.
Exponents!
To expand the expression, use expand() function. It takes one argument, the expression. So we are passing the earlier (latest) output.
To find value of the expression, use numer command. It evaluates the numerical argument in floating point.
NOTE - To find more information about any particular function, just bring cursor on it and press F1 key. You'll get total documentation of that function.
I'd suggest you to do that for every information for detailed knowledge. My purpose here is to get you started, you are going to have to explore things yourself.
Moving on, let's do something our calculators fail to do.
100! Such a big number! It'll take us long to calculate such big numbers. But there's more. Here's the real beauty.
factor(arg)
It factorizes the arg i.e. the number passed. If you recall, Every natural number can be factored in one and only one way into a product of prime factors.
So here is the factorization of 100!
Try factorizing different numbers.
Here is a list of some of the common constants defined in Maxima.
Try it, you'll get the same answer.
That's it for now. I have shared the worksheet consisting above examples here.
There are not many resources on Maxima on internet, that's why I thought to write a series of tutorials.
I had conducted one workshop on Maxima in KTHM college and I intend to conduct more workshops on Maxima and other related softwares (Pari GP, Sage) at KTHM College. Interested candidates can contact me at manas.princeton@gmail.com.
For those who don't know what Maxima is all about, it's a Computer Algebra System (CAS). It can be used to solve a variety of problems in Mathematics including but not limited to algebra, limits, derivatives, integration, ODE, trigonometry, graph plotting, graph theory and what not!
In these tuts I'll show you how to use Maxima for most common mathematical problems.
Let's start.
Download the latest copy of Maxima from here. http://sourceforge.net/projects/maxima/files/
After installation, locate and start the application named wxMaxima.
PART 1 - Maxima as a Calculator
Write this: 1+1;
In Maxima, each statement must be terminated in order to carry on execution. There are two ways to do this. Either use ; or $ at the end of statement.
The difference between these two is
; executes and shows the output.
$ only executes WITHOUT showing the output.
What you see above is called as a cell. Now we have to evaluate the cell. Again, two ways.
Go to Cell menu at the top and click 'evaluate'. OR Press SHIFT + ENTER.
Here is how it looks after evaluation.
Note the symbols %i1 and %o1.
i stands for input. o stands for output. 1 stands for cell number. This is nothing but pointers.
Let's do more calculations.
These are pretty self explanatory. 5!=120.
% sign means last output here (that is 120).
The third statement %o1 - it's 2. It is the output of first cell. So you can see the output of this stmt (%o6) as 200.
Note the difference between 1/3 and 1.0/3.0
When you use decimal point, it essentially considers the number as a floating number and evaluates the fraction. Otherwise, it just simplifies the numbers and give you output in rational number format.
(Try doing 2/6)
Let's see how to define variables and assign value to them.
Suppose a & b be our variables.
To assign value to variable use : operator.
The variables are accessible throughout the worksheet and not just a particular cell.
To check the value assigned to variable, simply execute a;.
Exponents!
To expand the expression, use expand() function. It takes one argument, the expression. So we are passing the earlier (latest) output.
To find value of the expression, use numer command. It evaluates the numerical argument in floating point.
NOTE - To find more information about any particular function, just bring cursor on it and press F1 key. You'll get total documentation of that function.
I'd suggest you to do that for every information for detailed knowledge. My purpose here is to get you started, you are going to have to explore things yourself.
Moving on, let's do something our calculators fail to do.
100! Such a big number! It'll take us long to calculate such big numbers. But there's more. Here's the real beauty.
factor(arg)
It factorizes the arg i.e. the number passed. If you recall, Every natural number can be factored in one and only one way into a product of prime factors.
So here is the factorization of 100!
Try factorizing different numbers.
Here is a list of some of the common constants defined in Maxima.
- %e – Euler’s Number
- %pi –
- %phi – the golden mean (
)
- %i – the imaginary unit (
)
- inf – real positive infinity (
)
- minf – real minus infinity (
)
- infinity – complex infinity
Try it, you'll get the same answer.
That's it for now. I have shared the worksheet consisting above examples here.






No comments:
Post a Comment