0% found this document useful (0 votes)
7 views3 pages

Midterm LATEX 2023

The document outlines the midterm exam details for the EEE 1007 Computer Programming I course at Muğla Sıtkı Koçman University, including the exam schedule and instructions for a Bisection algorithm implementation in Matlab. Students are required to solve a given problem using the Bisection method, create relevant figures, and submit a report with their Matlab code. The report must be uploaded to the DYS system and submitted in person at the exam.

Uploaded by

arda35g
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)
7 views3 pages

Midterm LATEX 2023

The document outlines the midterm exam details for the EEE 1007 Computer Programming I course at Muğla Sıtkı Koçman University, including the exam schedule and instructions for a Bisection algorithm implementation in Matlab. Students are required to solve a given problem using the Bisection method, create relevant figures, and submit a report with their Matlab code. The report must be uploaded to the DYS system and submitted in person at the exam.

Uploaded by

arda35g
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/ 3

Muğla Sıtkı Koçman University

Engineering Faculty
Electrical & Electronics Engineering
EEE 1007 Computer Programming I
Midterm - Fall 2023

Name and Surname :


Student ID :
Signature :
Start Date : Saturday 2nd December, 2023 (14:19)
End Date : Friday 8th December,2023, (Midterm Time)
Lecturer : Assoc. Prof. Dr. Kemal UÇAK

Question 1: Bi Section [100-marks]


The pseudocode of BiSection algorithm is given as in algorithm 1.

Algorithm 1 Bisection
1: procedure Bisection
2: Step 1: Initialization:
3: Determine and Initialize aa and ab when aa < ab . Initialize tolerance value (ε = 10−4 )
4: k = 1 (Iteration Index)
5: Step 2: Update Rule
6: ak = aa + ab −a
2
a

7: Step 3:
0 
8: if f ak = 0 then
9: terminate the iteration owing to convergence
10: else if (ab − aa ) < ε then
11: terminateiteration
 due to tolerans value(ε)
0 0
12: else if f ak f aa > 0 then
13: aa = ak
14: else
15: ab = ak
16: k ← k + 1 goto Step 2.
17: Step 4: Obtain solution:

• Implement the above code using Matlab m-file enviroment. [30-marks]


• Solve the problem in (1) via implemented Matlab codes, and illustrate the following figures.
[30-marks]
 2  
f x = x−1 x−2 x−3 (1)
Figure 1: The function to be used, it’s derivative and solution points versus unknown variable.
Figure 2: Plot x(k) and f(x(k)) as subplots verus iteration.
Figure 3: Create an online drawing for Figure 1.

• Obtain solution for the given intervals. [5-marks]


Case 1: aa = 0, ab = 1.8, ε = 10−4
Case 2: aa = 1.8, ab = 3, ε = 10−4

• Prepare a report containing Matlab m-file codes, the above figures and information about Bisec-
tion algorithm. [35-marks]

• Do not forget to upload the report and matlab m-files to the DYS system link given for midterm
exam.

• Do not forget to submit you report about the midterm at exam to exam observer, and do not
forget to sign to the exam attendance list.

The sample figure is illustrated in Figure 1 for implementation and report. The following references
can be refered for more detailed information about Bisection.
1. A. Ravindran, K.M. Ragsdell, G.V. Reklaltis ,”Engineering Optimization: Methods and Appli-
cations”, Second Edition (Chapter 2.5.2 Bisection Method)

Page 2
2
-0.5 f(x[k])

ple
1.5 fx[k] -0.55
le
S am δ f[k] -0.6
a mp
1
2 4
S6 8 10 12 14
le
0.5
amp mp
le
S le a
amp 0 S
mp
le
0 S a δ f[k]
-0.5 S
-0.5 -1
2 4 6 8 10 12 14
le
mp le
-1 2.7

S a 2.6 a mp
-1.5 S x[k]
2.5

-2 2.4
0 0.5 1 1.5 2 2.5 3 3.5 2 4 6 8 10 12 14
x [k]

2
fx [k]
1.5 le δ f[k]
amp
1 S

mp le
Sa
0.5

m ple
0 Sa
-0.5

le
-1
amp
S
-1.5

-2
0 0.5 1 1.5 2 2.5 3 3.5
x

Figure 1: Sample Figure for Implementation and Report.

Page 3

You might also like