I created one year ago a C++ library for equations because my thesis for the degree was on numerical analysis. It had a GUI created with Qt that used to plot equations, derivatives and so on.

I created one year ago a C++ library for equations because my thesis for the degree was on numerical analysis. It had a GUI created with Qt that used to plot equations, derivatives and so on.

I have decided to revive and improve that project! I am translating it into Delphi and C# as well, you can find the source here: https://github.com/albertodev01/TEquations/

This is a library useful if you'll ever had the need to solve any kind of equations using root finding algorithms. I have also included 2 components: one is non visual (that can be used on VCL and FMX), the other is visual and it works only under FMX (it is a chart in which the component draws the equation).

Delphi has expression parsers but they are very old or the good ones aren't free; I am planning to create a new expression parser in the future. For now, my library uses a good one that already existed. Maybe I will create libraries for matrices, eigenvalues and differential equations but for sure not now (because I haven't a lot of free time).

If you are interested on more, the C++ part lacks only the Qt component (the library is ready, C++17) while C# is uncompleted and I'll work on that in the future!
https://github.com/albertodev01/TEquations/

Comments

  1. Complex.pas looks familiar to me 😉

    ReplyDelete
  2. David Heffernan I found it on stackoverflow some time ago and it was good, it was missing only the complex power (it's the only thing I have added). Thank you!

    ReplyDelete
  3. There are some problems in that unit. The fields fr and fi aren't always assigned. In fact, never by anything other than the constructor.

    TComplex.power really out to use Mag when calculating modl to avoid overflow.

    You may as well use SinCos rather than two distinct trig calls, it's more efficient to do so.

    ReplyDelete
  4. Thank you, I'll update that tomorrow. I should be able to include some polynomial root finding methods

    ReplyDelete
  5. You should remove the fr and fi fraction fields.

    ReplyDelete
  6. Yeah I have fixed some things including that. Also many thanks for the SineCosine function, I really did not know that is existed. It's very good!

    ReplyDelete

Post a Comment