You are on page 1of 26

MAT 116E Advanced

Scientific and Engineering


Computing

Fall 2021
By: Burcu Tunga
CONTACT INFORMATION

Instructor: Dr. Burcu Tunga


Faculty of Sciences and Letters,
Department of Mathematics Engineering
Room:407

Email: tungab at itu.edu.tr


Webpage: http//web.itu.edu.tr/tungab
COURSE INFORMATION

References & Supplementary Materials for Matlab

M ATLAB, An Introduction with Applications / Amos Gilat


Introduction to Matlab 7 for Engineers / William J. Palm
MATLAB programming / David C. Kuncicky
www.mathworks.com
MATLAB 6 for Engineers, A Biran, M Breiner, Prentice Hall, 2002
R. Otto and J.P. Denier, An Introduction to Programming and
Numerical Methods in MATLAB, Springer-Verlag,London, 2005.
COURSE INFORMATION
Attendence Policy
%% Course attendance : 70% attendence is compulsory.
%% Lab attendance is required
Grading
Course Grading : Curve
10% Labworks
15% Term Project
35% Midterm Exam
40% Final Exam
!! Students who fail to score at least 30% of the in-term assessments
will not be admitted to the final exam and will receive VF.
COURSE INFORMATION

Homeworks
 Submit your homeworks in soft copy through course web
page. (http://www.ninova.itu.edu.tr)
 All homeworks must be done individually by yourself.
 Grading will be done based on correctness and clarity of
the code and proper execution of the program.
COURSE OBJECTIVES
 To familiarize students with the fundamentals of
scientific computing concepts
 To develop problem solving skills
 To develop skills in constructing an algorithm,
 To train students how to use Matlab in scientific and
engineering calculations
 To train students to visualize their results and prepare
written reportsTo teach their applications to the solution
of basic problems in analysis and linear algebra.
TOOLS USED TO ACHIEVE THE
OBJECTIVES

 Laboratory sessions held in the computer labs, homework


problems requiring computer and software use.
 Homework: homework assignments will be
announced on the web of the course.
Late submission will not be accepted.
What is scientific computing?
Design and analysis of algorithms for solving
mathematical problems in science and
engineering numerically.
Weeks Topics
1 Introduction to Scientific and Engineering Computing
2 Introduction to Program computing environment
3 Variables, operations
4 Plotting data and functions
5 Image processing tool
6 Algorithms and logic operators, Flow control and Errors and
source of errors
7 Loops and Conditional statements
8 Functions
9 Taylor’s series
10 Linear algebra applications
11 Polynomials
12 Symbolic Mathematics
13 Curve fitting
14 Interpolation
How do we solve an engineering problem?

Problem Description

Mathematical Model

Solution of Mathematical Model

Using the Solution


Example

Problem statement:
– Should be clear and avoid any misunderstanding.

“Compute the distance between two points in a plane.”


Example

Input/Output Description :
– Information that is given and the values to be computed.

Point 1
Distance
between two
points

Point 2
Example
Hand Example :
p1= (1,5)
p2= (4,7) (4,7)

dist= √ 2 2
( side1 ) +( side2 ) (1,5)
dist side2

√( 4− 1) +(7− 5)
2 2 side1

√13
3.61
Example
/*--This program computes the distance between two points-----*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
main()
{
/*----- Declare and initialize variables----- */
double x1=1, y1=5, x2=4, y2=7;
double side1, side2, dist ;

/*----- Compute sides of the right triangle-- */


side1=x2-x1;
side2=y2-y1;
dist=sqrt(side1*side1+side2*side2);

/*----- Print distance on the screen--------- */


printf(“The distance between the two points is %5.2f \n”,dist);

/*----- Exit program ------------------------ */


return EXIT_SUCCESS;
}
Example
Algorithm Development :
– Algorithm is a step-by-step outline of the problem solution, in other
words simple operations performed one after another.

Give values to the points.

Compute the lengths of the sides of the right triangle. (side1 and side2).

Compute the hypotenuse of the tringle which is also the distance


between the two points. (dist)

Print the value of distance.


Example
Testing :
– Data from the hand example can be used for testing.

The output of the program is:

The distance between the two points is 3.61


Example (with matlab)
x1=1
y1=5
x2=4
y2=7
side1=x2-x1
side2=y2-y1
dist=sqrt(side1*side1+side2*side2)
fprintf('The distance between the two points is %f \n', dist)
Example (with mathematica)
Clear[x1, x2, y1, y2, side1, side2, dist]
x1 = 1;
y1 = 5;
x2 = 4;
y2 = 7;
side1 = x2 - x1;
side2 = y2 - y1;
dist = Sqrt[side1*side1 + side2*side2];
Print["The distance between the two points is ", N[dist]]
Example (with MuPAD)
x1:=1;
y1:=5;
x2:=4;
y2:=7;
side1:=x2-x1;
side2:=y2-y1;
dist:=float(sqrt(side1*side1+side2*side2));
print(Unquoted, "The distance between the two points is",
dist);
Computer Tools

Matlab (Octave)

Mathematica

Mupad,

Maple
MATLAB
Matlab is designed to solve problems
numerically, that is, in finite precision
Arithmetic.
It produces approximate rather than exact
solutions,
In the latest version it can be also used as
symbolic computation system (SCS)
because of MuPAD.
MATLAB
Matrix-based numeric computation
MATrix LABoratory
The language was invented by Cleve Moler
in the late 1970s
MATLAB is rewritten in C and founded The
Mathworks is founded in 1984 to continue its
development by Cleve Moler and Steve
Bannert.
MATLAB
Advantages
Interpreter
Many many toolboxes
Visualization
Friendly environment
Wide usage
Disadvantages
Slower than C and Fortran
Not freeware
MuPAD
MuPAD is a computer algebra system (CAS).

Originally developed by the MuPAD research


group at the University of Paderborn, Germany,
development was taken over by the company
SciFace Software GmbH & Co. KG in cooperation
with the MuPAD research group and partners
from some other universities starting in 1997.
MuPAD
Until autumn 2005, the version "MuPAD Light"
was offered for free for research and education,
but as a result of the closure of the home institute
of the MuPAD research group, only the version
"MuPAD Pro" became available for purchase.
In September 2008, SciFace was purchased by
MathWorks and the MuPAD code was included in
the Symbolic Math Toolbox add-on for MATLAB.
MuPAD
MuPAD offers:
A computer algebra system to manipulate
formulas symbolically
Program packages for linear algebra, differential
equations, number theory, statistics, and
functional programming.
An interactive graphic system that supports
animations and transparent areas in 3D
A programming language that supports object-
oriented programming and functional
programming

You might also like