Difference between revisions of "Length of a curve using numerical methods"
Line 7: | Line 7: | ||
Instead of evaluating this integral with a table, a numerical method called Simpson's rule can be used: | Instead of evaluating this integral with a table, a numerical method called Simpson's rule can be used: | ||
− | the length of the curve after n iterations = L<sub>n</sub> = (<span>Δ</span>x/3)(f(x<sub>0</sub>) + 4f(x<sub>1</sub>) + 2f(x<sub>2</sub>) + 4f(x<sub>3</sub>) +2f(x<sub>4</sub>) + ...+ 2f(x<sub>n-2</sub>) + 4f(x<sub>n-1</sub>) + f(x<sub>0</sub>)) | + | the length of the curve after n iterations = L<sub>n</sub> = (<span>Δ</span>x/3)(f(x<sub>0</sub>) + 4f(x<sub>1</sub>) + 2f(x<sub>2</sub>) + 4f(x<sub>3</sub>) + 2f(x<sub>4</sub>) + ...+ 2f(x<sub>n-2</sub>) + 4f(x<sub>n-1</sub>) + f(x<sub>0</sub>)) |
where <span>Δ</span>x = (b-a)/n with a and b being the boundaries and n the number of iterations of the calculation. | where <span>Δ</span>x = (b-a)/n with a and b being the boundaries and n the number of iterations of the calculation. | ||
+ | |||
+ | --- | ||
+ | |||
+ | The length of curve equation used in the example was <font size = "+2"><span>∫</span></font>sqr(1+(30e<sup>−0.3t</sup>)<sup>2</sup>)dt | ||
+ | |||
+ | using boundary conditions of 0 and 5 minutes, and using 10 iterations, the problem becomes: | ||
+ | |||
+ | <span>Δ</span>x = (5-0)/10 = 1/2 | ||
+ | the subintervals are {0, 1/2, 1, 3/2, 2, 5/2, 3, 7/2, 4, 9/2, 5} | ||
+ | |||
+ | and the answer is thus = (1/6)(f(x<sub>0</sub>) + 4f(x<sub>1/2</sub>) + 2f(x<sub>1</sub>) + 4f(x<sub>3/2</sub>) + 2f(x<sub>2</sub>) |
Revision as of 18:55, 1 April 2021
Simpson's Rule is used to calculate integrals numerically.
From the Length of curve page, the length can be calculated using the integral: ∫sqr(1+f '(x)2)dx
---
Instead of evaluating this integral with a table, a numerical method called Simpson's rule can be used:
the length of the curve after n iterations = Ln = (Δx/3)(f(x0) + 4f(x1) + 2f(x2) + 4f(x3) + 2f(x4) + ...+ 2f(xn-2) + 4f(xn-1) + f(x0))
where Δx = (b-a)/n with a and b being the boundaries and n the number of iterations of the calculation.
---
The length of curve equation used in the example was ∫sqr(1+(30e−0.3t)2)dt
using boundary conditions of 0 and 5 minutes, and using 10 iterations, the problem becomes:
Δx = (5-0)/10 = 1/2 the subintervals are {0, 1/2, 1, 3/2, 2, 5/2, 3, 7/2, 4, 9/2, 5}
and the answer is thus = (1/6)(f(x0) + 4f(x1/2) + 2f(x1) + 4f(x3/2) + 2f(x2)