Finite difference method in fortran

In summary, if you are experiencing issues with your numerical solution of the PDE for optical fibers in Fortran, you should check your code for errors, verify the boundary conditions, consider numerical stability, and seek assistance from an experienced individual.
  • #1
alexser
1
0
1. I have problem numerical solving of PDE with finite difference method in fortran. it is about optical fibers. At the beginning of the fiber the delta impuls is inserted, and I need function at the end of the fiber.



2. The equation is given in attachement as the code in fortran



3. The problem is that I know that the function at the end of the fiber should drift towards 0 (on X axis) for lenghts of fiber over 30m, but it does not. The problem is in the code but I cannot find where.

If someone could help me I would appreciate it

 

Attachments

  • equation.jpg
    equation.jpg
    12.9 KB · Views: 655
  • Text1.zip
    970 bytes · Views: 260
Physics news on Phys.org
  • #2
.Hello,

I would be happy to assist you with your problem in solving the PDE with finite difference method in Fortran. From your description, it seems like you are trying to model the behavior of optical fibers using a numerical approach. This is a common technique used in many fields of science and engineering, and it can be quite challenging to get accurate results.

First, I would recommend checking your code for any errors or typos. Even a small mistake can greatly affect the accuracy of your results. You can also try debugging your code by printing out intermediate values to see where the problem might be occurring.

Additionally, I would suggest checking the boundary conditions of your problem. These conditions play a crucial role in the behavior of the function at the end of the fiber. If they are not properly defined or implemented in your code, it can lead to incorrect results.

Another important factor to consider is the numerical stability of your method. Some PDEs can be very sensitive to small changes in initial conditions or parameters, and this can cause the function to behave differently than expected. You may need to adjust your parameters or try a different numerical method to improve the stability of your solution.

Lastly, I would recommend consulting with a colleague or a mentor who has experience in solving PDEs with finite difference methods in Fortran. They might be able to provide valuable insights and help you identify the source of the problem.

I hope this helps. Good luck with your research!
 

FAQ: Finite difference method in fortran

1. What is the finite difference method in Fortran?

The finite difference method is a numerical technique used to solve differential equations by approximating the derivatives with finite differences. It is commonly implemented in the Fortran programming language.

2. How does the finite difference method work?

The finite difference method works by dividing a continuous function into discrete points and approximating the derivatives at each point using a finite difference equation. These equations are then solved iteratively to obtain an approximate solution to the original differential equation.

3. What are the advantages of using Fortran for the finite difference method?

Fortran is a programming language specifically designed for scientific and engineering applications. It has a strong focus on numerical computations and allows for efficient implementation of complex mathematical algorithms, such as the finite difference method. Additionally, Fortran has a long history and a large user community, making it a reliable and well-supported choice for scientific computing.

4. What are some common applications of the finite difference method in Fortran?

The finite difference method is commonly used in a variety of fields, including fluid dynamics, heat transfer, and structural analysis. It is also frequently used in the numerical solution of partial differential equations, which arise in many areas of physics, engineering, and mathematics.

5. Are there any limitations of the finite difference method in Fortran?

Like any numerical method, the finite difference method has its limitations. It can only approximate the solution to a differential equation, and the accuracy of the solution depends on the number of points used and the size of the time or spatial steps. Additionally, the finite difference method may not be suitable for problems with complex geometries or discontinuities in the solution.

Back
Top