domingo, 1 de diciembre de 2013

Simpson and Montecarlo


Hi!
Before showing the results of my work in parallel will talk a little about Simpson and montecarlo's method  because I needed to know to solve it : Homework

Homero
Simpson's rule:

In numerical analysis, Simpson's rule is a method for numerical integration, the numerical approximation of definite intregals.
Let the following approximation:

\(\small \displaystyle \int_{a}^{b}f(x) \approx \frac{b-a}{6}[f(a) +4f(\frac{a+b}{2}) + f(b)]\)


We assume a cuadratic function f(x) :


How can we obtain a cuadratic function?

Lagrange Interpolation:

With this the curve approximates a parabola P(x):
$$\small \displaystyle P(x)= f(a)\frac{(x-c)(x-b)}{(a-c)(a-b)} + f(c)\frac{(x-a)(x-b)}{(c-a)(c-b)} + f(b)\frac{(x-a)(x-c)}{(b-a)(b-c)}$$

If i integrate P(x), obtain: \(\displaystyle \int_{a}^{b}P(x) = \frac{b-a}{6}[f(a) +4f(\frac{a+b}{2}) + f(b)]\)

The error in this approximation is proportional to: \(\displaystyle \frac{1}{90}(\frac{b-a}{2})^{5}\)


Monte Carlo method:

Monte Carlo methods are especially useful for simulating systems with many coupled degrees of freedom, such as fluids, disordered materials, strongly coupled solids, and cellular structures.



The result of the last Homework is: 1.881185e+009
                                                                                                        

2 comentarios: