- #1
!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))))
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
Gas Dynamics Equation is a mathematical model that describes the behavior of gases in motion. It is important because it helps us understand and predict the performance of various systems such as rockets, jet engines, and wind turbines.
The Secant Method is a numerical method used to find the root of a function by approximating it with secant lines. It is often used in solving Gas Dynamics Equation as it allows for an efficient and accurate solution.
A Float Error occurs when the result of a calculation is too large to be represented by the computer's memory. This can happen when solving Gas Dynamics Equation with Secant Method if the initial guess is too far from the actual root, causing the algorithm to diverge and produce very large values.
To troubleshoot a Float Error, you can try adjusting the initial guess or using a different method such as the Bisection Method. It is also important to check for any errors in the implementation of the Secant Method and make sure the equation is correctly coded.
Yes, there are other methods such as the Newton-Raphson Method, Fixed Point Iteration, and Regula Falsi Method that can also be used to solve Gas Dynamics Equation. Each method has its own advantages and disadvantages, so it is important to choose the most appropriate one for the specific problem at hand.