Dear all,
On the course webpage, you will find a suggestion of correction for the 2025 Final Assessment in the Older Exams folder.
Some general comments after reading your codes:
1) When you have a system of coupled ordinary equations, you cannot solve them one after the other. You need to solve all of them simultaneously.
2) Unlike in Maths, in numerical simulations, you cannot find the maximum of a function by checking when its derivative vanishes: you could look for when the derivative changes sign, but the simplest method is to compare the value of the function between two points.
3) In Python, there is a function to sample integers randomly, to sample floats randomly (uniformly) between 0 (inclusive) and 1 (exclusive), or to sample floats uniformly between two limits, etc. You need to remember these functions and to know how and when to use each of these functions: they are not interchangeable.