You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Development of a new solver for 1D differential equations #3
This thread will monitor the development of a new FEAScript solver for 1D linear differential equations with the following general form:
,
where u is the unknown quantity we want to find (e.g., temperature, concentration, displacement). x is the position along a 1D line. A, B, C, D are coefficients that the user will provide. By choosing different values for them, the user can model different physical situations.
Tasks
Review and update the mesh generation and nodal numbering process for 1D meshes
Create a new generalFormPDEScript solver for 1D differential equations, where the differential equation will be converted into the "weak", integral, form.
Create a new tutorial and compare the results with the analytical solution
Integrate the solver with FEAScript's existing utilities
Hey @nikoscham 👋 , could you assign it to me? I’d like to work on fixing it.
Hi Priyank (@Stu-ops)! Thanks for your interest in contributing to the FEAScript project. Well, actually this one sits on the edge between a “good first issue” and an intermediate task 😃. The methodology is as follows:
First you have to derive the weak form of the equation presented here:
Overview
This thread will monitor the development of a new FEAScript solver for 1D linear differential equations with the following general form:
,
where u is the unknown quantity we want to find (e.g., temperature, concentration, displacement). x is the position along a 1D line. A, B, C, D are coefficients that the user will provide. By choosing different values for them, the user can model different physical situations.
Thanks @nikoscham for giving me this opportunity. Before I move ahead, I have a small but important request. I’ll be raising the PR after October 1st so that it counts for Hacktoberfest, which is important to me. In the meantime, I’ll continue working on the contribution to be ready by then. I hope that’s not a problem for you.
Hi @nikoscham, thanks a lot for your message. I’ve been a bit occupied with academic commitments, so I wasn’t able to work on the weak form creation for 1D-PDE. However, after seeing your message, I’ve started working on writing code for it and I expect it might be completed in a few days.
In the meantime, please suggest some test cases that I can use to verify my code before moving forward. That would really help ensure correctness during development. And thanks for your valuable assistance.
Thanks for your update @Stu-ops! No worries at all — I completely understand.
I’ve prepared a simple 1-D test case you can use to verify your weak-form code. It’s based on the equation: ,
This is a 1-D steady state convection–diffusion equation with source with: (diffusion term), (advection term), (reaction term - no reaction here) and the source term
We also apply a Dirichlet boundary condition at and a Neumann (zero-flux) condition at .
I’ve solved the problem in Fortran. Here are the results for different numbers of linear elements, which you can use for comparison.
Specifically, the results for the finer mesh (20 elements) are:
@nikoscham thanks for this testcase, I have to run my code on this and see uncommon results, i don't know why it may be caused by addictive term ,reduction term or code discretization logic but before I need to show you the output for this testcase:
Well @Stu-ops, it’s possible that I had the wrong signs in the Fortran code. I actually solved it a while ago. Could you try it with this version as well?
I’m also uploading the legacy Fortran code I used so you can check the logic and signs if you can. I'm am sorry, I don't have the time to review this myself.
Hey @nikoscham i made pr for this issue, you can review and see the changes for it.
And also, please can you tag my pr with the “hacktoberfest-accepted” after accepting it and also share any type of suggestions regarding the pr, because it was my first pr, so I don't know so much about it.
for any type information related to the hactoberfest is given here:Hactoberfest
@Stu-ops I really appreciate your effort in tackling this issue! I’ll review your PR as soon as possible and provide feedback. And of course, once it’s accepted, I’ll make sure to tag it with “hacktoberfest-accepted” as requested.
Best, Nikos
Activity
nikoscham commentedon May 19, 2025
This issue has been added to the FEAScript roadmap for the upcoming 0.2.0 release (https://github.com/orgs/FEAScript/discussions/17).
nikoscham commentedon Sep 5, 2025
Support for time-dependent PDEs is also considered:
where we suggest using the Backward Euler time-integration method.
Stu-ops commentedon Sep 17, 2025
Hey @nikoscham 👋 , could you assign it to me? I’d like to work on fixing it.
nikoscham commentedon Sep 17, 2025
Hi Priyank (@Stu-ops)! Thanks for your interest in contributing to the FEAScript project. Well, actually this one sits on the edge between a “good first issue” and an intermediate task 😃. The methodology is as follows:
I can help with the derivation and will add it as a follow-up comment in the next days. In the meanwhile you can also read some notes I wrote regarding the finite element method: https://blog.feascript.com/tutorial/2023/12/01/finite-element-method-notes.html
generalFormPDEScriptin the spirit of the existing solvers https://github.com/FEAScript/FEAScript-core/tree/main/src/solvers. Don't worry though, we can implement it together step by step if you agree.Best regards and please also consider ⭐️ the library!
Nikos
Stu-ops commentedon Sep 18, 2025
Thanks @nikoscham for giving me this opportunity. Before I move ahead, I have a small but important request. I’ll be raising the PR after October 1st so that it counts for Hacktoberfest, which is important to me. In the meantime, I’ll continue working on the contribution to be ready by then. I hope that’s not a problem for you.
2 remaining items
Stu-ops commentedon Sep 23, 2025
Hi @nikoscham, thanks a lot for your message. I’ve been a bit occupied with academic commitments, so I wasn’t able to work on the weak form creation for 1D-PDE. However, after seeing your message, I’ve started working on writing code for it and I expect it might be completed in a few days.
In the meantime, please suggest some test cases that I can use to verify my code before moving forward. That would really help ensure correctness during development. And thanks for your valuable assistance.
nikoscham commentedon Sep 24, 2025
Thanks for your update @Stu-ops! No worries at all — I completely understand.
I’ve prepared a simple 1-D test case you can use to verify your weak-form code. It’s based on the equation:
, 
(diffusion term),
(advection term),
(reaction term - no reaction here) and the source term

at
and a Neumann (zero-flux) condition at
.
This is a 1-D steady state convection–diffusion equation with source with:
We also apply a Dirichlet boundary condition
I’ve solved the problem in Fortran. Here are the results for different numbers of linear elements, which you can use for comparison.

Specifically, the results for the finer mesh (20 elements) are:
Best regards,
Nikos
Stu-ops commentedon Sep 24, 2025
@nikoscham thanks for this testcase, I have to run my code on this and see uncommon results, i don't know why it may be caused by addictive term ,reduction term or code discretization logic but before I need to show you the output for this testcase:
nikoscham commentedon Sep 24, 2025
Well @Stu-ops, it’s possible that I had the wrong signs in the Fortran code. I actually solved it a while ago. Could you try it with this version as well?
I’m also uploading the legacy Fortran code I used so you can check the logic and signs if you can. I'm am sorry, I don't have the time to review this myself.
1d_ode.zip
Stu-ops commentedon Sep 24, 2025
nikoscham commentedon Sep 24, 2025
Nice work @Stu-ops
Stu-ops commentedon Oct 1, 2025
Hey @nikoscham i made pr for this issue, you can review and see the changes for it.
And also, please can you tag my pr with the “hacktoberfest-accepted” after accepting it and also share any type of suggestions regarding the pr, because it was my first pr, so I don't know so much about it.
for any type information related to the hactoberfest is given here:Hactoberfest
nikoscham commentedon Oct 1, 2025
@Stu-ops I really appreciate your effort in tackling this issue! I’ll review your PR as soon as possible and provide feedback. And of course, once it’s accepted, I’ll make sure to tag it with “hacktoberfest-accepted” as requested.
Best, Nikos
nikoscham commentedon Oct 7, 2025
The integration has been completed. A new tutorial has been added (https://feascript.com/tutorials/advection-diffusion-1d.html) for the: d²u/dx² - 10 du/dx = 10 * exp(-200 * (x - 0.5)²) equation. Thanks again @Stu-ops for the contribution.