Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write a function Taylor in Python, please test your code using the test code given at the bottom of the picture and make sure
Please write a function Taylor in Python, please test your code using the test code given at the bottom of the picture and make sure it outputs the correct result on your computer.
Question Write a function that performs one step of the second order Taylor method applied to a vector valued nonhomogeneous ODE: y(t)=f(t,y(t)) In addition to the usual y0,t0 the step size h and the right hand side f with its Jacobian with respect to the y the user need to provide the derivative of f with respect to t to handle the non-homogeneous case. This case is looked at in the lecture notes (part 3, example 1) or google 'Taylor series method'. Function template Python def taylor(f,Df,dtdf, t0,y0, h): \# your code to compute y return y where the third argument is the derivative of f with respect to t. Note Keep in mind that A=np.array([[1,2],[2,1]])x=np.array([1,1])y=Ax does not compute the matrix-vector product! Use A.dot (x) instead. Also A*A is not A2 (an option here is A@A - perhaps not needed here but still useful to know...) For exampleStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started