Building a Python Script to run algorithm

Job ID: 30844096

Budget: $30 – $250 AUD

I have been trying to develop a python script for a tutorial problem but am struggling with a few coding errors... I need assistance with reviewing and fixing my code, making more streamline and be able to run the algorithm and produce a plot of the solution.

Question, Algorithm and my coding attempt have been uploaded.