EEE312 Programming Practices

您的程序应该显示每个迭代,包括方法的类型(IQI或Secant),更新后的值和误差比。

还需要对程序流程、算法和问题的计算方面进行描述包括在报告中。*请注意,所有代码都应该以函数格式编写。您可以自由搜索Brent的方法,以了解Brent的行为以及该方法是如何实现的实施。通过数值分析方法进行搜索和搜索,可以找到一个很好的来源。混合方法

Course Code EEE312
Course Name Programming Practices
Lecturer Raja Majid Mehmood
Academic Session 2023/09
Assessment Title Final Project
A. Introduction/ Situation/ Background Information
This project applies the concept of numerical methods using C programming language. The project 
is a combination of several well-known numerical methods learnt in this course and a new 
algorithm that can be widely found through the Internet and valid sources.
B. Course Learning Outcomes (CLO) covered
At the end of this assessment, students are able to:
CLO 1 Design program using advanced algorithms and techniques.
CLO 2 Apply modern programming techniques to solve scientific problems.
C. University Policy on Academic Misconduct
1. Academic misconduct is a serious offense in Xiamen University Malaysia. It can be defined 
as any of the following:
i. Plagiarism is submitting or presenting someone else’s work, words, ideas, data or
information as your own intentionally or unintentionally. This includes incorporating 
published and unpublished material, whether in manuscript, printed or electronic form into 
your work without acknowledging the source (the person and the work).
ii. Collusion is two or more people collaborating on a piece of work (in part or whole) 
which is intended to be wholly individual and passed it off as own individual work.
iii. Cheating is an act of dishonesty or fraud in order to gain an unfair advantage in an
assessment. This includes using or attempting to use, or assisting another to use materials
XMUM.OAA - 100/2/8-V2.0 Page | 2
that are prohibited or inappropriate, commissioning work from a third party, falsifying 
data, or breaching any examination rules.
2. All the assessment submitted must be the outcome of the student. Any form of academic 
misconduct is a serious offense which will be penalised by being given a zero mark for the 
entire assessment in question or part of the assessment in question. If there is more than one 
guilty party as in the case of collusion, both you and your collusion partner(s) will be subjected 
to the same penalty.
D. Instruction to Students
Prepare report document (softcopy) based on given guidelines in Section F (Tasks). Submit 
softcopy (pdf file only) of report in Moodle course page by 11:59 on December 29, 2023. Late 
submission will result in a penalty. Report PDF file should include the following sections in same 
sequence,
Main Sections of Report:
1. Cover page: student name and student id
? Assignment Cover Pages (must be filled in and signed by student) - attached.
2. C programs section: source code with comments
? Include ONLY C programs for each task from Section F
3. Results and discussion section: detailed description of results
? To answer all tasks in Section F, demonstrate functionalities of each task. Include 
all programs results/outputs (if available) with description in your own words.
4. Marking rubrics: Include at the end of report/document – attached.
Note: 1) font: Times New Roman, 12pts, 2) line spacing: single line.
E. Evaluation Breakdown
No. Component Title Percentage
(%)
1. Source Code C Program 25
2. Results and Discussion 25
TOTAL 50
XMUM.OAA - 100/2/8-V2.0 Page | 3
F. Task(s) 
In this project, you are required to develop the Brent’s method using C programming language that can
solve a general non-linear equation.
To test your program, you are required to find the root of ??(??) = 4??
3 + 3??
2 ? 2?? ? 2 with a given initial 
THREE (3) points ??1 = 3, ??2 = 2, a???? ??3 = 1. Your program should display the results at every iteration 
of the algorithm until the solution converges when |b ? a| < ??, where ?? = 10?7
.
Your program should display each iteration including the method’s type (either IQI or Secant), the updated
values and the error ratio.
A description of program flow, algorithm and computational aspects of the problem is also required to be 
included in the report.
*Note that all codes should be written in a function format.
You are free to search about the Brent’s method to find out the behavior of Brent and how the method is
implemented.
A good source can be found from googling and searching through numerical analysis method.
Hybrid method
A hybrid approach, that combines the reliability of bracketing (Basically two initial points are required 
e.g., Bisection and etc.) with the speed of open methods (based on formulas that require only a single 
starting value of x or two starting values that do not necessarily bracket the root e.g., Fix Point Iteration 
and etc.).
Brent’s method
Brent’s method is a hybrid method that benefit from the reliability of bracketing models as well as the
speed of open methods. Brent’s root-location method is a clever algorithm that does just that by 
applying a speedy open method wherever possible but reverting to a reliable bracketing method if 
necessary. The approach was developed by Richard Brent (1973) based on an earlier algorithm of 
Theodorus Dekker (1969).
The bracketing technique is the trusty bisection method whereas two different open methods are 
employed. The first is the secant method explained next, the second is inverse quadratic interpolation 
(IQI).
IQI is similar in spirit to the secant method. The secant method is based on computing a straight line 
that goes through two guesses. The intersection of this straight line with the x axis represents the new 
root estimate. For this reason, it is sometimes referred to as a linear interpolation method. Now suppose 
that we had three points. In that case, we could determine a quadratic function of x that goes through 
the three points. Just as with the linear secant method, the intersection of this parabola with the 
x axis would represent the new root estimate.
Although this would seem to represent a great improvement, the approach has a fundamental flaw: It is 
possible that the parabola might not intersect the x axis. Such would be the case when the resulting 
parabola had complex roots.
Brent’s Method Algorithm
The general idea behind Brent’s root finding method is whenever possible to use one of the quick open 
methods. In the event that these generate an unacceptable result (i.e., a root estimate that falls outside 
the bracket), the algorithm reverts to the more conservative bisection method. Although bisection may 
be slower, it generates an estimate guaranteed to fall within the bracket. This process is then repeated 
until the root is located to within an acceptable tolerance. As might be expected, bisection typically 
dominates at first but as the root is approached, the technique shifts to the faster open methods
wechat codinghelp

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值