0% found this document useful (0 votes)
23 views12 pages

Mathematica Basics for Physics Students

The document provides an overview of Mathematica's capabilities in computation and programming, including basic arithmetic, algebraic calculations, numerical computations, and plotting functions. It covers various functions such as square roots, variable assignments, and matrix operations, as well as integration with limits. The content is aimed at students in the Department of Physics at the University of Rajshahi.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views12 pages

Mathematica Basics for Physics Students

The document provides an overview of Mathematica's capabilities in computation and programming, including basic arithmetic, algebraic calculations, numerical computations, and plotting functions. It covers various functions such as square roots, variable assignments, and matrix operations, as well as integration with limits. The content is aimed at students in the Department of Physics at the University of Rajshahi.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Mathematica

Computation and Programming

Syed Mehedi Hasan Naim ID 2310422102 Dept. of Physics, RU


Mathematica, Syed Mehedi Hasan Naim (23-102), Dept. of Physics, University of Rajshahi

Basic arithmetic calculation

Notice how the output is in integer value, to get the value in float we will use N[] or //N

Now will see how to use the last Answer like the “Ans” Options in calculators <Here “Ans”=%

Now let’s have a look at how to put a comment and also find a remainder

Using insert math option

1
Mathematica, Syed Mehedi Hasan Naim (23-102), Dept. of Physics, University of Rajshahi

Let’s see how can we find square root

Now for the X root we can use Surd function


𝒀
𝑺𝒖𝒓𝒅[𝑿, 𝒀] = √𝑿

Or, we can just use the Power[] function in a clever way

𝑷𝒐𝒘𝒆𝒓[𝑿, 𝒀] = 𝑋 𝑦

Assigning Variables

2
Mathematica, Syed Mehedi Hasan Naim (23-102), Dept. of Physics, University of Rajshahi

Algebraic calculation
Adding expressions

Factoring Expressions

Solving Equations

Expanding algebraic expressions

3
Mathematica, Syed Mehedi Hasan Naim (23-102), Dept. of Physics, University of Rajshahi

4
Mathematica, Syed Mehedi Hasan Naim (23-102), Dept. of Physics, University of Rajshahi

Numerical Calculations
Rounding numbers

Specific Rounding

Finding Least Common Multiple and Greatest Common Divisor

Inverse trigonometric functions

5
Mathematica, Syed Mehedi Hasan Naim (23-102), Dept. of Physics, University of Rajshahi

Exponential and log calculations

If we just write 𝐿𝑜𝑔[] the base is 𝑒

For 𝐥𝐨𝐠 𝒚 𝑿 = 𝑳𝒐𝒈[𝒚, 𝒙]

Factor Integer

6
Mathematica, Syed Mehedi Hasan Naim (23-102), Dept. of Physics, University of Rajshahi

Plotting
Plot [ “function of variables”, {“variable name”, ”lower limit”, ”upper limit” } ]

Plot3D [ “function of variables”, {“variable name”, ”lower limit”, ”upper limit” } ]

For Plotting multiple functions at once,

7
Mathematica, Syed Mehedi Hasan Naim (23-102), Dept. of Physics, University of Rajshahi

For 3D Plotting,

8
Mathematica, Syed Mehedi Hasan Naim (23-102), Dept. of Physics, University of Rajshahi

Lists or arrays

Matrices as a ‘list of lists’

9
Mathematica, Syed Mehedi Hasan Naim (23-102), Dept. of Physics, University of Rajshahi

Some matrix operations

10
Mathematica, Syed Mehedi Hasan Naim (23-102), Dept. of Physics, University of Rajshahi

Integration with limits

11

Common questions

Powered by AI

Mathematica offers functions like 'Round[]', 'Floor[]', 'Ceiling[]', 'IntegerPart[]', and 'FractionalPart[]' to control how numbers are rounded. These functions allow users to truncate, round up, round down, and separate integer parts of numbers thus increasing numerical precision and control in calculations .

In Mathematica, multiple functions can be plotted simultaneously by providing a list of functions to the 'Plot' or 'Plot3D' functions. The syntax for 3D plotting involves encapsulating the function of variables with the range of each variable explicitly stated, using 'Plot3D[“function of variables”, {“variable name”, “lower limit”, “upper limit”}]' .

Mathematica treats matrices as 'lists of lists', where each inner list represents a row. This structure allows for various matrix operations such as multiplication, inversion, and application of transformations. The comprehensive handling of matrices makes Mathematica a powerful tool for linear algebra computations .

In Mathematica, variables are assigned using the '=' operator. Once a variable is assigned a value, it can be used in various algebraic calculations such as adding expressions, factoring, solving equations, and expanding algebraic expressions. This flexibility allows users to perform complex operations by manipulating these assigned variables .

In Mathematica, numerical integration with limits is handled using specific syntax where the integrand is followed by the variable of integration and its limits, formatted in a list. Lists in Mathematica also function as collections of elements, making them crucial for structuring data, such as matrices described as a 'list of lists', facilitating complex computations and manipulations .

Mathematica utilizes dedicated functions to determine both the LCM and GCD. 'LCM[a, b, ...]' calculates the least common multiple, while 'GCD[a, b, ...]' determines the greatest common divisor of the given numbers. These functions simplify the computation of such mathematical operations within Mathematica's framework .

The conversion of integer values to floating-point values in Mathematica can be accomplished using the 'N[]' function or by appending '//N' to the calculation. These operations ensure the output is a floating-point number rather than an integer .

Mathematica can calculate the square root of an integer or variable using the 'Power[]' function or the 'Surd[]' function. For calculating an X root, 'Surd[X, Y]' is used, while 'Power[X, Y]' is often used in a clever way to represent other roots, enabling diverse mathematical manipulations .

Mathematica facilitates solving algebraic equations using functions like 'Solve[]', which finds solutions to equations or systems of equations. It applies symbolic computation to provide exact solutions whenever possible. These tools empower users to tackle complex algebraic challenges efficiently .

In Mathematica, exponential calculations can be performed using powers defined by 'Power[]', while logarithmic calculations default to the natural logarithm, which uses base 'e' when 'Log[]' is used. To specify a different base for the logarithm, the syntax 'Log[y, x]' is utilized, where 'y' is the base .

You might also like