Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Converting equations to Fortran code

  1. Aug 7, 2011 #1
    Hi everyone

    I've been doing maths for quite a while now, but have never done any programming until recently. What I'm finding difficult is how you go from an initial value/boundary value problem on a bit of paper to a piece of code that will approximate the equation. I've done a bit of book work on numerical methods (Euler’s midpoint/trapezoidal methods, Runge–Kutta methods) so understand the basics, but would like a more thorough knowledge.

    Can anyone suggest any good sites/documents/books that give examples or explanations? Searching online brings up loads of pre-prepared Fortran codes to solve all sorts of things, but I want to know how these codes were created, why they chose the methods they did etc.

    Thanks very much in advance. :smile:
  2. jcsd
  3. Aug 8, 2011 #2
    Most numerical analysis books offer pretty easy sample programs and tutorials on how to program those exact problems. Finding the area under the curve via an integral is simply a do-loop in FORTRAN. If you narrow your step size, you should get a reasonably accurate result.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook