首页 >
> 详细

Programming Project PART 1

CS 323 - Numerical Analysis

1 Introduction

This project will be divided in two parts, the first part (this hand-

out) contains the first algorithms covered in class that you must

implement in Matlab. The second part will be assigned after we

have covered in class the remaining algorithms that you will need

to implement.

• For this project you will work individually.

• You must turn in your own work.

• All your programs should run. No partial credit will be given

for programs that do not run.

• You must use at least five test cases for each program. You

must turn in the input and output of each one of your test

cases.

Please start working as soon as possible.

2 About the programs

2.1 Programming Language

The programs must be written in Matlab (m files), and the in-

put should be read from a file. Please refer to the following link:

https://www.mathworks.com/help/matlab/ref/fscanf.html

for information on how to read files in matlab.

2.2 Style

All your programs must be correctly indented and must include

comments (use % in matlab) describing the major parts of the al-

gorithm. If you use any other variables that are not the usual ones

described in the lecture notes, please explain in your comments the

meaning of each one of those variables.

1

3 Algorithms

The following is the list of all the algorithms that you must imple-

ment:

1. Horner: Given the coefficients of a polynomial a0, a1, . . . , an,

and a real number x0, find P (x0), P

′(x0), P

′′(x0), P

(3)(x0), . . . , P

(n)(x0)

Sample input representing P (x) = 2+3x−x2+2x3, x0 = 3.5:

3

2

3

-1

2

3.5

the first number is the degree of the polynomial (n), the coef-

ficients are in order a0, a1, . . . , an, the last number is x0.

2. Newton with Horner: Given the coefficients of a polynomial

a0, a1, . . . , an, an initial guess x0 ∈ R, an error tolerance ǫ,

and a maximum number of iterations N , find one root of the

polynomial.

Input format is the same as above, plus two more lines for ǫ

and N

Important: no credit will be given if the method does

not use Horner.

The output is just one number representing the solution within

the desired error tolerance, or a message saying that the solu-

tion was not found.

2

3. Cramer’s Rule: Given a matrix A representing a system of

equations, and a vector b of independent terms, use Gaussian

Elimination to find all the determinants needed to solve the

system. The program must output the value of each of the

n + 1 determinants as well as the solution x1, x2, . . . , xn.

Sample input representing the system:

3 4 2

−1 3 −4

2 2 5

x1

x2

x3

=

5

2

−6

is:

3

3

4

2

-1

3

-4

2

2

5

5

2

-6

The expected output should be:

determinant A = 41

determinant A1 = 215

determinant A2 = -53

determinant A3 = -114

x1 = 5.24390

x2 = -1.29268

x3 = -2.78049

3

4. Neville’s Method: Given a set of n+ 1 points

(x0, y0), (x1, y1), . . . , (xn, yn) and x0 ∈ R

use Neville’s Algorithm to find Pn(x0) where Pn(x) is the unique

polynomial that goes through all of the given points.

Sample input representing the points (−1, 1), (0, 0), (1, 1) and

x0 = 0.5:

2

-1

1

0

0

1

1

0.5

where the first number is n, then the pairs xi, yi, and the last

number is x0

The expected output should be:

P(0.5) = 0.25

x

联系我们

- QQ：99515681
- 邮箱：99515681@qq.com
- 工作时间：8:00-23:00
- 微信：codinghelp2

- Fre6831 Computational Finance 2021-02-28
- Sta141b Assignment 5 Interactive Visu... 2021-02-28
- Eecs2011a-F20 2021-02-28
- Comp-251 Final Asssessment 2021-02-28
- 代写cs1027课程程序、代做java编程语言、代写java留学生编程帮做h 2021-02-28
- 代做csci 151程序实验、代写programming编程、C+,Java 2021-02-28
- 代写data编程、R留学生程序代做、代写r编程语言代做留学生processi 2021-02-28
- 代写csce 440编程、代做java，Python程序语言帮做c/C++编 2021-02-28
- Cst2330程序代做、Data Analysis程序代写、代写python 2021-02-28
- 代写cmpsc473编程、C++程序设计调试、代写data编程课程调试mat 2021-02-28
- Comp3018 Coursework 2 2021-02-27
- Write A Report To Describe The Analysi... 2021-02-27
- Mlp 2020/21: Coursework 2 2021-02-27
- Stat-3503 Statistics Minors And Study ... 2021-02-27
- Beng0091编程代写、代做r编程实验、R程序设计调试代写r语言程序|代写 2021-02-27
- Ee2028a程序代写、Programming程序语言代做、代写c/C++课 2021-02-27
- Program程序设计代做、C++课程编程代写、C++语言程序调试帮做c/C 2021-02-27
- 代写data留学生编程、代做c/C++程序语言代做r语言程序|代做数据库sq 2021-02-26
- Pic 10B留学生程序代做、C/C++程序调试、C++编程实验代写代写r语 2021-02-26
- 代写csci 4116程序、代做python，Java程序实验、C++编程代 2021-02-26