Fortran 77 Nonlinear Equations Minipack

  • Fortran
  • Thread starter Sunset
  • Start date
63
0

Main Question or Discussion Point

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?

Best regards, Martin
 

Answers and Replies

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).
 
63
0
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 seperate file HYBRD1.F in the same directory of my computer, that doesn't work either

Best regards
 
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).
 
63
0
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 Unknown


best regards
 
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.
 
63
0
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

Best regards, Martin
 

Related Threads for: Fortran 77 Nonlinear Equations Minipack

  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
7
Views
5K
Replies
8
Views
2K
  • Last Post
Replies
1
Views
4K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
4
Views
2K
  • Last Post
Replies
6
Views
5K
Replies
29
Views
4K
Top