Feeds:
Posts
Comments

Posts Tagged ‘science’

The diffusion  equations: Assuming a constant diffusion coefficient, D, we use the Crank-Nicolson methos (second order accurate in time and space): u[n+1,j]-u[n,j] = 0.5 a {(u[n+1,j+1] – 2u[n+1,j] + u[n+1,j-1])+(u[n,j+1] – 2u[n,j] + u[n,j-1])} A linear system of equations, A.U[n+1] = B.U[n], should be solved in each time setp. As an example, we take a [...]

Read Full Post »

Sometimes we have to prepare scatter plot of two parameters. When number of elements in each parameter is a big number, e.g., several thousands, and points are concentrated, it is very difficult to use a standard scatter plot. The reason is that due to over-population, one cannot say where the density has a maximum. In [...]

Read Full Post »

Importance sampling is choosing a good distribution from which to simulate one’s random variables. It involves multiplying the integrand by 1 (usually dressed up in a “tricky fashion”) to yield an expectation of a quantity that varies less than the original integrand over the region of integration. We now return to it in a slightly [...]

Read Full Post »

Monte Carlo Integration

In mathematics, Monte Carlo integration is numerical integration using random numbers. That is, Monte Carlo integration methods are algorithms for the approximate evaluation of definite integrals, usually multidimensional ones. The usual algorithms evaluate the integrand at a regular grid. Monte Carlo methods, however, randomly choose the points at which the integrand is evaluated. It is [...]

Read Full Post »

A word on PDEs

So far, we discussed very simple problems. From now one, we want to simulate some simple problems, e.g., the diffusion equation. For this reason, I would like to have a very short discussion on the PDEs. I refer the interested reader to chapter 19 of Numerical Recipes. Partial differential equations are at the heart of [...]

Read Full Post »

Older Posts »

Follow

Get every new post delivered to your Inbox.