15.02.2015 Views

Numerical Modelling in Fortran: day 2

Numerical Modelling in Fortran: day 2

Numerical Modelling in Fortran: day 2

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

F<strong>in</strong>ite Difference grid <strong>in</strong> 1-D<br />

• Grid po<strong>in</strong>ts x 0 , x 1 , x 2 …x N<br />

• Here xi=x 0 +i*h<br />

• Function values y 0 , y 1 , y 2 …y N<br />

• Stored <strong>in</strong> array y(i)<br />

• (<strong>Fortran</strong>, by default, starts<br />

arrays at i=1, but you can<br />

change this to i=0)<br />

⎛<br />

⎝<br />

⎜<br />

dy<br />

dx<br />

⎞<br />

⎠<br />

⎟<br />

i<br />

≈ Δy<br />

Δx<br />

=<br />

y(i +1) − y(i)<br />

h

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!