100% found this document useful (1 vote)
262 views

M2 +Fundamental+of+Computer-Aided+Mathematical+Calculations

This document introduces the fundamentals of performing mathematical calculations using computer software. It discusses commonly used software like Microsoft Excel, MATLAB, Mathematica, Scilab, and GNU Octave. The remainder of the document focuses on introducing basic commands and operations in GNU Octave, including creating and manipulating matrices, solving systems of linear equations, and plotting functions. It concludes with self-assessment problems involving matrix operations and plotting functions in GNU Octave.

Uploaded by

Kpop Harteu
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
100% found this document useful (1 vote)
262 views

M2 +Fundamental+of+Computer-Aided+Mathematical+Calculations

This document introduces the fundamentals of performing mathematical calculations using computer software. It discusses commonly used software like Microsoft Excel, MATLAB, Mathematica, Scilab, and GNU Octave. The remainder of the document focuses on introducing basic commands and operations in GNU Octave, including creating and manipulating matrices, solving systems of linear equations, and plotting functions. It concludes with self-assessment problems involving matrix operations and plotting functions in GNU Octave.

Uploaded by

Kpop Harteu
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
You are on page 1/ 4

Title : Fundamentals of Computer-Aided Mathematical Calculations

Intended Learning Outcomes : At the end of this lesson, you should be able to :
1. Identify some computer softwares used in numerical calculations
2. Perform basic commands in GNU Octave
3. Perform matrix operations using GNU Octave

Discussions :
1. What are some the most common softwares used mathematical calculations?

Microsoft Excel - Microsoft Excel is a helpful and powerful program for data analysis and
documentation. It is a spreadsheet program, which contains a number of columns and rows, where
each intersection of a column and a row is a “cell.” Each cell contains one point of data or one piece
of information. By organizing the information in this way, you can make information easier to find,
and automatically draw information from changing data.
Source : https://itconnect.uw.edu/learn/workshops/online-tutorials/microsoft-office-2010/microsoft-excel-2010/

Matrix manipulations can also be performed in microsoft excel.


MATLAB - MATLAB is a numerical computing environment and programming language.
Maintained by The MathWorks, MATLAB allows easy matrix manipulation, plotting of functions
and data, implementation of algorithms, creation of user interfaces, and interfacing with programs
in other languages.
Source : https://alternativeto.net/software/gnu-octave/

Mahtematica -Mathematica is a computational software program used widely in scientific,


engineering, and mathematical fields and other areas of technical computing.
Source : https://alternativeto.net/software/gnu-octave/

Scilab - Scilab is a scientific software package for numerical computations providing a powerful
open computing environment for engineering and scientific applications.
Source : https://alternativeto.net/software/gnu-octave/

Maple - Maplesoft’s renowned desktop software, Maple offers the most powerful and
comprehensive environment for exploring, visualizing, and solving even the most difficult math
problems
Especially good for: Anyone working with advanced math, including educators and students
in upper year courses and math-heavy programs; researchers; programmers; technical content
creators, or anyone who wants access to everything, just in case they need it later.
Source : https://www.maplesoft.com/products/maple/math-suite-education/index.aspx

GNU Octave - Octave is a computer program for performing numerical computations which is
mostly compatible with MATLAB. It is part of the GNU Project. It is free software under the terms
of the GNU General Public License.
GNU Octave is a high-level interpreted language, primarily intended for numerical
computations. It provides capabilities for the numerical solution of linear and nonlinear problems,
and for performing other numerical experiments. It also provides extensive graphics capabilities for
data visualization and manipulation. The Octave interpreter can be run in GUI mode (new in
version 4.0.0), as a console, or invoked as part of a shell script. Octave is normally used through its
interactive interface, but it can also be used to write non-interactive programs.
Source : https://alternativeto.net/software/gnu-octave/about/

Fundamentals of Computer-Aided Mathematical Calculations 1 of 4


2. Introduction to GNU Octave
2.1 GNU Octave interface

Command Window – Commands are written here. Results are displayed here.
Workspace – Variables and Matrices can be seen here.
Command History – Previous commands can be viewed here.

2.2 Some Basic Commands


clc – clear the command window
clear – clear the memory/workspace
quit – closes the interface Octave

Fundamentals of Computer-Aided Mathematical Calculations 2 of 4


3. Working with Matrices in GNU Octave
3.1 Creating Matrices
A matrix can be defined using a variable and equating it to the contents of the matrix.
A comma "," separates elements in a row while a semicolon ";" represents the start of a new
column.
Example :
>> A = [1, 2, 4; 3, 8, 6; 5, 1, 7]

[ ]
12 4
A= 3 8 6
51 7
>> B = [1, 2, 3; 0, 2, 0; 5, 1, 2]

[ ]
123
B= 0 2 0
512
3.2 Determinant of a Matrix
To calculate the determinant of matrix A and store it in variable D. Use the syntax below
Example :
>>D = det(A)

3.3 Multiplication of Matrices


To create a product matrix C using matrices A and B. Use the syntax below.
Example :
>>C = A*B

3.4 Solving a system of linear equations


To solve a system of linear equation in the form of Ax = b , use the left division
operator, ‘\’: as shown

[ ][ ] [ ]
1 2 4 x1 8
>>b = [8; 20; 18] (column matrix) 3 8 6 x2 = 20
>>x = A\b 5 1 7 x3 18

[ ][]
x1 2
x2 = 1 , answer
x3 1

3.5 Create a row martrix with increment


To create a row matrix x with initial element i1 and final element ti2 with increment Δi
x = i1 ; Δi ; i2
Example :
>>x = 0 : 0.2: 10

3.6 Use Built-in function


Some trigonometric functions are built-in are defined in the software : sin(), cos(), tan()
Example :
>>y = sin(x)

Fundamentals of Computer-Aided Mathematical Calculations 3 of 4


3.7 Plotting in 2D
Plotting in 2D requires two parameters.
>>plot(x,y)

Self Assessment(Problem Set) :


Show your complete solution.

[ ]
223

[ ]
−1 2 4
A= 3 2 5 B= −3 8 6
512 −5 1 7
Capture the screenshot to show your work.
1. Use GNU Octave to perform the indicated operations.
a. AxB
b. A+B
c. det(A)
d BT
2. Plot the function y = cos(x) (-π< x < π).
Choose an increment to produce a "smooth-looking curve"

3. Plot the function y = tan(x) (-π/2< x < π/2)


Choose an increment to produce a "smooth-looking curve"

References :
1. Applied Numerical Methods with MATLAB for Engineers and Scientist
Steven C. Chapra, McGraw Hill International Edition 2005

2. Elementary Numerical Analysis 3rd Edition


Kendall Atkinson &Weimin Han, John Wiley and Sons 2004

3. https://octave.org/doc/v4.0.0/Two_002dDimensional-Plots.html

Fundamentals of Computer-Aided Mathematical Calculations 4 of 4

You might also like