diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 9846b76..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/IntegralApproximationENG.pdf b/Integral_Approximation_Report_ENG.pdf similarity index 100% rename from IntegralApproximationENG.pdf rename to Integral_Approximation_Report_ENG.pdf diff --git a/Projekt1_Kowalski_Kaniasty_raport.pdf b/Integral_Approximation_Report_PL.pdf similarity index 100% rename from Projekt1_Kowalski_Kaniasty_raport.pdf rename to Integral_Approximation_Report_PL.pdf diff --git a/README.md b/README.md index e93d46d..479a022 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Integral Approximation Project ## Overview -This project focuses on the numerical approximation of integrals using Chebyshev polynomials. It implements and compares the Trapezoidal and Simpson's methods for integral approximation. +This project focuses on the numerical approximation of integrals using [Chebyshev polynomials](https://en.wikipedia.org/wiki/Chebyshev_polynomials). It implements and compares the Trapezoidal and Simpson's methods for integral approximation. ## Features - Implements numerical integration using Trapezoidal and Simpson's methods. @@ -10,14 +10,28 @@ This project focuses on the numerical approximation of integrals using Chebyshev ## Usage 1. Add the project folders to the MATLAB search path. -2. Use provided functions (`trapezoidal`, `simpson`, `chebyshev_combination`) for integral calculations. -3. Explore the GUI application (`examplesGUI.mlapp`) for visual demonstration and error analysis. +2. Use functions (`trapezoidal`, `simpson`) for approximate integral calculations of Chebyshev polynomials. In the project we provide `chebyshev_combination` function that represents polynomials in the form of: $$w_n(x) = \sum_{k=0}^n a_kT_k(x)U_k(x)$$ where $T_k$ is a Chebyshev polynomial of the first kind and $U_k$ - of the second kind. To use `chebyshev_combination` with `trapezoidal` (similarly `simpson`) use the following code (**a** - beggining of the integration interval, **b** - end of the integration interval, **N** - number of subintervals in the composite trapezoidal method, **coefficients** - $a_k$ coefficients for the Chebyshev polynomial): +```matlab + result = trapezoidal(a, b, N, @chebyshev_combination, coefficients) +``` +3. Use functions (`trapezoidal_general`, `simpson_general`) for approximate integral calculations of any function $y = f(x)$. For example +```matlab + result = trapezoidal_general(a, b, N, @my_function) +``` +4. Explore the GUI application `examplesGUI.mlapp` for visual demonstration and comparison of aprroximate results with true integrals. +5. Explore the GUI application `errorsGUI.mlapp` for error visualisations. ## Examples -- Several examples (`chebyshev_example_1`, `chebyshev_example_2`, etc.) are provided to demonstrate the effectiveness of the methods in different scenarios. +- Several examples (`chebyshev_example_1`, `chebyshev_example_2`, etc.) are provided to demonstrate the effectiveness of the methods in different scenarios. See the [report](Integral_Approximation_Report_ENG.pdf) for full description of the examples. ## Error Analysis - The project includes a detailed analysis of the errors associated with each method, including heat maps and relative error comparisons. +- One of the takeaways is that increasing the number of subintervals (**hyperparameter N**) for both methods decreases the relative error of the approximation. + +
+ Figure 1: Graph of the dependence of the relative error expressed in (%) on the number of subintervals in integration by the trapezoidal method
+