Skip to main content

Posts

Showing posts with the label Numerical Methods

MDoubt No 000021 - GATE

GATE [ME, 2017, 2 marks] Question : $P(0.3)$, $Q(0.5,4)$ and $R(1,5)$ are three points on the curve defined by $f(x)$. Numerical integration is carried out using both Trapezoidal rule and Simpson's rule within limits $x=0$ and $x=1$ for the curve. The difference between the two results will be (a) $0$ (b) $0.25$ (c) $0.5$ (d) $1$ Solution :   $x$     $0$     $0.5$     $1$     $y$     $3$     $4$     $5$   $h=\dfrac{1}{2}$ Using Trapezoidal rule $\displaystyle\int\limits_{a}^{b}F(x)dx=\dfrac{h}{2}[(y_0+y_{n})+2(y_1+y_2+\cdots+y_{n-1})]$ $\displaystyle\int\limits_{0}^{1}F(x)dx=\dfrac{1/2}{2}[(3+5)+2(4)]$ $\displaystyle\int\limits_{0}^{1}F(x)dx=4$ Using Simpson's rule $\displaystyle\int\limits_{a}^{b}F(x)dx=\dfrac{h}{3}[(y_0+y_n)+4(y_1+y_3+\cdots+y_{n-1})+2(y_2+y_4+\cdots+y_{n-2})]$ $\displaystyle\int\limits_{0}^{1}F(x)dx=\dfrac{1/2}{3}[(8+16)+4(4)]$ $\dis...

MDoubt No 000020 - GATE

GATE [ME, 2016, 2 marks] Question : The error in numerically computing the integral $\displaystyle\int\limits_0^{\pi}(\sin x+\cos x)dx$ using the Trapezoidal rule with three intervals of equal lenght between $0$ and $\pi$ is____. Solution : Given $F(x)=\sin x+\cos x$ $h=\dfrac{b-a}{n}=\dfrac{\pi-0}{3}=\dfrac{\pi}{3}$  $x$   $0$   $\dfrac{\pi}{3}$   $\dfrac{2\pi}{3}$   $\pi$   $\sin x+\cos x$   $1$   $1.366$   $0.366$   $-1$  By Trapezoidal rule $\displaystyle\int\limits_{a}^{b}F(x)dx=\dfrac{h}{2}[(y_0+y_{n})+2(y_1+y_2+\cdots+y_{n-1})]$ $\displaystyle\int\limits_{0}^{\pi}\sin x+\cos xdx=\dfrac{\pi/3}{2}[(1-1)+2(1.366+0.366)]$ $\displaystyle\int\limits_{0}^{\pi}\sin x+\cos xdx=1.181$ By definite integration $\displaystyle\int\limits_{0}^{\pi}\sin x+\cos xdx=\left|-\cos x+\sin x\right|^{0}_{\pi}$ $\displaystyle\int\limits_{0}^{\pi}\sin...