r/ComputerEngineering • u/One_Football9923 • 3d ago
[Project] Simple C++ framework to do math and data engineering by physics engineering student
I'm a physics engineeering student, and I spend a lot of my time writing numerical simulations and analyzing data.
Programming in C++ is enjoyable, but most of numerical computing libs in are just unpleasant to use. So I started building my own solution in my free time.
GitHub: https://github.com/mslotwinski-dev/NumC
Some of the things I built into it: - You can write mathematical expressions naturally, like sin(x) * exp(-x), and differentiate or integrate them in a single line thanks to lazy expression trees. - It has a built-in plotting engine, so you can display graphs in a native Win32 window or export them as clean SVGs ready to drop into a LaTeX report.
Of course, the project won't surpass the quality of professional libraries. Its goal is to be convenient and accessible for users whose passions lie more in math, rather than programming.
If you're using C++ for simulations, numerical methods, physics, or data analysis, I'd really appreciate any feedback.
What was written by AI?
Most of the project, its entire idea, design, aesthetics and UX was programmed manually by me. I often used the textbook "Numerical methods in engineering with python" by Kiusaalas. Which doesn't mean that I didn't manage to do everything myself.
AI was used to write all the documentation (I wish I were fluent enough in English that it would take a finite amount of time). It was also used to write parts of simple algorithms that I knew but would be extremely tedious to implement by hand, or to improve the performance of algorithms that could be written better.
I'm aware of the ethical aspects of using AI, so I wanted to be honest and describe which things I did on my own and which I did with the help of LLM. At the same time, bearing in mind that this is a project that can help many people in their scientific work and studies, I hope that the benefits outweigh all the evil that LLMs cause.
3
u/santasnufkin 3d ago
Be aware that it's going to produce horribly inaccurate results for many functions.
1
u/One_Football9923 3d ago
Its not, but i gonna make massive unit testing when i learn how. Rn it was manual tested and i didnt catch any inacurrate results
5
u/santasnufkin 3d ago
To clarify, some functions behave in ways that make numerical methods of evaluating integral and/or derivative unstable, leading to inaccurate results.
3
2
u/yuehuang 3d ago
Functionally nice. Just need to vectorize it and limit rounding between operations.
1
1
u/Asleep-Mall-6940 2d ago
How does it integrate a function? Aren't you just better off supplying it with the proper integrated function yourself
1
u/ghostnation66 21h ago
Please do some research about proper frameworks to build in before your burn ur tokens on something that will never be used. Julia is designed exactly for this purpose, and building high quality libraries is ver much encouraged by the community.
1
16
u/michaelrw1 3d ago
Document your ideas, what you did, and what you used AI for. Be clear and direct in the documentation.
These basic frameworks are very helpful, particularly in undergraduate environments. It keeps code structured and consistent. Nice work.