Solving Gas Dynamics Equation with Secant Method - Troubleshooting Float Error

  • Thread starter Thread starter trish129
  • Start date Start date
  • Tags Tags
    Error
AI Thread Summary
The discussion revolves around a user seeking assistance with a Fortran implementation of the secant method for a gas dynamics equation. The user encounters a "floating error" during execution and requests help to identify and correct the issue in their code. They mention that the equation is complex and difficult to implement, and they have attached an image of the equation along with the code. A response points out a potential mistake in the code where the user is trying to assign values to an undeclared array instead of defining a function properly. Additionally, there is a question raised about the similarity of the documents shared by two users, suggesting possible duplication or collaboration.
trish129
Messages
2
Reaction score
0
please help mee remove this error

i coded a secantt method ..the function was a gas dynamics equation.on executing it is giving me an error:float error...

i have attached both the question and the code..

thank u..
 

Attachments

Technology news on Phys.org
please help me correct this error in fortran

hey i coded secant method in fortran ...the equation was quite big and diffocult to put in..someow managed to do it..but on execution it is giving errors..please can you correct the mistake..thank you..would be a great learning for you...

heres the file containing the image of the equation and the fortran code..

erro:math erorr..floating error..

where am i wrong in the code
 

Attachments

Last edited by a moderator:


Where you think you are defining a function, you are actually attempting to assign values an array that you haven't declared.

Code:
!C     DEFINE FUNCTION F
      F(M_20)=10-(6**(1/2))*(atan((((M_20)**2)-1)/6)**(1/2))-((atan((((m_1)**2)-1)/6)**(1/2)))+(atan((((M_20)**2)-

1)**(1/2))-(atan((((m_1)**2)-1)**(1/2))))


Here's a link to a topic on Fortran functions and subroutines: http://www.livephysics.com/computational-physics/fortran/fortran-subroutines-and-functions.html
 


trish129 said:
i coded a secantt method ..the function was a gas dynamics equation.on executing it is giving me an error:float error...

i have attached both the question and the code..

thank u..

fahad20 said:
hey i coded secant method in fortran ...the equation was quite big and diffocult to put in..someow managed to do it..but on execution it is giving errors..please can you correct the mistake..thank you..would be a great learning for you...

heres the file containing the image of the equation and the fortran code..

erro:math erorr..floating error..

where am i wrong in the code

How is it that you both independently coded up this problem, and have exactly the same document?
 
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

Back
Top