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



0 comments:

Post a Comment