This repository contains a Python implementation of the Finite Element Method (FEM) for solving electromagnetic potential problem. The project was developed as part of the Differential Equations course at AGH University of Krakow.
The repository includes the following key components:
- main.py: Sets up a graphical user interface using Matplotlib and Seaborn for visualizing the FEM solution. It provides interactive elements such as a text box for inputting the number of points and a button to trigger the drawing of the solution plot.
- solver.py: Contains the core functions for calculating the FEM solution. It defines various helper functions for basis functions, their derivatives, and the assembly of matrices required for solving the FEM equation. The
solvefunction computes the solution for a specified number of points.
Make sure you have the required Python libraries installed. You can install them using the requirements.txt file:
pip install -r requirements.txtClone the repository:
git clone https://github.com/OlaszPL/Finite_element_method.git
cd Finite_element_methodRun the main script:
python main.pyEnter the desired number of points in the text box and click the "Draw" button to visualize the FEM solution.
- main.py: Sets up the GUI and handles user interactions.
- solver.py: Contains the implementation of the FEM solver.
- wyliczenia sformułowania wariacyjnego.pdf: Documentation of the variational formulation calculations (in Polish).
This project is licensed under the MIT License.

