Question: Hi, This question is python based and I need to do it on a Jupiter notebook(python) Can you work it out with little comments(methods) besides

 Hi, This question is python based and I need to do

it on a Jupiter notebook(python) Can you work it out with little

Hi, This question is python based and I need to do it on a Jupiter notebook(python) Can you work it out with little comments(methods) besides each step of the work out, label Q1(a), Q1(b), Q1(c) and Q1(d) clearly.

N/b:- THERE ARE NO TEST CASE THIS IS THE QUESTION IN FULL

Thank you,

Question 1 [19 marks] The fourth order Runge-Kutta formula is one of the most widely used methods for the numer- ical solution of differential equations of the type: dy dr It improves the accuracy of the Euler method by considering several points for the approximation of the derivative of the unknown function. Given a set of points #1 = 30 + ih, i = 0,1,2,...,1-1, with co the initial point, h the distance between consecutive points and n the total number of points, the corresponding values of the unknown function y, can be computed using the following formulas: ) +) ki =hf () h ki ks = h (4 + 2 + 2 h ke kg = h + 2 *+ 2 kah/(x+h+ky) ka kyky ku + + + 6 3 6 where is considered to be known. Write a function, named RungeKutta4, implementing the method for unknowns y and right hand sides / of arbitrary dimension such that it can be used for second order equations as well. The function should (a) Receive three input arguments . A Python function or lambda representing the right hand side of the equation to be solved, This should receive as input y and x and return a list with all the components of the function . A list or array containing the values of the components of y for the first point in the interval of interest A Numpy array with the points x, for which the equation should be solved. [1 mark] (b) Return a 2D Numpy array containing the values of y. The first index of this array (rows) should represent different values of i and the second (columns) different components of y. [1 mark] (c) Include a docstring and be appropriately commented [2 marks] (d) Pass the unit tests included in the provided test_coursework.py file. [15 marks]

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 Databases Questions!