Fortran books/resources for beginners

  • Context: Computational 
  • Thread starter Thread starter Whitehole
  • Start date Start date
  • Tags Tags
    Beginners Fortran
Click For Summary

Discussion Overview

The discussion revolves around resources and recommendations for beginners learning Fortran, particularly in the context of its application to mathematics and physics. Participants explore the differences between various versions of Fortran and compare its capabilities to those of Mathematica, especially regarding solving differential equations.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant seeks recommendations for learning Fortran with a focus on its application in physics and mathematics, expressing a lack of programming experience.
  • Another participant suggests looking at lecture notes and exercises on scientific Fortran programming as a resource.
  • Some participants recommend online tutorials and the book "Numerical Recipes in Fortran" for learning numerical methods.
  • There is a discussion about the historical context of Fortran, noting that Fortran 77 uses a fixed column format and suggesting that beginners should focus on Fortran 90 or newer versions.
  • One participant questions how Fortran handles differential equations compared to Mathematica, noting that Fortran requires a sequence of basic arithmetic operations rather than symbolic manipulation.
  • Another participant reiterates the point that programming languages like Fortran do not understand symbolic formulas and require explicit numerical techniques for solving equations.

Areas of Agreement / Disagreement

Participants generally agree on the usefulness of certain resources for learning Fortran and the differences between its versions. However, there is a lack of consensus on the specific methodologies for solving differential equations in Fortran compared to Mathematica, with some participants emphasizing the limitations of Fortran in symbolic computation.

Contextual Notes

The discussion highlights the differences in capabilities between programming languages and symbolic computation tools, but does not resolve the nuances of how these differences impact practical applications in solving differential equations.

Whitehole
Messages
128
Reaction score
4
I have a background of undergraduate physics but I consider myself to be quite weak in programming. I'm aware of the usefulness of computational software/programming software in the sciences, particularly physics. I'd like to ask for recommendations on how to start learning fortran assuming I have little to no knowledge about programming. It's better if for example the book applies it to mathematics or physics problems.

Also, what is the difference between the fortrans that I see, can anyone give me a brief background on this?
 
Physics news on Phys.org
There are some good tutorials available on-line. Google "fortran tutorial".

After that, you can check out Numerical Recipes in Fortran, to learn more about numerical methods.

As for the different flavors of Fortran, you should know that Fortran has a long history dating back to the time of punch cards. Fortran 77 still uses a fixed column format for program input, in keeping with what one would have to do with a punch card. Except for maintaining legacy code, no-one should be programming like this anymore, so you should learn Fortran 90 (or newer incarnations). The differences between Fortran 90, 95, and later implementations is minimal, and certainly not important for a beginner.
 
  • Like
Likes   Reactions: scottdave
DrClaude said:
There are some good tutorials available on-line. Google "fortran tutorial".

After that, you can check out Numerical Recipes in Fortran, to learn more about numerical methods.

As for the different flavors of Fortran, you should know that Fortran has a long history dating back to the time of punch cards. Fortran 77 still uses a fixed column format for program input, in keeping with what one would have to do with a punch card. Except for maintaining legacy code, no-one should be programming like this anymore, so you should learn Fortran 90 (or newer incarnations). The differences between Fortran 90, 95, and later implementations is minimal, and certainly not important for a beginner.
Thanks for that resource, but how does Fortran really work? For example in Mathematica, suppose I have a set of DE's and I want to get the solution to those DE's because I want to get the value of a quantity that depends on those solutions. You can solve the system of differential equations using NDSolve, then we can store the solutions to some variable then plug into the corresponding quantities, i.e.

sol = NDSolve[{y''[t] + y'[t] + y[t] ==0, p' + p == y'[t], y[0]==1, y'[0]==1, p[0]==2}, {y, p}, {t, to, tf}]

ysol[t] /. sol
y'[t] /. sol
p[t] /. sol

F(y,y',p):= some expression

then we can plot F.

I'm trying to search on how to solve DE's in Fortran but all I see are just numerical techniques applied in Fortran. So how is Fortran different from Mathematica in this aspect?
 
Whitehole said:
I'm trying to search on how to solve DE's in Fortran but all I see are just numerical techniques applied in Fortran. So how is Fortran different from Mathematica in this aspect?

Programming languages like C or Fortran don't understand symbolic formulae like differential equations, and don't know how to simplify expressions, as in ##(x^2 - 1)/(x+1) = x-1##. If you want to use Fortran to tell the computer how to solve a differential equation, you have to reduce the solution process to a sequence of very basic arithmetic operations (summing, multiplication, division). This is how real programming languages differ from something like Mathematica.
 
hilbert2 said:
Programming languages like C or Fortran don't understand symbolic formulae like differential equations, and don't know how to simplify expressions, as in ##(x^2 - 1)/(x+1) = x-1##. If you want to use Fortran to tell the computer how to solve a differential equation, you have to reduce the solution process to a sequence of very basic arithmetic operations (summing, multiplication, division). This is how real programming languages differ from something like Mathematica.
Thanks for that information!
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
13K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 30 ·
2
Replies
30
Views
7K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 2 ·
Replies
2
Views
4K