Module 1 Laboratory

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

1

Microsoft Excel is a software program produced by Microsoft that allows users to organize,
format and calculate data with formulas using a spreadsheet system.

This software is part of the Microsoft Office suite and is compatible with other applications
in the Office suite. Like other Microsoft Office products, Microsoft Excel can now be purchased
through the cloud on a subscription basis through Office 365.

MS Excel is a commercial spreadsheet application that is produced and distributed by


Microsoft for Microsoft Windows and Mac OS operating systems. It features the ability to perform
basic calculations, use graphing tools, create pivot tables and create macros, among other useful
features.

Spreadsheet applications such as MS Excel use a collection of cells arranged into rows and
columns to organize and manipulate data. They can also display data as charts, histograms and line
graphs.

MS Excel permits users to arrange data in order to view various factors from different
perspectives. Microsoft Visual Basic is a programming language used for applications in Excel,
allowing users to create a variety of complex numerical methods. Programmers are given an option
to code directly using the Visual Basic Editor, including Windows for writing code, debugging
and code module organization.

At the end of this module, it is expected that the students will be able to:
1. Familiarize themselves with Microsoft Excel and its command and functions.
2. Execute command in Microsoft Excel
3. Solve matrix operations and complex numbers in Microsoft Excel.
4. Perform circuit analysis in Microsoft Excel.

LABORATORY ENGG 415 NUMERICAL METHODS AND ANALYSIS


2

UNDERSTANDING THE EXCEL INTERFACE

IDENTIFYING PARTS OF THE SCREEN


The Excel window is illustrated in Figure 1. The bulk of the screen is occupied by the
worksheet window. This grid provides a convenient workspace where you can enter and manage
your data. Surrounding the worksheet window are several command interfaces, each of which
allows you to receive information about, or apply functions to, the data on the worksheet.

Figure 1. The Parts of the Excel Window

PART DESCRIPTION
Worksheet control buttons The worksheet control buttons allow you to minimize,
maximize/restore, or close the worksheet.
Formula bar The formula bar allows you to enter and edit data in the
worksheet.
Worksheet window The worksheet window contains the open, active
worksheet. Worksheet windows can be moved and sized.
You can have more than one worksheet window open at
the same time.
Scroll bars The vertical and horizontal scroll bars enable you to
move quickly through the worksheet, vertically and
horizontally.
Ribbon The Ribbon is designed to help you quickly find the
commands that you need to complete a task. Commands
are organized in logical groups, which are collected
together under tabs. Each tab relates to a type of activity,
such as writing or laying out a page. To reduce clutter,
some tabs are shown only when needed.

LABORATORY ENGG 415 NUMERICAL METHODS AND ANALYSIS


3

Title bar (extreme top right of The title bar contains the name of the application and the
the Excel window) active file.
File Button Clicking on the File Button displays a drop down menu
containing a number of options, such as open, save, and
print.
The options in the File Button menu are very similar to
options found under the Office Button and File menu in
previous versions of Excel.
Sheet tabs (Worksheet tabs) The sheet tabs let you switch between worksheets in a
workbook by clicking the appropriate tab.
Quick Access Toolbar The Quick Access Toolbar (see Figure 1-5) is a
customizable toolbar that contains a set of commands
that are independent of the tab that is currently displayed.
You can move the Quick Access Toolbar from one of the
two possible locations, and you can add buttons that
represent commands to the Quick Access Toolbar.

THE RIBBON
The Ribbon is the strip of buttons and icons, organized into TABS, located above the work
area in Excel 2013. The Ribbon (with its various tabs) replaces the menus and toolbars found in
earlier versions of Excel. At the top of the actual Ribbon are a number of tabs, such as Home,
Insert, and Page Layout. Clicking on a tab displays the options located in this section of the ribbon.

For example, when Excel 2013 opens, the options under the Home tab are displayed (see
image to the right). These options are grouped according to their function - such as Clipboard
(includes cut, copy, and paste options), and Font (includes current font, font size, bold, italic, and
underline options).

Clicking on an option on the ribbon may lead to further options contained in a Contextual
Menu that relate specifically to the option chosen.

Figure 2. The Ribbons

Although, as written in the label for Figure 1-4, tab sections can be referred to as [tab name]
ribbon, like Home Ribbon, Insert Ribbon, etc, tab sections can also be referred to as only their tab
names. Eg. the Home tab, the Insert tab, the Page Layout tab, etc.

LABORATORY ENGG 415 NUMERICAL METHODS AND ANALYSIS


4

MATRIX OPERATIONS IN EXCEL

Matrix Functions

FUNCTIONS DESCRIPTION
MDETERM The matrix determinant of an array.
MINVERSE The inverse matrix of an array.
MMULT The matrix product of two arrays.
MUNIT (2013) The unit matrix or the specified dimension.
TRANSPOSE The matrix transposed (i.e. with its orientation changed).

VECTORS AND MATRICES

Rectangular arrays of numbers are called matrices. A matrix can be represented as any small table
of numbers. A single column matrix is called a column vector. A single row matrix is called a row
vector. The dimension of a matrix is written as (rows x columns) A matrix is said to be square if
it has the same number of rows and columns.

ADDING MATRICES

You can only add matrices that have the same dimension. The result is the sum of the
corresponding entries. There is no special Excel function to add because you can use straight
addition.

LABORATORY ENGG 415 NUMERICAL METHODS AND ANALYSIS


5

IDENTITY MATRIX

An identity matrix is a square matrix which contains all zeros except the main diagonal
contains ones.

The inverse of a matrix is the matrix which when multiplied together gives the identity
matrix.

MINVERSE

The MINVERSE function returns the inverse of the matrix as an array formula.
This is usually entered as an array function and therefore must be entered with (Ctrl + Shift +
Enter).

To find out more about Array Formulas and Functions, please refer to the Array
Formulas section.

Only square matrices "can have" inverses. Not all square matrices have inverses.

LABORATORY ENGG 415 NUMERICAL METHODS AND ANALYSIS


6

To prove that these are in fact the correct inverses we need to multiply the two matrices
together. This is shown below. A matrix that has no inverse has a determinant of zero and is said
to be singular. Not all square matrices have inverses. A square matrix with an inverse is called
"invertible" or "nonsingular". A square matrix with no inverse is called "noninvertible" or
"singular".

MMULT

The MMULT function returns the product of two matrices. You must have a common
dimension in the matrices that you want to multiple together. The number of columns for one must
equal the number of rows for the other. This is usually entered as an array function and therefore
must be entered with (Ctrl + Shift + Enter).

Matrix A multiplied by Matrix B is not the same as Matrix B multiplied by Matrix A (i.e.
matrix multiplication is not commutative).

It is possible to use matrices to solve linear equations.

TRANSPOSE

The TRANSPOSE function will transpose a matrix and return an array formula.
Transposing an array converts rows into columns and columns into rows. The transpose of a
column vector will be a row vector. This is usually entered as an array function and therefore must
be entered with (Ctrl + Shift + Enter).

The first row of the input array becomes the first column of the output array.

LABORATORY ENGG 415 NUMERICAL METHODS AND ANALYSIS


7

MDETERM

The MDETERM function returns the matrix determinant as an array formula. This
function only has an accuracy of 16 digits so a singular array may return a result that differs by
1E-16.

LABORATORY ENGG 415 NUMERICAL METHODS AND ANALYSIS


8

MUNIT

The MUNIT function return the unit matrix or the specified dimension.
This function was added in Excel 2013.

SOLVING SIMULTANEOUS LINEAR EQUATIONS

You can use the inverse of a matrix to solve a set of equations. This can be converted into
matrix notation

The solution can be found by multiplying both sides by the inverse of A

There is not always a solution. Ax = b has a unique solution only if the matrix A is squares
and has an inverse.

IMPORTANT

• When using the MDETERM, MINVERSE and MMULT functions every cell in the array
must contain a numeric value. If not, the function will return #VALUE!
• A matrix with "m" rows and "n" columns is said to be of order (m * n). When "m" and "n"
are equal then the matrix is said to be square.
• Two matrices are said to be identical if every element in one matrix equals the
corresponding element in the other matrix.
• Matrix multiplication is not commutative so (A * B) does not equal (B * A).
• Matrix division is undefined.
• An identity matrix is a square matrix that contains all zeros except the main diagonal
contains the value 1.

LABORATORY ENGG 415 NUMERICAL METHODS AND ANALYSIS


9

SOLVING COMPLEX NUMBERS USING MICROSOFT EXCEL


Useful Commands:

COMMAND DESCRIPTION
COMPLEX Converts user-supplied real and imaginary coefficients
into a complex number

IMABS Returns the absolute value (the modulus) of a complex


number
IMAGINARY Returns the imaginary coefficient of a complex number
IMARGUMENT Returns the argument Θ (an angle expressed in radians)
of a complex number
IMCONJUGATE Returns the complex conjugate of a complex number
IMCOS Returns the cosine of a complex number
IMCOSH Returns the hyperbolic cosine of a complex
number (New in Excel 2013)
IMCOT Returns the cotangent of a complex number (New in
Excel 2013)
IMCSC Returns the cosecant of a complex number (New in
Excel 2013)
IMCSCH Returns the hyperbolic cosecant of a complex
number (New in Excel 2013)
IMDIV Returns the quotient of two supplied complex numbers
IMEXP Returns the exponential of a complex number
IMLN Returns the natural logarithm of a complex number
IMLOG10 Returns the base-10 logarithm of a complex number
IMLOG2 Returns the base-2 logarithm of a complex number
IMPOWER Calculates a complex number raised to a supplied
power
IMPRODUCT Returns the product of up to 255 supplied complex
numbers
IMREAL Returns the real coefficient of a complex number
IMSEC Returns the secant of a complex number (New in Excel
2013)
IMSECH Returns the hyperbolic secant of a complex
number (New in Excel 2013)
IMSIN Returns the sine of a complex number
IMSINH Returns the hyperbolic sine of a complex number (New
in Excel 2013)
IMSQRT Returns the square root of a complex number
IMSUB Subtracts two complex numbers
IMSUM Calculates the sum of two complex numbers
IMTAN Returns the tangent of a complex number (New in Excel
2013)

LABORATORY ENGG 415 NUMERICAL METHODS AND ANALYSIS


10

Excel does not solve matrix equations involving complex arithmetic. Here we use matrix
methods to get an expression for the currents and then use Excel to do the complex arithmetic. We
work with the matrices and Excel does the complex arithmetic.

EXAMPLE:

1. Find the inverse of the given matrix using Excel.


2 5 2 −3
3 6 5 2
𝐴=[ ]
4 5 14 14
5 10 8 4

2. Solve x, y and w in the following equations:

3𝑥 − 2𝑦 + 𝑤 = 11
𝑥 + 5𝑦 − 2𝑤 = −9
2𝑥 + 𝑦 − 3𝑤 = −6

3. Evaluate:
1
(3𝑐𝑗𝑠36.86990 )∗ (−5 + 𝑗6)𝑗
𝑠𝑖𝑛ℎ [ ]
(cos(3 − 𝑗5))1−𝑗

4. Use the Mesh Analysis to find the value of 𝐼𝑜 of the given circuit.

LABORATORY ENGG 415 NUMERICAL METHODS AND ANALYSIS

You might also like