MATLAB to Python conversion

Hi
I was trying to write a program in python to numerically evaluate the dynamic response of a structure (displacement and velocity response) in a giving time interval. As i am new to python, firstly I wrote the program with MATLAB than I converted to python by identification. but I didn’t get same outputs. I was wondering if someone could examine my coding that I joined below and gives me suggestions to fix my errors. Thank you in advance

there are the codes