Fortran 77 Nonlinear Equations Minipack

In summary, Theo found a Fortran code available on the internet, but there are some missing subroutines. He downloaded FILE15 which contains all the missing subroutines, and compiled and linked it with HYBRD1. The missing subroutines were not needed, and he successfully compiled and ran the code.
  • #1
Sunset
63
0
Hi!

I frequently have to solve systems of nonlinear equations with Fortran. So far I used a code which I didn't write by myself which is based on a Newtonian root finder from Numerical recipes.
I would like to write a Fortran code on my own, based on another Numerical subroutine available on the internet.

I found "Minipack" http://www.netlib.org/minpack/
But there are subroutines missing? I wanted to compile the testprogram file08.f (under link ex). In the description is said what is needed to include: MINPACK-SUPPLIED ... SPMPAR,ENORM,HYBRD1,INITPT,VECFCN . But there's no file spmpar.f on the above page to download!? If you run file08.f it consequently tells you that there are undefined references.

It needn't to be Minipack! I just want to get to a program over which I have "full control / overwiev". Is there a good documentation on the internet or a book on how to solve nonlinear equations with fortran?

Martin
 
Technology news on Phys.org
  • #2
Reviewing the netlib site, I see the following:

Routines INITPT & VECFCN are in FILE08

Download hybrd1.f and its dependencies located 9 links below the link for "ex". Hybrd1 contains all other externals (ENORM, DPMPAR, etc).

You'll be asked whether on not you want the BLAS routines downloaded as well. I don't know if these routines require BLAS but if you don't already have them, then you might as well download them as well.

You need to compile and link FILE08 and HYBRD1 together (and possibly with the BLAS routines).
 
  • #3
Hello Theo!

Thanks for your reply.

I copied the text from file08 + hybrd1 & its dependencies + BLAS into one file "1.f" and compiled it.
Compiler still misses something: undefined reference to `spmpar_'

I also tried to add the line INCLUDE HYBRD1.F to file08.f and put the text from hybrd1 & its dependencies + BLAS into a separate file HYBRD1.F in the same directory of my computer, that doesn't work either

Best regards
 
  • #4
Yeah - what you want is FILE15 instead of FILE08. This is the double precision version of FILE08. That's why its complaining about the missing single precision program SPMPAR. Sorry for the mix-up.

So download FILE15 and try again.

(Also, just browsing, I don't think these programs need the BLAS routines - you may want to try to exclude them after you try above).
 
  • #5
Hello Theo!

The compilation works

Only the executable file a.out I cannot open

severe (64): input conversion error, unit 5, file /dev/pts/3
Image PC Routine Line Source
a.out 0808F92C Unknown Unknown Unknown
a.out 0808E624 Unknown Unknown Unknown
a.out 0808D2C5 Unknown Unknown Unknown
a.out 0805D1D0 Unknown Unknown Unknown
a.out 0805D6A7 Unknown Unknown Unknown
a.out 08054196 Unknown Unknown Unknown
a.out 080531AD Unknown Unknown Unknown
a.out 0804A43E Unknown Unknown Unknown
a.out 0804A3B9 Unknown Unknown Unknown
Unknown B7BCA974 Unknown Unknown Unknown
a.out 0804A2D1 Unknown Unknown Unknownbest regards
 
  • #6
Sunset - what do you mean by "Only the executable file a.out I cannot open"

What compiler are you using?

The result of the compliation will be an executable. For example, using the complier "gfortran", the executable will be named "a.out" unless you specifically name it to something else by the "-o" compilier switch.

Try renaming the "a.out" file to an exe file (ie, "a.exe") and run that file.

The executable will expect three input parameters from the console. The three parameters are (1) Problem number, (2) Dimension, and (3) Number of Trials. Type these in separating with commas, and hit Enter. The results should post on the console screen.

See "file21" for other input data.
 
  • #7
Hello Theo!

Ah ok didn't know that, I always worked with programs where the command ./a.out gave an data-file with the results and was confused why nothing happened.

Ok great, thanks again for your help

Martin
 

FAQ: Fortran 77 Nonlinear Equations Minipack

What is Fortran 77 Nonlinear Equations Minipack?

Fortran 77 Nonlinear Equations Minipack is a collection of subroutines specifically designed to solve nonlinear equations in scientific computing. It was developed in the Fortran 77 programming language and is widely used in various fields such as physics, engineering, and mathematics.

What types of nonlinear equations can be solved using this minipack?

This minipack can solve a wide range of nonlinear equations, including systems of equations, single equations, and transcendental equations. It can also handle both real and complex variables.

How does Fortran 77 Nonlinear Equations Minipack work?

The minipack uses various numerical methods, such as Newton's method, bisection method, and secant method, to find the root of the nonlinear equation. It also incorporates efficient algorithms to handle various types of equations and ensure fast convergence.

Is Fortran 77 Nonlinear Equations Minipack still relevant in scientific computing?

Yes, Fortran 77 Nonlinear Equations Minipack is still widely used in scientific computing, especially in fields where Fortran is the preferred programming language. It is a reliable and efficient tool for solving nonlinear equations and has been continuously updated and improved over the years.

Is Fortran 77 Nonlinear Equations Minipack suitable for beginners?

While some knowledge of Fortran programming is necessary to use this minipack, it is relatively easy to learn and can be used by beginners with some basic understanding of programming and numerical methods. However, it is recommended to have some familiarity with Fortran before using this minipack.

Similar threads

Replies
3
Views
2K
Replies
4
Views
2K
Replies
8
Views
4K
Replies
6
Views
7K
Replies
6
Views
2K
Replies
2
Views
2K
Replies
6
Views
2K
Replies
2
Views
1K
Replies
2
Views
2K
Replies
25
Views
10K
Back
Top