FORTRAN 95: New to fortran, want to learn how to input a function

Click For Summary
SUMMARY

The forum discussion centers on learning how to input a mathematical function in FORTRAN 95 for a trapezoidal integration program. The user seeks guidance on parsing arithmetic expressions, which is identified as a complex task in compiled languages like FORTRAN. Recommendations include searching for existing code or libraries that facilitate arithmetic expression parsing. The discussion emphasizes the need for a custom solution or leveraging community resources to achieve this functionality.

PREREQUISITES
  • Basic understanding of FORTRAN 95 programming
  • Familiarity with numerical integration techniques, specifically trapezoidal integration
  • Knowledge of parsing algorithms and expression evaluation
  • Experience with searching and utilizing code libraries or community resources
NEXT STEPS
  • Research "FORTRAN 95 arithmetic expression parsing libraries"
  • Explore "implementing a custom arithmetic parser in FORTRAN"
  • Learn about "numerical methods in FORTRAN for integration"
  • Investigate "using external libraries in FORTRAN for mathematical computations"
USEFUL FOR

Students, educators, and developers interested in numerical methods, specifically those working with FORTRAN 95 and seeking to enhance their programming skills in mathematical function input and evaluation.

FuriousJ
Messages
5
Reaction score
0
Hey guys, this is my first post here.

So I'm learning FORTRAN, and I'm writing a trapezoidal integration program as a learning exercise. What I want to do is in addition to asking the user to input the range and precision of the calculations they'd like, I'd also like to be able to enter in the function itself.

From what I can gather this is a fairly non-trivial process and I could use some help.

Even just a general mode of attack that can set me on the right path would be helpful.

Thanks in advance.
 
Technology news on Phys.org
You need to write some code for parsing arithmetic expressions, or find some code that someone else has written. Try Googling for something like

parsing arithmetic expressions fortran
arithmetic parser fortran

etc.

With an interpreted language like Perl, it's often possible to read an arithmetic expression as a string and simply evaluate it. With compiled languages like Fortran, you generally can't do this.
 
Last edited:

Similar threads

  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
13
Views
8K
Replies
5
Views
10K
  • · Replies 2 ·
Replies
2
Views
9K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
10K
Replies
6
Views
4K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K