Fortran Solving Problem in Fortran Program - Bevington Polyfit.f

  • Thread starter Thread starter akila
  • Start date Start date
  • Tags Tags
    Fortran
AI Thread Summary
A user is experiencing issues with a Fortran program designed to fit a second-order polynomial to their data, based on the Bevington library's polfit.f. While the program works correctly with random data, it fails to produce the expected coefficients for the user's specific dataset. The expected coefficients are a = 1.4558E+03, b = -3.6779E+02, and c = 2.3247E+01, but the output is significantly different: a = -16.2157, b = -1.7813, and c = 0.4969. Suggestions for troubleshooting include checking compiler options, ensuring the use of the IMPLICIT NONE statement, and verifying that the input data is correct according to the library's documentation, particularly regarding the variable MODE in the subroutine.
akila
Messages
1
Reaction score
0
hi all,

greetings,
i have a fortran prg to fit 2nd order polynomial to my data
taken from (bevington--- polfit.f)

i'm making some mistake, and i could not find what is the problem with this.
When i give some other other random data it is fitting properly
but not the data i have :(
for y = a + bx + cx^2 i should get the coefficients to be

a = 1.4558380406304288E+03
b = -3.6779173737460803E+02
c = 2.3247378080674739E+01

but I am getting as
a = -16.2156696
b = -1.78127503
c = 0.496948689


can somebody please please help me to find out the problem

here i have attached the prg

thank you,
regards,
akila
 

Attachments

Technology news on Phys.org
Firstly, you can enclose code directly into the forum by using the CODE tags.

OK, what compiler options have you used? I notice that you don't include an IMPLICIT NONE statement. wt is not defined as an array, how does the implicit declaration work for arrays?

If you got polfit from some sort of library, then your inputs are probably wrong. Also, go back to that library's documentation and make sure you know what all those variables are. For example, the variable MODE in the subroutine isn't crystal clear to me.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

Similar threads

Replies
8
Views
2K
Replies
7
Views
3K
Replies
22
Views
5K
Replies
6
Views
3K
Replies
3
Views
4K
Replies
4
Views
1K
Replies
4
Views
2K
Replies
2
Views
12K
Back
Top