Converting equations to Fortran code

  • Context: Fortran 
  • Thread starter Thread starter jf22901
  • Start date Start date
  • Tags Tags
    Code Fortran
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 4K views
jf22901
Messages
55
Reaction score
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:
 
Physics news on Phys.org
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.