Fortran books/resources for beginners

In summary: It seems like Fortran is more suited for solving equations numerically, while Mathematica is better suited for solving equations symbolically. Thanks for that information! It seems like Fortran is more suited for solving equations numerically, while Mathematica is better suited for solving equations symbolically.
  • #1
Whitehole
132
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
  • #3
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 scottdave
  • #4
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?
 
  • #5
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.
 
  • #6
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!
 

1. What is Fortran?

Fortran (short for Formula Translation) is a programming language commonly used for scientific and numerical computing. It was developed in the 1950s and is still widely used today.

2. Why should I learn Fortran?

Fortran is specifically designed for scientific and engineering applications, making it a powerful and reliable tool for handling complex mathematical calculations. It also has a long history and a large community of users, making it a valuable skill to have in the scientific world.

3. What are some good books for beginners to learn Fortran?

Some popular books for beginners include "Fortran for Scientists and Engineers" by Stephen Chapman, "Modern Fortran Explained" by Michael Metcalf, and "Introduction to Programming with Fortran" by Ian Chivers and Jane Sleightholme.

4. Are there any online resources for learning Fortran?

Yes, there are several online resources for learning Fortran, including tutorials, video courses, and interactive coding platforms such as Codecademy and Coursera. The Fortran Wiki and the official Fortran language website also provide a wealth of information and resources for beginners.

5. How long does it take to learn Fortran?

The time it takes to learn Fortran depends on individual learning speed and prior programming experience. However, with dedication and consistent practice, one can become proficient in Fortran within a few months.

Similar threads

  • Science and Math Textbooks
Replies
7
Views
669
  • Science and Math Textbooks
Replies
30
Views
2K
  • Science and Math Textbooks
Replies
5
Views
1K
  • Science and Math Textbooks
Replies
2
Views
1K
  • Science and Math Textbooks
Replies
2
Views
1K
  • Science and Math Textbooks
Replies
5
Views
1K
  • Science and Math Textbooks
Replies
4
Views
957
  • Science and Math Textbooks
Replies
9
Views
875
  • Science and Math Textbooks
Replies
1
Views
2K
  • Programming and Computer Science
Replies
16
Views
1K
Back
Top