NAlecture - 1 (Uyumluluk Modu)

You might also like

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

Computer Application In EM

Introduction
 The solutions of engineering problems can be
obtained using analytical methods or numerical
Lecture 1 methods
 Numerical methods can be used where analytical
methods are not capable of or practical for providing
solutions.

Introduction

2 Computer Application In EM
Prof. Dr. Arif N Güllüoğlu

Decision Making in Engineering Decision Making in Engineering


 To make the best decisions, engineers must be aware  Engineering decision problems can be classified into
of and fully understand alternative solution procedures single- and multiple-objective problems
 solutions are both unbiased and have high precision  objectives are minimizing the total expected cost, maximizing
safety, maximizing the total expected utility value, and
 solution must be cost effective and have minimal maximizing the total expected profit
environmental consequences  objectives need to be stated in the same units, and weights that
 Systematic procedure for solving a problem reflect the importance of the objectives and that can be used to
combine the objectives need to be assigned
 identify the problem
 state the objectives  The problem can be formulated in a suitable form for
attaining the decision objectives
 develop alternative solutions
 evaluate the alternatives  Then, development of alternative solutions comes next
 Computers have increased the number of alternative solution
 implement the best alternative
 graphical, analytical, simple empirical methods
 numerical and simulation methods

3 Computer Application In EM 4 Computer Application In EM


Prof. Dr. Arif N Güllüoğlu Prof. Dr. Arif N Güllüoğlu

Analytical Versus Analytical Versus


Numerical Analysis Numerical Analysis
 Problem solving methods can be separated into two  Examples:
classes,
The minimum of the function y = x2 – 3x + 2 was of interest.
 Analytical methods : Analytical calculus forms the basis for
analytical problem solving
 Numerical methods : finite difference arithmetic forms the basis One numerical solution is to iterate over a range of x values at a
of numerical methods constant increment ∆x, and select the value of x for which y is
 Examples: smallest.
The minimum of the function y = x2 – 3x + 2 was of interest. Analytical
For example; if we define the interval from 1 to 2, and use an increment of 0.2,
solution can be obtained by
x 1.0 1.2 1.4 1.6 1.8 2.0
y 0 -0.16 -0.24 -0.24 -0.16 0
so solution occurs at x = 1.5
tabulated results above indicate that the minimum value of y falls in the
interval 1.4 < x < 1.6.
To improve the accuracy of numerical result, increment can be decreased
5 Computer Application In EM 6 Computer Application In EM
Prof. Dr. Arif N Güllüoğlu and search repeated. Prof. Dr. Arif N Güllüoğlu
Analytical Versus
Numerical Analysis Numerical Analysis
The analysis and solution of problems which require
 Examples: calculations. The result of numerical analysis is a set of
The minimum of the function y = x2 – 3x + 2 was of interest. numbers, a formula, or a decision.
Typical situations include the following:
 For this example analytical approach is clearly superior.
 But if the function is complex and an analytical derivative can  A large body of experimental data is to be condensed into
not be found? Then numerical solution is necessary. one meaningful, descriptive statistic.
 A large body of data is to be converted into a formula useful
 But numerical solution is not exact, and it is also necessary for prediction (interpolation or extrapolation)
to provide initial estimates of the unknowns.  Two or more bodies of data are to be compared for
 Since the solution is not exact, error analysis are often similarities or differences
 A function, such as sin x, is to be expressed as a table of
necessary. values.
 A formula is to be evaluated for specific values of the
variables.
 One or more equations are to be solved to a predetermined
degree of precision.
7 Computer Application In EM 8 Computer Application In EM
Prof. Dr. Arif N Güllüoğlu Prof. Dr. Arif N Güllüoğlu

Characteristics of Characteristics of
Numerical Methods Numerical Methods
Numerical methods have most of the following characteristics: Example 1. Square Root
 Finding the square root of a number is a frequent task.
 The solution procedure is iterative with the accuracy of the we need to develop a method for estimating √x, where x is any positive real
estimated solution improving with each iteration value.
Start by assuming that we have an initial estimate of √x, which we will denote
 The solution procedure provides only an approximation to
as xo and xo is in error by an unknown amount ∆x.
the true, but unknown, solution.
If we know ∆x, then we would have the following equality:
 An initial estimate of the solution may be required.
 The solution procedure is conceptually simple with
algorithms representing the solution procedure that can be If both sides of Eq. are squared and arranged
easily programmed on a digital computer.
 The solution procedure may occasionally diverge from
rather than converge to the true solution
The value of ∆x computed with Eq. then added to xo to get a revised estimate
of x. And the new estimate x1 of the true solution is

9 Computer Application In EM 10 Computer Application In EM


Prof. Dr. Arif N Güllüoğlu Prof. Dr. Arif N Güllüoğlu

Characteristics of Characteristics of
Numerical Methods Numerical Methods
Example 1. Square Root Example 1. Square Root
 Generalizing the notation
FUNCTION SQRTN(X, X0, T0L)
Where xi and xi+1 are the estimates of x on trials i and (i+1),
c X = VALUE FOR WHICH SQUARE ROOT IS NEEDED
respectively, and
c XO = AN INPUT, INITIAL ESTIMATE OF SQUARE ROOT OF X
c XO = FINAL ESTIMATE OF SQUARE ROOT OF X
 Find the root of 150,
First estimate is xo=12, so equation c TOL = MAXIMUM ALLOWABLE (TOLERABLE) ERROR IN
c SQUARE ROOT OF X

A second iteration can be applied using the revised x1 1 DELX=(X –X0**2)/(2.0*X0)


X0=X0+DELX
IF (ABS(DELX).GT.TOL)GO TO 1
A third iteration can be applied using the revised x2
SQRTN=X0
END
11 Computer Application In EM 12 Computer Application In EM
Prof. Dr. Arif N Güllüoğlu Prof. Dr. Arif N Güllüoğlu
MatLab: Exercise MatLab: Exercise
function y=root (w) >> root(10)
x=
% This program estimates the square root of a number.
%
1
X = 5.500000 X^2 = 30.250000
x = 1.0 X = 3.659091 X^2 = 13.388946
X = 3.196005 X^2 = 10.214448
for i = 1 : 10 X = 3.162456 X^2 = 10.001126
x = 0.5 * ( x + ( w / x ) ); X = 3.162278 X^2 = 10.000000
fprintf ( 'X = %f X^2 = %f\n', x, x^2 ) X = 3.162278 X^2 = 10.000000
end
X = 3.162278 X^2 = 10.000000
X = 3.162278 X^2 = 10.000000
X = 3.162278 X^2 = 10.000000
X = 3.162278 X^2 = 10.000000
>>

13 Computer Application In EM 14 Computer Application In EM


Prof. Dr. Arif N Güllüoğlu Prof. Dr. Arif N Güllüoğlu

Engineering Problems Mathematical Models


Empirical
Modeling is the development of a
Observation and experiment mathematical representation of a
Certain aspects of empirical studies occur repeatedly physical/biological/chemical/
Such general behavior can be expressed as fundamental laws
economic/etc. system
that essentially embody the cumulative wisdom of past Putting our understanding of a

experience system into math

Theoretical / Numerical
Formulation of fundamental laws Problem Solving Tools:
Algebraic Analyticsolutions, statistics,
ODE numerical methods, graphics, etc.
Computer Mathematics
PDE

15 Computer Application In EM 16 Computer Application In EM


Prof. Dr. Arif N Güllüoğlu Prof. Dr. Arif N Güllüoğlu

Mathematical Modeling Mathematical Modeling


A mathematical model is represented as a functional
relationship of the form
Engineering or Physical problems
(Description)

Mathematical Modeling
Approximation & Assumption

Formulation or Governing
Equations
Dependent variable: Characteristic that usually reflects the
state of the system
Analytical & Numerical Methods
Independent variables: Dimensions such as time and space
along which the systems behavior is being determined Solutions
Parameters: reflect the system’s properties or composition
Forcing functions: external influences acting upon the system Applications

17 Computer Application In EM 18 Computer Application In EM


Prof. Dr. Arif N Güllüoğlu Prof. Dr. Arif N Güllüoğlu
Falling Parachutist Problem Falling Parachutist Problem
Example: You are asked to predict the instantaneous  1st Order DE
velocity of a falling parachutist dropped from an requires 1 initial
airplane, or a rain drop condition:
Solution  If the
parachutist is
Newton formulated his 2nd law of Motion,
initially at rest
F = ma, (v=0 at t=0),
using calculus

 Analytical or
exact solution

19 Computer Application In EM 20 Computer Application In EM


Prof. Dr. Arif N Güllüoğlu Prof. Dr. Arif N Güllüoğlu

Falling Parachutist Problem Falling Parachutist Problem


Independent variable
 Not all mathematical models can be solved exactly.
 Numerical solutions need developed to
approximate exact solutions.
 Approximate the derivative using a finite divided
difference.

Dependent variable
Parameters
Forcing function

21 Computer Application In EM 22 Computer Application In EM


Prof. Dr. Arif N Güllüoğlu Prof. Dr. Arif N Güllüoğlu

Falling Parachutist Problem Falling Parachutist Problem


 Solve the falling parachutist problem for the following case: v(t=0)=0,
M=68.1 kg, C=12.5 kg/s, tf=50 s, Use ∆t=4 s & ∆t=2 s

Equivalent as ∆t 0

t(s) V(m/s)
0 0
2 16.4
4 27.77
6 35.64
8 41.10
10 44.87

23 Computer Application In EM 24 Computer Application In EM


Prof. Dr. Arif N Güllüoğlu Prof. Dr. Arif N Güllüoğlu
Falling Parachutist Problem Falling Parachutist Problem
Euler’s Method Use ∆t = 2 s Euler’s Method Use ∆t = 4 s

Step 1 Step 1

Step 2 Step 2

Step 3

Step 4
t(s) V(m/s)
Step 5 0 0
4 39.24
t(s) V(m/s)
8 49.67
0 0
12 52.40
2 19.62
4 32.04
6 39.89
8 44.86 Computer Application In EM Computer Application In EM
25 26
Prof. Dr. Arif N Güllüoğlu Prof. Dr. Arif N Güllüoğlu
10 48.01

Falling Parachutist Problem Conclusion


Euler’s Method
t(s) V(m/s)  Good accuracy requires a lot of small time steps.
0 0
4 39.24  This is extremely laborious and time consuming to
Exact solution 8 49.67 implement by hand.
t(s) V(m/s) 12 52.40

0 0
t(s) V(m/s)
2 16.4
0 0
4 27.77
2 19.62
6 35.64
4 32.04
8 41.10
6 39.89
10 44.87
8 44.86
10 48.01

The solution accuracy depends on time increment 27 Computer Application In EM 28 Computer Application In EM
Prof. Dr. Arif N Güllüoğlu Prof. Dr. Arif N Güllüoğlu

Thank you

Smile!
29 Computer Application In EM
Prof. Dr. Arif N Güllüoğlu

You might also like