r/mathematics • • Oct 07 '26

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

View all comments

1

u/tserofehtfonam PhD | Number Theory / Arithmetic Geometry Oct 07 '26

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 Oct 07 '26

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.