Showing posts with label Computational Techniques In Mathematica. Show all posts
Showing posts with label Computational Techniques In Mathematica. Show all posts

Monday, 26 September 2011

Introduction to Mathematica (part 2)

Mathematica Basics.
1.Alphaneumeric format.
When we use alphaneumeric (combination of alphabet and numbers ) ,it should not beginning with digit.But must be started with alphabet.

Example :

As we write 2b,mathematica will show us “2 b”,with spacing in the middle.This infact, “2 b” = 2xb.The correct way to use alphaneumeric is b2 instead of 2b 

2. Exponentiation
Exponention is represented by using ^,hence,x^y means :



3.Semicolon
Semicolon ie ; can avoid mathematica from showing the result of each calculation.Example:

a=4 after (shift+enter)
4
a=3 after (shift +enter)
3
c = a + b
7

The number 4 and 3 above can be avoided from display by mathematica by adding semicolon.See example below:

a=4;
b=3;
c=a+b
7
4. Use parenthese for modofication
Example:2+3*5 = 17
(this follows the standard operation,multiply first followed by plus operation)
However,we can modify this by adding a parenthese bracket.Dont use square or round bracket.

Example : (2+3)*5 = 25

5.N expression
a. N[expression] - gives the approximation to 6 significant digits (mathematica's default)
Example :
N[Pi]
3.14159

b.N[expression,n] - an approximation accurate to n significants digits.
N[Pai,50]
3.1231456758697087867543213245



Sunday, 25 September 2011

Introduction to Mathematica (part 1)

What is Mathematica ?
Mathematica is a system for doing mathematics.It is a software,developed by its founder Wolfram.

The Kernel
1. It is a computational engine of Mathematica.
2. If we input,the Kernel will respon with answer in the form of graphs,numbers etc

Front End and Notebook
1. The interface between the User and Kernel is called Front End
2. The medium / format of the Front End is Mathematica Notebook.
3. The notebook will enable us to :
      a. Communicate with Kernel
     b. As a tool for documenting our work.

The execution
1. To execute,we need to press SHIFT + ENTER keys.
2. Without pressing a SHIFT key,it will cause the cursor to move to a new line.

Mathematica Characteristics 
1. It is very sensitive.
We have to be careful to input the instruction.All the command should be started with capital letter.Example bA # Ba and Integrate # integrate

2. Brackets and purposes
a. "Different brackets for different purposes.
b. There are several brackets that we have to consider of :
    i. Square Bracket : It is used as function arguments :Tan[x] not Tan (x)
   
    ii. Round Bracket / Parenthese : It is used as grouping : (2+3)*4.It
       means,add 2+ 3 first,then,multiply by 4.Never write [2+3]*4

    iii. Curly Bracket : it is used for list : {1,2,3,4,5}


3.Use E not e for base Logarithm
1. Remember,see figure below :
    




4.Polynomial are not written in "standard" form 
In mathematica,we does not write (refer figure 1) in fact we write it as in figure 2 (refer figure 2)

Figure 1 : A standard form to write polynomial equation

Figure 2 : Polynomial as what Mathematica will show to user