Linear system simulation with Python