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.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...

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