0% found this document useful (0 votes)
13 views15 pages

numerical method

Uploaded by

Hai Liang Ong
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)
13 views15 pages

numerical method

Uploaded by

Hai Liang Ong
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/ 15

Q1a

Figure 1: matlab coding for Q1a

Figure 2: result from matlab simulation


Q1b

Figure 3: matlab coding for Q1b

Figure 4: result from matlab simulation


Discussion Q1 a
Q1a
The precision of Simpson's Rule in numerical integration is well known. It provides a more
accurate estimate of the integral, particularly for smooth functions, by approximating the
function's curve with second-degree polynomials through the use of parabolic interpolation.
According to the analysis's findings, Simpson's Rule yielded an estimate of 9.6505 with a
0.0000% error rate. This small inaccuracy shows how closely the approximation matches
the integral's exact value. Simpson's Rule, according to Chapra and Canale (2021), is
especially useful for functions that behave continuously and smoothly because it more
precisely captures the function's curvature than lower-order techniques.
By using a sequence of trapezoids to approximate the function, the Trapezium Rule, on the
other hand, takes a more straightforward method. Because of its linear interpolation, this
approach is intrinsically less precise even if it requires less computing power. According
to the analysis's findings, the Trapezium Rule yielded an estimate of 9.6498 with a 0.0080%
error rate. Despite being tiny, the inaccuracy is far greater than Simpson's Rule. Burden
and Faires (2016) point out that this disparity highlights the Trapezium Rule's shortcomings
in capturing the subtleties of the curve, pointing out that the approach frequently
overestimates or underestimates regions, especially for non-linear functions.
Q2

Figure 5a: matlab coding for Q2


Figure 5b: matlab coding for Q2

Figure 6: graph for question 2


Figure 7: result from matlab simulation
Q3

Figure 8: matlab coding for Q3


Figure 8: result from matlab simulation
Q4

Figure 9: matlab coding for Q4a


Figure 10: graph result from matlab simulation
Q4b

Figure 11a: matlab coding for Q4a


Figure 11b: matlab coding for Q4a
Figure 12: result from matlab simulation for Q4b

Q4c
Figure 14: result from matlab simulation for Q4c

Figure 15: result from matlab simulation for Q4b


Q4d
Mode (55.38 kg) = Median (55.21 kg) > Mean (57.23 kg)

This suggests a distribution that is somewhat tilted to the right. A substantial spread around
the mean is indicated by the standard deviation (7.36 kg).
With few higher weights pushing the mean upward, the majority of kids have weights
around the lower classes.
References
Chapra, S. C., & Canale, R. P. (2021). Numerical Methods for Engineers. McGraw-Hill.

You might also like