Question: 1 ) modify the python functions developed during week 4 and 5 to compute the derivatives of the SIR and Lotka - Volterra models to

1) modify the python functions developed during week 4 and 5 to compute the derivatives of the SIR and Lotka-Volterra models to make them more "abstract" (i.e. use numpy arrays as input and output); 2) rewrite the Euler step function in a way that accepts state vectors and derivative vectors (gradient) of any dimension by using numpy arrays; 3) define a dictionary to contain all the model specific parameters (i.e. r, alpha, beta, and d for Lotka-Volterra, k and m for the harmonic oscillator) and pass the dictionary to to the functions that require these values; 4) define a new function to set the values of the parameters and the initial conditions (there will be a specific function for each different model)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!