Model building and LSTM-based system identification for implantable devices