{"id":48836573,"url":"https://github.com/andrei-punko/pde-solvers","last_synced_at":"2026-04-14T23:36:08.775Z","repository":{"id":257909586,"uuid":"870170487","full_name":"andrei-punko/pde-solvers","owner":"andrei-punko","description":"A library for numerical solution of partial differential equations (PDE)","archived":false,"fork":false,"pushed_at":"2026-04-04T18:16:17.000Z","size":562,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-04T18:24:35.263Z","etag":null,"topics":["diffusion-equation","diffusion-model","heat-diffusion","heat-diffusion-modelling","heat-equation","heat-transfer","partial-derivatives","partial-differential-equations","pde","pde-solver","wave-equation","wave-modelling"],"latest_commit_sha":null,"homepage":"https://andrei-punko.github.io/pde-solvers/","language":"Java","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/andrei-punko.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-09T15:05:48.000Z","updated_at":"2026-04-04T18:16:25.000Z","dependencies_parsed_at":"2025-04-23T13:29:30.263Z","dependency_job_id":null,"html_url":"https://github.com/andrei-punko/pde-solvers","commit_stats":null,"previous_names":["andrei-punko/math-pde","andrei-punko/pde-solvers"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/andrei-punko/pde-solvers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei-punko%2Fpde-solvers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei-punko%2Fpde-solvers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei-punko%2Fpde-solvers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei-punko%2Fpde-solvers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrei-punko","download_url":"https://codeload.github.com/andrei-punko/pde-solvers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei-punko%2Fpde-solvers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31820117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: 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":["diffusion-equation","diffusion-model","heat-diffusion","heat-diffusion-modelling","heat-equation","heat-transfer","partial-derivatives","partial-differential-equations","pde","pde-solver","wave-equation","wave-modelling"],"created_at":"2026-04-14T23:36:06.931Z","updated_at":"2026-04-14T23:36:08.747Z","avatar_url":"https://github.com/andrei-punko.png","language":"Java","readme":"# Partial differential equations (PDE) solvers library\r\n\r\n[![Gradle CI](https://github.com/andrei-punko/pde-solvers/actions/workflows/gradle.yml/badge.svg)](https://github.com/andrei-punko/pde-solvers/actions/workflows/gradle.yml)\r\n[![Coverage](.github/badges/jacoco.svg)](https://github.com/andrei-punko/pde-solvers/actions/workflows/gradle.yml)\r\n[![Javadoc](https://img.shields.io/badge/JavaDoc-Online-green)](https://andrei-punko.github.io/pde-solvers/)\r\n[![MvnRepository](https://badges.mvnrepository.com/badge/io.github.andrei-punko/pde-solvers/badge.svg?label=MvnRepository\u0026color=orange)](https://mvnrepository.com/artifact/io.github.andrei-punko/pde-solvers)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\r\n\r\nA library for numerical solution of partial differential equations (PDE) using finite difference method and Thomas\r\nalgorithm\r\n\r\n## Features\r\n\r\n### Solution of parabolic equations of the form:\r\n  ```\r\n  L(x,t,U)*∂U/∂t = ∂U( K(x,t,U)*∂U/∂x )/∂x + V(x,t,U)*∂U/∂x + F(x,t,U)\r\n  ```\r\nwhere U = U(x,t) is the unknown function (temperature, concentration, etc)\r\n\r\n### Solution of hyperbolic equations of the form:\r\n  ```\r\n  M(x,t,U)*∂²U/∂t² = ∂U( K(x,t,U)*∂U/∂x )/∂x + V(x,t,U)*∂U/∂x + F(x,t,U)\r\n  ```\r\nwhere U = U(x,t) is the unknown function (displacement of string, etc)\r\n\r\n### Support for various boundary conditions:\r\n- Dirichlet (function value at the boundary)\r\n- Neumann (derivative value at the boundary)\r\n- Robin (linear combination of function value and its derivative)\r\n\r\n### Efficient numerical methods:\r\n- Finite difference method for derivative approximation\r\n- Thomas algorithm for solving tridiagonal systems of linear equations\r\n\r\n## Prerequisites\r\n\r\n- JDK 21\r\n- Gradle (embedded in the project)\r\n\r\n## Building the project\r\n\r\n```bash\r\n./gradlew clean build\r\n```\r\n\r\n## Generating documentation\r\n\r\n```bash\r\n./gradlew clean javadoc\r\n```\r\nCheck `./build/docs/javadoc` folder  \r\nOnline documentation is available [here](https://andrei-punko.github.io/pde-solvers/)\r\n\r\n## Supported equation types\r\n\r\n### Parabolic equations\r\n[ParabolicEquation class](src/main/java/io/github/andreipunko/math/pde/equation/ParabolicEquation.java)\r\n- Describes diffusion, heat conduction, and other dissipative processes\r\n- Characterized by the presence of only first-order time derivative\r\n- Solution is defined on the space-time domain `[x1,x2]×[0,t2]`\r\n\r\n### Hyperbolic equations\r\n[HyperbolicEquation class](src/main/java/io/github/andreipunko/math/pde/equation/HyperbolicEquation.java)\r\n- Describes wave processes and oscillations\r\n- Characterized by the presence of second-order time derivative\r\n- Solution is defined on the space-time domain `[x1,x2]×[0,t2]`\r\n\r\n## Boundary conditions\r\n\r\n### Dirichlet (definite mode)\r\n[DirichletBorderCondition class](src/main/java/io/github/andreipunko/math/pde/border/DirichletBorderCondition.java)\r\n- Specifies function value at the boundary: `U(x1,t) = g1(t)` or `U(x2,t) = g2(t)`\r\n\r\n### Neumann (definite force)\r\n[NeumannBorderCondition class](src/main/java/io/github/andreipunko/math/pde/border/NeumannBorderCondition.java)\r\n- Specifies derivative value at the boundary: `∂U/∂x(x1,t) = g1(t)` or `∂U/∂x(x2,t) = g2(t)`\r\n\r\n### Robin (elastic fixing)\r\n[RobinBorderCondition class](src/main/java/io/github/andreipunko/math/pde/border/RobinBorderCondition.java)\r\n- Specifies linear combination of function value and its derivative:\r\n  `∂U/∂x(x1,t) = h*(U(x1,t) - Theta(t))` or\r\n  `∂U/∂x(x2,t) = h*(U(x2,t) - Theta(t))`\r\n\r\n## Solution methods\r\n\r\n### Finite difference method\r\n- Approximates derivatives using finite differences\r\n- Transforms PDE into a system of linear equations\r\n- Uses the Thomas algorithm to solve the resulting system\r\n\r\n### Thomas algorithm\r\n- Efficient algorithm for solving tridiagonal systems of linear equations\r\n- Time complexity O(n), where n is the system size\r\n\r\n## Time step and spatial step (stability)\r\n\r\nThe library checks only that `h` and `tau` are finite and positive. It does **not** enforce CFL-type or other\r\nproblem-specific stability conditions. The parabolic and hyperbolic schemes here are **implicit**, which usually\r\nimproves stability compared to explicit methods, but **accuracy** still depends on resolving the relevant scales:\r\nchoose `h` and `tau` using your physics or standard numerical PDE references. If a tridiagonal system at a time step\r\nbecomes singular or nearly singular, `IllegalArgumentException` may be thrown from the Thomas-algorithm helper.\r\n\r\n## Library usage examples\r\n\r\n### Parabolic equations\r\n- [Diffusion problem with Dirichlet boundary conditions](src/test/java/io/github/andreipunko/math/pde/solver/ParabolicEquationSolverDDTest.java)\r\n- [Diffusion problem with Neumann boundary conditions](src/test/java/io/github/andreipunko/math/pde/solver/ParabolicEquationSolverNNTest.java)\r\n- [Heat transfer problem with mixed Dirichlet+Robin boundary conditions](src/test/java/io/github/andreipunko/math/pde/solver/ParabolicEquationSolverDRTest.java)\r\n\r\n### Hyperbolic equations\r\n- [Wave equation (plucked string) with Dirichlet boundary conditions](src/test/java/io/github/andreipunko/math/pde/solver/HyperbolicEquationSolverDDTest.java)\r\n\r\n### Solution utilities\r\n- [Solution data saving and loading](src/test/java/io/github/andreipunko/math/pde/solver/SolutionTest.java)\r\n\r\n## How to use library in your project\r\n\r\nThe **Maven** and **Gradle** snippets below use the latest **stable** version published to Maven Central.\r\nThe version in this repository’s `build.gradle` (`version = …`) is the **current development** line\r\n(often a `-SNAPSHOT`) and may differ until the next release.\r\n\r\n### Maven\r\n\r\n```xml\r\n\u003cdependency\u003e\r\n  \u003cgroupId\u003eio.github.andrei-punko\u003c/groupId\u003e\r\n  \u003cartifactId\u003epde-solvers\u003c/artifactId\u003e\r\n  \u003cversion\u003e1.0.4\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n\r\n### Gradle\r\n\r\n```gradle\r\nimplementation 'io.github.andrei-punko:pde-solvers:1.0.4'\r\n```\r\n\r\n### Code example\r\n\r\n```java\r\nimport io.github.andreipunko.math.pde.border.DirichletBorderCondition;\r\nimport io.github.andreipunko.math.pde.equation.ParabolicEquation;\r\nimport io.github.andreipunko.math.pde.solver.ParabolicEquationSolver;\r\nimport io.github.andreipunko.util.FileUtil;\r\n\r\nimport java.io.IOException;\r\n\r\nclass ParabolicEquationSolution {\r\n\r\n    private final double C_MAX = 100.0;     // Max concentration\r\n    private final double L = 0.001;         // Thickness of plate, m\r\n    private final double TIME = 1;          // Investigated time, sec\r\n    private final double D = 1e-9;          // Diffusion coefficient\r\n\r\n    private final double h = L / 100.0;         // Space step\r\n    private final double tau = TIME / 100.0;    // Time step\r\n\r\n    public void solve() throws IOException {\r\n        var diffusionEquation = buildParabolicEquation();\r\n\r\n        var solution = new ParabolicEquationSolver()\r\n                .solve(diffusionEquation, h, tau);\r\n\r\n        var numericU = solution.gUt(TIME);\r\n        FileUtil.save(numericU, \"./build/parabolic1-eqn-solution.txt\", true);\r\n    }\r\n\r\n    /**\r\n     * Parabolic equation definition\r\n     */\r\n    private ParabolicEquation buildParabolicEquation() {\r\n        var leftBorderCondition = new DirichletBorderCondition();\r\n        var rightBorderCondition = new DirichletBorderCondition();\r\n\r\n        return new ParabolicEquation(0, L, TIME, leftBorderCondition, rightBorderCondition) {\r\n            @Override\r\n            public double gK(double x, double t, double U) {\r\n                return D;\r\n            }\r\n\r\n            @Override\r\n            public double gU0(double x) {\r\n                return getC0(x);\r\n            }\r\n        };\r\n    }\r\n\r\n    /**\r\n     * Initial concentration profile\r\n     */\r\n    private double getC0(double x) {\r\n        x /= L;\r\n        if (0.4 \u003c= x \u0026\u0026 x \u003c= 0.5) {\r\n            return C_MAX * (10 * x - 4);\r\n        }\r\n        if (0.5 \u003c= x \u0026\u0026 x \u003c= 0.6) {\r\n            return C_MAX * (-10 * x + 6);\r\n        }\r\n        return 0;\r\n    }\r\n}\r\n```\r\n\r\n## Appendix\r\n\r\n### Video with project description\r\n[![YouTube link](https://markdown-videos-api.jorgenkh.no/url?url=https%3A%2F%2Fyoutu.be%2FAmPgu9vksTU)](https://youtu.be/AmPgu9vksTU)\r\n\r\n### How to make new library release on GitHub\r\nSee [instruction](.github/how-to-make-GH-release.md)\r\n\r\n### How to publish artifact to Maven Central\r\nSee [instruction](MAVEN_CENTRAL_PUBLISHING.md)\r\n\r\n\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrei-punko%2Fpde-solvers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrei-punko%2Fpde-solvers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrei-punko%2Fpde-solvers/lists"}