0% found this document useful (0 votes)
4 views4 pages

NumMeth G2019 Final Solutions

The document contains a final exam for a Numerical Methods course at Yildiz Technical University, detailing various problems and solutions related to numerical methods including finite difference methods for heat transfer, LU decomposition for electrical circuits, and calculations for speed, acceleration, and volume maximization using the Golden Bracketing method. Each question is assigned a specific point value and includes step-by-step solutions. The exam is structured to assess students' understanding and application of numerical methods in different contexts.

Uploaded by

yildizteknik2023
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)
4 views4 pages

NumMeth G2019 Final Solutions

The document contains a final exam for a Numerical Methods course at Yildiz Technical University, detailing various problems and solutions related to numerical methods including finite difference methods for heat transfer, LU decomposition for electrical circuits, and calculations for speed, acceleration, and volume maximization using the Golden Bracketing method. Each question is assigned a specific point value and includes step-by-step solutions. The exam is structured to assess students' understanding and application of numerical methods in different contexts.

Uploaded by

yildizteknik2023
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

YILDIZ TECHNICAL UNIVERSITY

MECHANICAL FACULTY / MECHATRONICS ENGINEERING DEPARTMENT


Student Name: Student number: Signature:
Course: MKT3841 Numerical Methods Gr2 Date/Time: 26.12.2019 / 15:00 Duration: 90 minutes
Exam Type: Final Exam Course Instructor: Assoc.Prof. Cüneyt Yılmaz
Question 1) [25 points] Apply the finite difference method in the following differential equation of a
heat transfer model to obtain a simultaneous equation system in the matrix form 𝑨. 𝑻 = 𝑩 where 𝑻 =
[𝑻𝟏 , 𝑻𝟐 , ⋯ , 𝑻𝒏 ].
𝑑2 𝑇
= −0.5 ∙ (𝑇 − 20) , with 𝑇(0) = 40 , 𝑇’(4) = 50 and ℎ = 𝑥 = 1.
𝑑𝑥 2

𝑥(𝑛)−𝑥(0) 4−0
Solution 1) 𝑛= +1= +1=5
ℎ 1

𝑇1 = 40 , 𝑇5′ = 50 𝑎𝑛𝑑 ℎ = 1

1
𝑇𝑖′ = ( ) ( 𝑇𝑖+1 − 𝑇𝑖−1 ) = 0.5 ∙ ( 𝑇𝑖+1 − 𝑇𝑖−1 )
2ℎ
1
𝑇𝑖 ′′ = ( 2 ) ( 𝑇𝑖−1 − 2 𝑇𝑖 + 𝑇𝑖+1 ) = 𝑇𝑖−1 − 2 𝑇𝑖 + 𝑇𝑖+1

𝑇𝑖−1 − 2 𝑇𝑖 + 𝑇𝑖+1 + 0.5 ∙ ( 𝑇𝑖 − 20) = 0

𝑇𝑖−1 − 1.5 𝑇𝑖 + 𝑇𝑖+1 = 10

i=1: 𝒙𝟏 = 𝟎 , 𝑻𝟏 = 𝟒𝟎
i=2: 𝒙𝟐 = 𝟏 , 𝑻𝟏 − 𝟏. 𝟓 𝑻𝟐 + 𝑻𝟑 = 𝟏𝟎

i=3: 𝒙𝟐 = 𝟐 , 𝑻𝟐 − 𝟏. 𝟓 𝑻𝟑 + 𝑻𝟒 = 𝟏𝟎

i=4: 𝒙𝟐 = 𝟑 , 𝑻𝟑 − 𝟏. 𝟓 𝑻𝟒 + 𝑻𝟓 = 𝟏𝟎

i=5: 𝒙𝟐 = 𝟒 , 𝑻𝟒 − 𝟏. 𝟓 𝑻𝟓 + 𝑻𝟔 = 𝟏𝟎

𝑇5 ′ = 0.5 ( 𝑇6 − 𝑇4 ) = 50 → 𝑇6 = 100 + 𝑇4

𝑇4 − 1.5 𝑇5 + (100 + 𝑇4 ) = 10 → 𝟐 ∙ 𝑻𝟒 − 𝟏. 𝟓 𝑻𝟓 = −𝟗𝟎

𝟏 𝟎 𝟎 𝟎 𝟎 𝑻𝟏 𝟒𝟎
𝟏 −𝟏. 𝟓 𝟏 𝟎 𝟎 𝑻𝟐 𝟏𝟎
𝟎 𝟏 −𝟏. 𝟓 𝟏 𝟎 𝑻𝟑 = 𝟏𝟎
𝟎 𝟎 𝟏 −𝟏. 𝟓 𝟏 𝑻𝟒 𝟏𝟎
[𝟎 𝟎 𝟎 𝟐 −𝟏. 𝟓] [ 𝑻𝟓 ] [−𝟗𝟎]
Question 2) [25 points] Consider the following electrical circuit.

Rewrite the system in the matrix


form as
𝑨 ∙ 𝑿 = 𝑩 , and solve { i1 , i2 , i3 }T
by using Doolittle’s LU
Decomposition method.

Solution 2)
10 0 −5 x1 50
[0 20 −10 ] ∙ [ x 2 ] = [ 0]
−5 −10 20 x3 0

10 0 −5 x1 50
𝑨=[ 0 20 −10] , x
𝐗 = [ 2] , 𝐁=[0]
−5 −10 20 x3 0
𝑨=𝑳∙𝑼
First, we use Gauss elimination:
row2 – (0) x row1 → row2 , 𝐿21 = 0 and,
10 0 −5
row3 – (-1/2) x row1 → row3 , 𝐿31 = −1/2 → 𝑨′ = [ 0 20 −10]
0 −10 17.5
10 0 −5 1 0 0
row3 – (-1/2) x row2 → row3 , 𝐿32 = −1/2 → 𝑼 = [ 0 20 −10] and 𝑳 = [ 1 11 0]
0
0 0 12.5 −2 −2 1
𝑨∙𝑿=𝑩
𝑳 ∙ (𝑼 ∙ 𝑿) = 𝑩
1 0 0 50
𝒀=𝑼∙𝑿 → 𝑳∙𝒀=𝑩 → [ 1 0 1 0]∙𝐘=[0]
1
−2 −2 1 0
50
𝑦1 = 50 , 𝑦2 = 0 , 𝑦3 = 25 → 𝐘 = [ 0 ]
25

10 0 −5 x1 50
𝑼∙𝑿=𝒀 → [0 20 −10 ] ∙ [ x 2 ] = [ 0] →
0 0 12.5 x 3 25
𝒊𝟏 𝟔
25 0+10∙(2) 50−0∙(1)+5∙(2)
𝑥3 = 12.5 = 2 , 𝑥2 = = 1 , 𝑥1 = =6 → 𝐗 = {𝒊𝟐 } = {𝟏} 𝒂𝒎𝒑𝒆𝒓𝒔
−20 10
𝒊𝟑 𝟐
Question 3) [25 points] Use the data below to compute the speed and the accelaration at t=0.2 sec
as accurately as possible.
Time (sec) 0 0.1 0.2 0.3 0.4
Position (meter) 0.000 0.080 0.140 0.300 0.750
Hint: Use the table for the first central
difference approximation of O(h2) and
Richardson Extrapolation equation to
2𝑃 𝑔(ℎ1 ⁄2)−𝑔(ℎ1 )
increase the accuracy: 𝐺 =
2𝑃 −1
Work with at least 3 decimal points.
Solution 3) p=2

The Speed:

1
𝑓 ′(𝑥) = ( ) [ 𝑓(𝑥 + ℎ) − 𝑓(𝑥 − ℎ) ]
2ℎ
1
for h=0.1 , 𝑓 ′(𝑥) = (2(0.1)) [ 0.300 − 0.080 ] = 1.1 → g(h1/2)

1
for h=0.2 , 𝑓 ′(𝑥) = (2(0.2)) [ 0.750 − 0.000] = 1.875 → g(h1)


2𝑝 𝑔( 1 )−𝑔(ℎ1 ) 22 (1.1)−1.875
2
𝐺= = = 𝟎. 𝟖𝟒𝟐 𝒎/𝒔 with the error O(h4).
2𝑝 −1 22 −1

The Accelaration:

𝑓 ′′(𝑥) = (1/ℎ2 ) [ 𝑓(𝑥 − ℎ) − 2 𝑓(𝑥) + 𝑓(𝑥 + ℎ) ]

for h=0.1 ,
1
𝑓 ′′(0.1) = ((0.1)2 ) [ (0.080) − 2 (0.140) + (0.300)] = 10.000 → g(h1/2)

for h=0.2 ,
1
𝑓 ′′(0.2) = ((0.2)2 ) [ (0.000) − 2 (0.140) + (0.750)] = 11.750 → g(h1)

f ''(0.2)=(1/0.22) (0.000-2.0.140+0.750) = 11.750 → g(h1)


22 (10.000)−11.750
𝐺= = 𝟗. 𝟒𝟏𝟕 𝒎/𝒔𝟐 with the error O(h4).
22 −1
𝑆
Question 4) [25 points] The volume of a closed cylinder is given with a formula 𝑓(𝑥) = 2 ∙ 𝑥 − 𝜋 ∙ 𝑥 3

where x is its radius, and S is its surface area. If we want to keep the surface area at 150 𝑐𝑚2 , then
numerically calculate its radius x to obtain the maximum volume fmax(x) by using Golden Bracketing
method.
(Search x between 2.7 and 2.9 cm . Stop telescoping when the bracketing width ℎ ≤ 1 ∙ 10−1 . Use
R=0.618034 as the Golden Ratio. Work with at least 4 decimal points.)
Solution 4) To convert the problem from maximization to minimization, we negate the function as:
𝐹(𝑥) = −𝑓(𝑥) = −75 ∙ 𝑥 + 𝜋 ∙ 𝑥 3
and numerically minimize it by using Golden Bracketing method as:
Stop if h<ε
i ai bi h ai'=bi-Rxh bi'=ai+Rxh f(ai') f(bi')
1 2.7000 2.9000 0.2000 2.7764 2.8236 -140.9949 -141.0472
2 2.7764 2.9000 0.1236 2.8236 2.8528 -141.0472 -141.0203
3 2.7764 2.8528 0.0764 2.8056 2.8236 -141.0411 -141.0472 Yes

𝟐. 𝟖𝟎𝟓𝟔 + 𝟐. 𝟖𝟐𝟑𝟔
𝒙𝒎𝒊𝒏 = = 𝟐. 𝟖𝟏𝟒𝟔 𝑭(𝒙𝒎𝒊𝒏) = −𝟏𝟒𝟏. 𝟎𝟒𝟔𝟑
𝟐

Calculation details at the first and the last step:

At the 1st step (i=1):

𝑓(𝑎1′ ) = 𝑓(2.7764) = −75 ∙ (2.7764) + 𝜋 ∙ (2.7764)3 = −140.9949

𝑓(𝑏1′ ) = 𝑓(2.82236) = −75 ∙ (2.82236) + 𝜋 ∙ (2.82236)3 = −141.0472

𝑓(𝑎1′ ) > 𝑓(𝑏1′ ) → 𝑎2 = 𝑎1′ = 2.7764 𝑎𝑛𝑑 𝑏2 = 𝑏1 = 2.9000

At the 3rd step (i=3): ℎ = 𝑏3 − 𝑎3 = 2.8525 − 2.7764 = 0.0764 < 0.1 , the telescoping stopped.

You might also like