Project on Computational Finance
MATH3090: Computational Mathematics Assignment 2
- Analyze the discretization error of improved Euler’s method in the context of our well-stirred coffee model, i.e., Newton’s cooling model. Denote the time step size as h = T/K. a) he continuous model is given as the following
u (t ) = c (u − u(t )) where t ∈ (0,T ] u(0) = u0
Assume that the solution of (1) have the 1st, 2nd, and 3rd derivatives on the time interval [0, T]. What is the Taylor expansion of u((k + 1)h ), the temperature at (k+1)h, around time kh up to the 3rd derivatives of u.
b) What is the discrete model of (1) using the improved Euler’s method? Prove that the numerical solution of the discrete model can be written as u k +1 = u k + hc (usur − u k )− c) Use python to code the improved Euler’s method on the cooling coffee problem. Compare the accuracy of forward Euler, backward Euler and improved Euler’s methods by varying the time step size h. Present your results in a table and draw a conclusion. (You can use the codes given in the class for forward Euler, backward Euler methods)
- Given a predator-prey model as the following
where x represents the prey population and y represents the predator population. Please answer the following questions. a) Find the equilibrium solutions and interpret the results b) Use the system of differential equations to find dy/dx c) Draw a direction field for the resulting differential equation in the xy-plane d) Suppose x0 = 20, y0 = 2. Draw the solution curve and use it to describe the changes in both populations e) Use part d) to draw of x and y as functions of t for 50 years (i.e., t_range = (0, 50.0)