0% found this document useful (0 votes)
80 views5 pages

American University of Sharjah: NGN 509 - Computational Methods Professor Nai-Shyong Yeh Assignment #2

This document is an assignment submission for a computational methods course. It contains plots of data with polynomial approximations of varying degrees (n=1,3,5) and a cubic spline. It also contains the coefficients for a third-order polynomial approximation of some data and the calculation of the standard deviation of that approximation. Questions ask to explain aspects of fitting data and calculating standard deviation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views5 pages

American University of Sharjah: NGN 509 - Computational Methods Professor Nai-Shyong Yeh Assignment #2

This document is an assignment submission for a computational methods course. It contains plots of data with polynomial approximations of varying degrees (n=1,3,5) and a cubic spline. It also contains the coefficients for a third-order polynomial approximation of some data and the calculation of the standard deviation of that approximation. Questions ask to explain aspects of fitting data and calculating standard deviation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

American University of Sharjah

College of Engineering

NGN 509 – Computational Methods


Professor Nai-Shyong Yeh
Assignment #2

Mostafa Mohamed Moussa - 59665

Submitted on 21st of March 2019


Q1.
Code is in m-file. Figures are as shown: (not done on same graph for visibility)

Plot of data w/out approx & fitting Plot of data, n=1


3 2.6

2.4

2.5
2.2

2
2
1.8

f(x)
1.6
f(x)

1.5

1.4

1
1.2

1
0.5
0.8

0 0.6
0 2 4 6 8 10 12 14 0 2 4 6 8 10 12 14

x x
Plot of data, n=5
Plot of data, n=3 2.5
2.5

2
2

1.5
1.5
f(x)
f(x)

1
1

0.5
0.5

0
0 0 2 4 6 8 10 12 14
0 2 4 6 8 10 12 14
x
x

Cubic Spline
3

2.5

2
f(x)

1.5
Q2.
1

0.5

0
0 2 4 6 8 10 12 14
x
Code is in the m-file. From the code, you get: a0 = 0.0033, a1 = 0.4970, a2 = -0.2738, a3 = 0.0511
so the third-order polynomial is: p3(x) = 0.0033 + 0.4970 x - 0.2738 x2 + 0.0511 x3
n
Standard deviation = 0.0099. σ =
√ S
n−m i=1
2
|
, S=∑ e ei=Yi-yi | n=6, m=3.
Q3.
1 & 3)
2)

Plots of y vs x and the fitting function f(x)


300
y
f(x)

250

200
y/f(x)

150

100

50

0
1 2 3 4 5 6 7 8
x

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy