{"id":28348515,"url":"https://github.com/lisechemistry/numerical_methods_master_projects","last_synced_at":"2026-01-27T11:05:22.899Z","repository":{"id":287078382,"uuid":"963531092","full_name":"LiseChemistry/Numerical_Methods_Master_Projects","owner":"LiseChemistry","description":"Numerical projects using Fortran and Python: interpolation/extrapolation of molecular potentials (O₂, C₂H₅), integration and differentiation (average value, VO₂(R)), and model fitting of a spectroscopic Hamiltonian.","archived":false,"fork":false,"pushed_at":"2025-04-13T21:00:31.000Z","size":320,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-21T05:37:34.159Z","etag":null,"topics":["differentiation","extrapolation","fortran","integration","interpolation-methods","numerical-methods","python","sobol-sequence"],"latest_commit_sha":null,"homepage":"","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LiseChemistry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-09T20:27:10.000Z","updated_at":"2025-04-13T21:00:34.000Z","dependencies_parsed_at":"2025-04-09T21:35:39.659Z","dependency_job_id":"f5e4ef06-c09d-4bbb-9557-99f594f5c322","html_url":"https://github.com/LiseChemistry/Numerical_Methods_Master_Projects","commit_stats":null,"previous_names":["lisechemistry/numerical_methods_master_projects"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LiseChemistry/Numerical_Methods_Master_Projects","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiseChemistry%2FNumerical_Methods_Master_Projects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiseChemistry%2FNumerical_Methods_Master_Projects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiseChemistry%2FNumerical_Methods_Master_Projects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiseChemistry%2FNumerical_Methods_Master_Projects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LiseChemistry","download_url":"https://codeload.github.com/LiseChemistry/Numerical_Methods_Master_Projects/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiseChemistry%2FNumerical_Methods_Master_Projects/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28812367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T07:41:26.337Z","status":"ssl_error","status_checked_at":"2026-01-27T07:41:08.776Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["differentiation","extrapolation","fortran","integration","interpolation-methods","numerical-methods","python","sobol-sequence"],"created_at":"2025-05-27T18:11:17.820Z","updated_at":"2026-01-27T11:05:22.893Z","avatar_url":"https://github.com/LiseChemistry.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📚 **Numerical Methods – Master Projects**\n\n[![Fortran](https://img.shields.io/badge/code-Fortran-blue?style=flat-square\u0026logo=fortran)](https://en.wikipedia.org/wiki/Fortran)\n[![Python](https://img.shields.io/badge/code-Python-yellow?style=flat-square\u0026logo=python)](https://www.python.org/)\n[![License](https://img.shields.io/badge/license-MIT-green?style=flat-square)](LICENSE)\n\n## 📘 Overview\n\nThis repository contains numerical methods projects completed during my Master’s program. The projects involve scientific programming in **Fortran** and **Python**, focusing on:\n\n🔹 **Project 1: Interpolation / Extrapolation**  \n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;• Potential of O₂  \n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;• Potential of the C₂H₅ radical  \n\n🔹 **Project 2: Integration \u0026 Differentiation**  \n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;• Average value  \n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;• Numerical derivatives of VO₂(R)  \n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;• Integration  \n\n🔹 **Project 3: Model Fitting**  \n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;• Spectroscopic Hamiltonian analysis  \n\n\u003e 🧠 Developed using **Fortran** for high-performance numerical tasks and **Python** for data fitting and visualization.\n\n---\n\n### Project I: Interpolation/Extrapolation (Fortran)  \n\n#### 📌Exercise 1: Potential of O₂ \n\nWe consider the internuclear potential of the O₂ molecule:\n\n```math\nV(R) = -D \\left\\{1 + c_1(R - R^*) + c_2(R - R^*)^2 + c_3(R - R^*)^3 \\right\\} e^{-\\alpha(R - R^*)}\n```\n\nWhere:\n\n- D = 3.8886 eV  \n- R* = 2.2818 a₀\n- α = 3.3522498 a₀⁻¹  \n- c₁ = 3.6445906 a₀⁻¹  \n- c₂ = 3.9281238 a₀⁻²  \n- c₃ = 2.0986689 a₀⁻³\n\nThis is a model adjusted to experimental spectroscopic data.\n\nWe want to interpolate the potential over the interval [1.8, 7]a₀ using these points:\n\n```math\n\\{ R_q \\} = \\{1.8, 2.1, 2.4, 2.8, 3.3, 4.0, 5.0, 7.0\\}\n```\n##### 🧩Interpolation Methods:\n- Lagrange Polynomial ( L(R) )\n- Polynomial in powers of ( 1/R )\n- Rational Polynomial (`RatInt.f`)\n- Cubic Splines (`Spline.f`)\n\nPlot the interpolation error:\n\n```math\n|V(R_i) - V_{\\text{Int}}(R_i)|\n```\non a **logarithmic scale** for R in [1.8, 10], and compare the behavior of the interpolation and extrapolation methods.\n\n---\n \n#### 📌Exercise 2: Potential of the C₂H₅ Radical\n\nWe use the model potential:\n\n```math\nV(\\phi) = e^{-\\alpha \\cos(6\\phi)}, \\quad \\alpha = 0.2\n```\n\nThis potential has the same symmetry properties as the exact one.\n\n##### 🔧Tasks:\n- Build an interpolation scheme V̄(φ) using `Minv.f`.\n- Determine the minimum number of interpolation points {φ_q} such that the standard deviation:\n\n```math\n\\phi_{q+\\frac{1}{2}} = \\frac{1}{2}(\\phi_{q+1} + \\phi_q)\n```\n\n```math\n\\sigma = \\sqrt{ \\frac{1}{N - 1} \\sum_{q=1}^{N-1} \\left[ V(\\phi_{q+1/2}) - \\bar{V}(\\phi_{q+1/2}) \\right]^2 } \u003c 10^{-5}\n```\n\n---\n\n### Project II: Integration – Differentiation (Fortran)\n  \n#### 📌Exercise 1: Average Value\n\nWe want to compute the average distance of the electron to the nucleus in the hydrogen atom’s 3s orbital:\n\n```math\n\\langle r \\rangle_{3s} = \\langle \\phi_{3s} | r | \\phi_{3s} \\rangle = 4\\pi \\int_0^\\infty \\phi_{3s}^2(\\vec{r}) r^3 dr\n```\n\nWith:\n\n```math\n\\phi_{3s}(\\vec{r}) = \\frac{1}{\\sqrt{4\\pi}} \\cdot \\frac{2}{81\\sqrt{3}} \\left(\\frac{Z}{a_0}\\right)^{3/2} (27 - 18\\rho + 2\\rho^2) e^{-\\rho/3}, \\quad \\rho = \\frac{Zr}{a_0}\n```\n\n##### 🧩Methods:\n- Gauss-Laguerre Quadrature (`Laguerre_Quad.c`)  \n- Monte Carlo Method (with same RNG seed)  \n- (Optional) Monte Carlo with Importance Sampling\n\nCompare with the analytical value:\n\n```math\n\\langle r \\rangle_{ns} = \\frac{n^2 a_0}{Z} \\left(1 + \\frac{1}{2}\\left(1 - \\frac{\\ell(\\ell + 1)}{n^2} \\right)\\right)\n```\n---\n\n#### 📌Exercise 2: Numerical Derivatives of the VO₂ Potential\n\nReuse the O₂ potential from Project I and compute its first and second derivatives at:\n\n```math\nR = R^*\n```\n\nStudy the effect of:\n- Number of points used\n- Spacing of points\n\nCompare with the analytical derivatives.\n\n---\n\n#### 📌Exercise 3: Laser Pulse Integration\n\nConsider a laser pulse defined by the function:\n\n```math\nA(t) = A_0 \\sin(\\omega t) e^{-\\alpha(t - T)^2}\n```\n\nWhere:\n\n- ω = 2  \n- T = 5π  \n- α = 0.05\n\n##### 🔧Tasks:\n- Compute the **fluence** Φ:\n\n```math\n\\Phi = \\int_0^{2T} A^2(t) dt\n```\n\n##### 🔧Using:\n- Trapezoidal method\n- Simpson's rule\n\nIncrease the number of integration points until the **relative convergence** reaches 10⁻⁸.\n\n---\n\n### Project III: Model Fitting (Python)\n\n#### 📌Exercise 1: Study of a Spectroscopic Hamiltonian\n\nWe consider the vibrational spectroscopic Hamiltonian:\n\n```math\nE_{\\text{sp}}(n) = T_0 + \\sum_{\\alpha=1}^{6} \\omega_\\alpha \\left(n_\\alpha + \\frac{1}{2} \\right) + \\sum_{\\alpha \\leq \\beta} x_{\\alpha\\beta} \\left(n_\\alpha + \\frac{1}{2} \\right)\\left(n_\\beta + \\frac{1}{2} \\right) + \\sum_{\\alpha \\leq \\beta \\leq \\gamma} y_{\\alpha\\beta\\gamma} \\left(n_\\alpha + \\frac{1}{2} \\right)\\left(n_\\beta + \\frac{1}{2} \\right)\\left(n_\\gamma + \\frac{1}{2} \\right)\n```\nAdjust the parameters **T₀**, {**ω\u003csub\u003eα\u003c/sub\u003e**}, {**x\u003csub\u003eαβ\u003c/sub\u003e**}, and {**y\u003csub\u003eαβγ\u003c/sub\u003e**} using the **least squares method**. These parameters can be determined based on the list {**E\u003csub\u003eexp\u003c/sub\u003e(n)**} (see the file `HFCO_exp.dat`), which contains the first **150 calculated vibrational levels** of the HFCO molecule.\n\n##### 🔧Tasks:\n- Fit Only ω\u003csub\u003eα\u003c/sub\u003e and x\u003csub\u003eαβ\u003c/sub\u003e and use a regular matrix inversion method to perform the least squares fit:\n\n```python\nnumpy.linalg.inv\n```\n\n- Include y\u003csub\u003eαβγ\u003c/sub\u003e terms. Some of these parameters cannot be determined.\nif the state **(n₁ = 1, n₂ = 1, n₃ = 1, n₄ = n₅ = n₆ = 0)** does not appear in the list, then **y₁₂₃** cannot be fitted.\n\n- Test with **Singular Value Decomposition**:\n\n```python\nnumpy.linalg.svd\n```\n\n##### Print:\n- The fitted parameters\n- The residuals $E_{\\text{exp}}(n) - E_{\\text{sp}}(n)$ for all levels\n\n---\n\n### License\nThe package is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flisechemistry%2Fnumerical_methods_master_projects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flisechemistry%2Fnumerical_methods_master_projects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flisechemistry%2Fnumerical_methods_master_projects/lists"}