0% found this document useful (0 votes)
3 views15 pages

Lab Work 5

This document outlines Lab Work 5 for the course 'Introduction to Engineering and Problem Solving' at the Faculty of Mechanical Engineering. It includes an assessment rubric, a detailed methodology for using MATLAB, and various operations performed using the software. The document serves as a guide for conducting numerical computing, data analysis, and visualization tasks within MATLAB.

Uploaded by

Suhaimi Sajahan
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)
3 views15 pages

Lab Work 5

This document outlines Lab Work 5 for the course 'Introduction to Engineering and Problem Solving' at the Faculty of Mechanical Engineering. It includes an assessment rubric, a detailed methodology for using MATLAB, and various operations performed using the software. The document serves as a guide for conducting numerical computing, data analysis, and visualization tasks within MATLAB.

Uploaded by

Suhaimi Sajahan
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/ 15

MUHAMMAD SUHAIMI BIN SAJAHAN

2023472606
LAB WORK 5

FACULTY OF MECHANICAL ENGINEERING

Program : CEEM 222


Course Title : INTRODUCTION TO ENGINEERING AND PROBLEM SOLVING
Course Code: MEC400
Instructor : IR TS DR AZRIF BIN MANUT

TITLE
LAB WORK 5
By

Student’s Name : MUHAMMAD SUHAIMI BIN SAJAHAN

UiTM ID No. : 2023472606 Section No. :

Submission Date: 07/01/2024

Weighting Earned Equivalent


Assessment Table:
Factor Score Mark
● Overall quality including general appearance, format, cover page, 0.2
table of content, acknowledgment, comment, and language,
etc.
● Project/Theoretical background and methodology 0.1
● Solution contents including data analysis, results, graphs, tables, 0.5
diagrams, and computer codes, etc.
● Discussion, conclusion, recommendation, references, etc. 0.2

Total / 10

Instructor’s Signature : Date Received :

Page | 1
MUHAMMAD SUHAIMI BIN SAJAHAN
2023472606
LAB WORK 5

Assessment Rubrics: (To be deliberated further in the class)

Performance Criteria Rubric for Individual Lab Assignment (ILA)


Low indicator Poor Developing Average Good Excellent High indicator
Criteria Descriptio 1,2 3,4 5,6 7,8 9,10 Descriptio
n n
Overall quality ● Does not follow the format ● Follow the format 100%
including general ● Poor organization ● Excellent organization
appearance, ● Poor language usage ● Superb language usage
format, cover ● Lack of clarity and congruency ● Very clear and congruent
page, table of
content,
acknowledgment,
comment,
language, etc.
Project/Theoretical ● No project/theoretical background given ● Thorough project/theoretical background given
background and ● Unclear methodology description ● Clear methodology description
methodology ● Lowly informative and illustrative ● Highly informative and illustrative

Solution contents ● Miss important parts and are incomplete ● 100% complete with details
including data ● Inaccurate and full of mistakes/errors ● Accurate and no mistakes/errors
analysis, results, ● Insufficient data/evidences provided ● Sufficient data/evidences provided
graphs, tables,
diagrams, and
computer codes,
etc.
Discussion, ● Not thorough and undiscerning ● Very thorough and discerning
conclusion, ● No correlation with objectives ● Highly correlated to objectives
recommendation, ● No corresponding citation ● Many corresponding citations (5 or more)
references, etc.

Page | 2
MUHAMMAD SUHAIMI BIN SAJAHAN
2023472606
LAB WORK 5

Table of Contents
1.0 Introduction ................................................................................................................................ 4
2.0 Theoretical background .............................................................................................................. 5
2.1 Literature review ..................................................................................................................... 5
2.2 Fundamental principles........................................................................................................... 5
2.3 Assumptions ............................................................................................................................ 6
3.0 Methodology ............................................................................................................................... 7
4.0 Results ......................................................................................................................................... 8
5.0 Discussion of result. .................................................................................................................. 12
6.0 Conclusion ................................................................................................................................. 13
7.0 Appendices ................................................................................................................................ 14

Page | 3
MUHAMMAD SUHAIMI BIN SAJAHAN
2023472606
LAB WORK 5

1.0 Introduction

MATLAB, an abbreviation for "Matrix Laboratory," is a powerful and widely used


programming language and environment for numerical computing, data analysis, and
visualisation. MATLAB, created by MathWorks, offers a comprehensive set of tools
and functions that make it especially well-suited for tasks involving matrix
manipulation, mathematical modelling, and algorithm development. Originally
designed to aid in linear algebra and matrix-based computations, MATLAB has
evolved into a versatile platform used in a variety of disciplines such as engineering,
physics, finance, biology, and others.

One of MATLAB's distinguishing features is its ease of use and expressive


syntax, which makes it suitable for both novice and experienced programmers. Users
can interact with MATLAB via a command-line interface (CLI) or a graphical user
interface (GUI), providing a flexible and interactive coding experience. The extensive
library of built-in functions in MATLAB simplifies complex mathematical operations
and speeds up development.

This programming language excels not only at numerical computations but


also at data analysis and visualisation. Its plotting and graphing capabilities allow
users to create insightful visual representations of data, assisting in result
interpretation.

In this introduction to MATLAB, we will look at its key features, syntax, and
applications, laying the groundwork for users to use it to solve a variety of
computational problems and conduct sophisticated data analyses. MATLAB provides
a versatile environment for tackling a wide range of challenges in the realms of
mathematics and data science, whether you are an engineer, scientist, researcher, or
student.

Page | 4
MUHAMMAD SUHAIMI BIN SAJAHAN
2023472606
LAB WORK 5

2.0 Theoretical background


MATLAB (Matrix Laboratory) is a high-performance technical computing language
that integrates computation, visualisation, and programming in a user-friendly
environment. One of its guiding principles is matrix-based computing, which makes it
particularly adept at numerical linear algebra and matrix manipulation. The language
has a simple and intuitive syntax that accommodates users from various
backgrounds. Its comprehensive set of built-in functions and toolboxes cover a wide
range of applications, from signal processing to image processing, optimisation, and
more, allowing users to perform complex computations without having to write
algorithms from scratch.

The robust data visualisation capabilities of MATLAB, which support both 2D and
3D plotting, aid in the analysis and interpretation of results. Simulink, a graphical
programming environment, is now included, extending its utility for modelling,
simulating, and analysing multidomain dynamical systems. Interfacing with other
languages, symbolic computing, support for parallel and GPU computing, and
application deployment tools are also strengths. MATLAB is a popular choice among
researchers, engineers, and scientists from a variety of disciplines due to its
versatility and comprehensive features.

2.1 Literature review


MATLAB, a computer algebra system, as a mathematics teaching tool. It has also
investigated some learning theories related to the teaching and learning of
mathematics using computer technology. The review aimed to summarise the various
ways the software has been used as a tool for visualisation, computation, problem
solving, fostering positive attitudes and math confidence, increasing motivation and
math performance, and projects. It also included the proposals in which the software
was suggested for use. We hope that this review is useful to those who are
interested in incorporating MATLAB into their mathematics curriculum.

2.2 Fundamental principles


MATLAB is a powerful tool that adheres to some fundamental principles that make it
user-friendly and versatile. It frequently works with matrices, which simplifies complex
maths. Its simple syntax makes it accessible to programmers of all skill levels. Many
built-in functions and toolboxes assist with complex tasks, so you don't have to start
from scratch. MATLAB is interactive, so you can see the results right away. It's great
for data visualisation, and you can choose from a variety of programming styles.
Simulink aids in the visual representation of systems. MATLAB can also perform

Page | 5
MUHAMMAD SUHAIMI BIN SAJAHAN
2023472606
LAB WORK 5

symbolic maths and use multiple processors to perform faster calculations. You can
easily deploy your applications. Because of these principles, MATLAB is popular in
science and engineering.

2.3 Assumptions
I. Numeric Precision:
MATLAB uses finite precision arithmetic, leading to potential round-off errors,
especially in long or repetitive calculations. Users must exercise caution
regarding numerical precision to ensure accurate results in their
computations.
II. License and Cost:
MATLAB is a commercial software, and users need to be mindful of licensing
agreements and associated costs. Understanding the financial implications,
especially for additional toolboxes, is crucial for individuals and organizations
utilizing MATLAB.
III. Toolbox Compatibility:
MATLAB's core functionality is extended through various toolboxes. Users
must ensure that the required toolboxes are available to access specific
functionalities. The availability of appropriate toolboxes directly impacts the
range of applications and advanced features that can be utilized within
MATLAB.
IV. Hardware Compatibility:
Users should check the compatibility of MATLAB with their hardware
configurations. Particularly important for advanced features like parallel
computing or GPU acceleration, ensuring compatibility with specific hardware
is crucial to optimize performance and utilize certain functionalities effectively.
V. Data Representation:
MATLAB represents data in various formats, and users need to be mindful of
precision and format when importing or exporting data. Mismatches in data
types can lead to unexpected errors or inaccurate results, underscoring the
importance of careful data handling.
VI. Learning Curve:
While MATLAB is designed to be user-friendly, there is a learning curve,
especially for those new to programming or mathematical modelling. Investing
time in understanding MATLAB's syntax and capabilities is crucial for users to
maximize their proficiency and efficiency with the software.

Page | 6
MUHAMMAD SUHAIMI BIN SAJAHAN
2023472606
LAB WORK 5

3.0 Methodology

The acronym MATLAB stands for "Matrix Laboratory," and it provides a versatile
and dynamic environment for numerical computing, data analysis, and visualisation.
To harness MATLAB's computational power, a series of well-defined steps must be
followed. Set up the MATLAB environment, install the software, and launch either the
command-line interface or the graphical user interface (GUI). MATLAB's interactive
nature is evident in its command window, where users can perform quick calculations
and interactively explore data. MATLAB supports both scripting and function-based
approaches, allowing users to write automation scripts as well as custom functions
for modularity. MATLAB simplifies numerical computing tasks by providing extensive
support for variables, indexing, and specialised toolboxes. It is especially adept at
handling complex mathematical operations and algorithms.

The robust data manipulation capabilities of MATLAB allow users to store data in
various formats and manipulate it efficiently. The platform excels at data visualisation,
with a robust set of plotting functions for creating informative 2D and 3D visual
representations. Users can easily customise plots by adjusting properties to meet
specific needs. The language also includes programming constructs such as control
flow mechanisms and error handling to ensure code implementation flexibility and
robustness. Debugging and profiling tools improve the development process by
detecting and correcting errors as well as optimising performance.

Beyond coding, the MATLAB methodology includes features for publishing and
sharing results. By publishing MATLAB code and results in multiple formats, users
can create reports, presentations, or documentation, facilitating collaboration and
knowledge sharing. As users gain proficiency, they can explore additional features
and techniques, allowing them to realise MATLAB's full potential for diverse
applications in engineering, science, and beyond.

Page | 7
MUHAMMAD SUHAIMI BIN SAJAHAN
2023472606
LAB WORK 5

4.0 Results
A. Repeat and perform the following operations (the symbol ↵ means ‘press
enter’):
A. >> 𝐴 = 2; ↵
B. >> 𝐵 = 3; 𝐶 = 4; ↵
C. >> 𝐷 = 𝐴 + 𝐵 ↵
D. >> 𝐸 = 𝐴^3 + 𝐵^𝐴 ↵
E. >> 𝐹 = 2 ∗ 𝐶 + 𝑠𝑞𝑟𝑡(𝐶) – 1 ↵
F. >> 𝑠𝑞𝑟𝑡(𝐹) , 𝑠𝑞𝑟𝑡(– 𝐹) ↵
G. >> 𝑐𝑙𝑒𝑎𝑟 𝑎𝑙𝑙 ↵

Page | 8
MUHAMMAD SUHAIMI BIN SAJAHAN
2023472606
LAB WORK 5

B. Perform the following operations using a proper matrix operation:


I. 𝐷𝑒𝑓𝑖𝑛𝑒 𝑎 𝑚𝑎𝑡𝑟𝑖𝑥 𝐴 = [ 3 – 2 1 6; – 1 2 – 2 5; – 3 1 0 7].
II. 𝐷𝑒𝑓𝑖𝑛𝑒 𝑚𝑎𝑡𝑟𝑖𝑥 𝐵 𝑡𝑜 𝑏𝑒 𝑡ℎ𝑒 𝑡𝑟𝑎𝑛𝑠𝑝𝑜𝑠𝑒 𝑜𝑓 𝑚𝑎𝑡𝑟𝑖𝑥 𝐴.
III. 𝐷𝑒𝑓𝑖𝑛𝑒 𝑚𝑎𝑡𝑟𝑖𝑥 𝐴1 𝑏𝑦 𝑒𝑥𝑡𝑟𝑎𝑐𝑡𝑖𝑛𝑔 𝑟𝑜𝑤𝑠 1 𝑡𝑜 2 𝑎𝑛𝑑 𝑐𝑜𝑙𝑢𝑚𝑛𝑠 3 𝑡𝑜 4 𝑜𝑓 𝑚𝑎𝑡𝑟𝑖𝑥 𝐴.
IV. 𝐷𝑒𝑓𝑖𝑛𝑒 𝑚𝑎𝑡𝑟𝑖𝑥 𝐵1 𝑏𝑦 𝑒𝑥𝑡𝑟𝑎𝑐𝑡𝑖𝑛𝑔 𝑟𝑜𝑤𝑠 3 𝑡𝑜 4 𝑎𝑛𝑑 𝑐𝑜𝑙𝑢𝑚𝑛𝑠 2 𝑡𝑜 3 𝑜𝑓 𝑚𝑎𝑡𝑟𝑖𝑥 𝐵.
V. 𝐷𝑒𝑓𝑖𝑛𝑒 𝑚𝑎𝑡𝑟𝑖𝑥 𝐴2 𝑏𝑦 𝑒𝑥𝑡𝑟𝑎𝑐𝑡𝑖𝑛𝑔 𝑟𝑜𝑤𝑠 2 𝑡𝑜 4 3 𝑎𝑛𝑑 𝑐𝑜𝑙𝑢𝑚𝑛𝑠 1 𝑡𝑜 3 𝑜𝑓 𝑚𝑎𝑡𝑟𝑖𝑥 𝐴.
VI. 𝐷𝑒𝑓𝑖𝑛𝑒 𝑚𝑎𝑡𝑟𝑖𝑥 𝐵2 𝑏𝑦 𝑒𝑥𝑡𝑟𝑎𝑐𝑡𝑖𝑛𝑔 𝑎𝑙𝑙 𝑟𝑜𝑤𝑠 𝑎𝑛𝑑 𝑐𝑜𝑙𝑢𝑚𝑛𝑠 2 𝑡𝑜 43 𝑜𝑓 𝑚𝑎𝑡𝑟𝑖𝑥 𝐵.
VII. 𝐷𝑒𝑓𝑖𝑛𝑒 𝑚𝑎𝑡𝑟𝑖𝑥 𝐴3 𝑏𝑦 𝑒𝑥𝑡𝑟𝑎𝑐𝑡𝑖𝑛𝑔 𝑎𝑙𝑙 𝑐𝑜𝑙𝑢𝑚𝑛𝑠 𝑎𝑛𝑑 𝑟𝑜𝑤𝑠 32 𝑡𝑜 43 𝑜𝑓 𝑚𝑎𝑡𝑟𝑖𝑥 𝐴.
VIII. 𝐷𝑒𝑓𝑖𝑛𝑒 𝑚𝑎𝑡𝑟𝑖𝑥 𝐴𝐵 𝑏𝑦 𝑒𝑥𝑡𝑟𝑎𝑐𝑡𝑖𝑛𝑔 𝑐𝑜𝑙𝑢𝑚𝑛 1 𝑜𝑓 𝑚𝑎𝑡𝑟𝑖𝑥 𝐴 𝑎𝑛𝑑 𝑐𝑜𝑙𝑢𝑚𝑛 3 𝑜𝑓 𝑚𝑎𝑡𝑟𝑖𝑥 𝐵.
IX. 𝐶𝑜𝑚𝑝𝑢𝑡𝑒 𝐴1 + 𝐵1 𝑎𝑛𝑑 2𝑥𝐴1 – 3𝑥𝐵2.
X. 𝐶𝑜𝑚𝑝𝑢𝑡𝑒 𝐴3 – 𝑡ℎ𝑒 𝑡𝑟𝑎𝑛𝑠𝑝𝑜𝑠𝑒 𝑜𝑓 𝑚𝑎𝑡𝑟𝑖𝑥 𝐴𝐵.

Page | 9
MUHAMMAD SUHAIMI BIN SAJAHAN
2023472606
LAB WORK 5

C. Perform the following operations:


>> 𝐴 = [ 1 0 1; – 3 2 – 1; 4 1 0] ↵ and see the result.
>> % To determine the determinant and inverse of a matrix, types in the followings: ↵
>> 𝑑𝑒𝑡(𝐴) ↵ and see the result. %This is to make sure that matrix A is not singular.
>> 𝑖𝑛𝑣(𝐴) ↵ and see the result. % When 𝑑𝑒𝑡(𝐴) ≠ 0, the inverse of matrix A exists.

Using the inverse matrix method i.e. y = A– 1 x where the determinant of A is not
zero, solve the following system of linear algebraic equations:

5𝑋1 + 2𝑋2 + 𝑋3 = 3
4𝑋1 + 𝑋2 − 𝑋3 = −3
−2𝑋1 + 3𝑋2 − 3𝑋3 = 5

Page | 10
MUHAMMAD SUHAIMI BIN SAJAHAN
2023472606
LAB WORK 5

D. Perform the following operations with proper comments in each step:


I. Define the variable time t, from 0 to 3π s with an increment of 0.1 s.
II. Define the constants K = 1, Yo = 10, zeta = 0.14, and wn = 5.
III. Define the equation φ = tan– 1(1-2) where ζ = zeta, tan– 1 = atan and sqrt are
built-in functions in MATLAB for arctangent and square root. Use the name
phi = φ.
IV. Define a variable y1 = e-nt/1-2 where e is the exponential function.
V. Compute y = KYo(1 – y1sin(ωn*1-2 + φ) and plot y in mm vs t in s properly
with the title “'Plot of Step Response of Underdamped 2nd-order dynamics
system”

Page | 11
MUHAMMAD SUHAIMI BIN SAJAHAN
2023472606
LAB WORK 5

5.0 Discussion of result.

In this work, I have been assigned to complete an assignment related to how MATLAB works
where I need to find a way to use MATLAB based on the questions that have been given.
there are 4 questions that have been assigned to be completed, which are tasks a b c and d.
In this question a, the answer must be made according to the instructions of the question
and made according to the correct symbols and commands. In question b, I need to make a
few calculation methods to get the product of the product of the addition of the product of
division and also the product of powers for each matrix created. in this question I was able to
learn many things starting from the correct use of symbols and commands and also how to
apply the correct command according to the requirements of the question. In question c, the
beginning of the use of new commands and there are also equations that need to be made
according to the command matrix method.0n the other hand, I have obtained a form of graph
according to the requirements of the question.

Page | 12
MUHAMMAD SUHAIMI BIN SAJAHAN
2023472606
LAB WORK 5

6.0 Conclusion

Finally, MATLAB is a powerful and versatile tool for a variety of scientific,


engineering, and mathematical applications. Its matrix-based approach simplifies
complex computations, and the large set of built-in functions and toolboxes makes
efficient algorithm implementation possible. Users should be aware, however, of
certain considerations, such as numeric precision, toolbox compatibility, and the
financial aspects of licencing and additional toolboxes. Data representation,
hardware compatibility, and a commitment to overcoming the learning curve all
contribute to successful MATLAB use. Despite these considerations, MATLAB's
strengths in interactive computing, data visualisation, and broad functionality make it
a preferred choice for researchers, engineers, and scientists, allowing them to tackle
a variety of challenges and effectively advance their work.

Moreover, MATLAB's commitment to an intuitive user interface and support


for multiple programming paradigms contributes to its accessibility for users with
varying levels of programming experience. The continuous updates and
enhancements in MATLAB ensure that users can benefit from the latest features and
improvements, reinforcing its relevance in the rapidly evolving landscape of scientific
and engineering applications.

MATLAB's ability to integrate with other languages, support for symbolic


math, and application deployment options all add to its utility. MATLAB's overall
versatility and robustness make it a go-to platform for tackling complex problems,
conducting research, and implementing sophisticated algorithms as users navigate
numeric precision challenges and hardware compatibility considerations.

In essence, despite its nuances and considerations, MATLAB remains a


valuable and indispensable tool for professionals and researchers seeking efficient,
interactive, and comprehensive solutions in a wide range of technical domains.

Page | 13
MUHAMMAD SUHAIMI BIN SAJAHAN
2023472606
LAB WORK 5

7.0 Appendices

I. MATLAB assumptions
https://www.mathworks.com/help/symbolic/sym.assume.html
II. Introduction of MATLAB
https://www.simplilearn.com/tutorials/matlab-tutorial/what-is-matlab-introduction-
for-beginners
III. How to define matrix in MATLAB
https://www.tutorialspoint.com/matlab/matlab_matrics.htm
IV. Methodology and implementation
https://www.mathworks.com/academia/books/gmdh-methodology-and-
implementation-in-matlab-onwubolu.html
V. Literature review of MATLAB
https://www.mathworks.com/academia/books/gmdh-methodology-and-
implementation-in-matlab-onwubolu.html

Page | 14
MUHAMMAD SUHAIMI BIN SAJAHAN
2023472606
LAB WORK 5

Page | 15

You might also like