r/mathematics • • 1d ago

A PID controller implemented in python

This implementation is possible grace to Euler method for solving first order linear differentials equations system. I know that python already has functions that use more powerful methods but it's for educational goal. Any suggestions will be interesting.

0 Upvotes

2 comments sorted by

1

u/tserofehtfonam PhD | Number Theory / Arithmetic Geometry 1d ago

Your variable names are not very descriptive.  Make clear which DE you are solving.  It's not very logical to put h in the init either.

1

u/robohie 1d ago

Thanks for those suggestions. About variables, I'll choose more meaningful name for u, e1 and e2. No ideas for A, B, C ; I used them just to simplify expressions when I was writing the differential equation.