Homework 10, due December 7, 2017

Due 4:00pm, Thursday, December 7, 2017. No extensions.
Post Reply
Site Admin
Posts: 1596
Joined: Tue Aug 24, 2004 4:54 pm
Location: 376 Fitzpatrick

Homework 10, due December 7, 2017

Post by goodwine »

This homework must be submitted in the box in the AME Department office (365 Fitz) before 4:00pm, Thursday, December 7, 2017. I cannot grant any extensions.

Reading: Chapter 12, sections 1-5

Exercises: For all problems, be sure to run the program multiple times with a different time step sizes to ensure that your approximate answer has converged to the correct answer. You must use a compiled language, such as FORTRAN, C, C++.
  1. 12.1 (number 3 only and be sure to notice the paragraph at the end of the problem)
  2. Choose your favorite ordinary differential equation for which you can find a closed-form solution. If you are working with others, you must choose a different equation than they do. The only other condition is that it must be of the form x'(t) = f(x,t) and f must depend on BOTH x and t. It can be a single first order equation, or a higher-order equation converted to a system of first order equations. Write a program (or separate programs) that use a) Euler's method, 2) 2nd order R-K and iii) 4th order R-K and plot the error versus different time steps. Indicate whether the error is decreasing in a manner consistent with the order of the method.
  3. 12.6
  4. Consider the differential equation, which does not look all that bad:

    x' = 40 x (1 - x)


    x(-1) = 1/(1 + exp(40)).

    Note that the initial condition is at t=-1. Use matlab and ode45() to solve this. Compare it to the exact answer, which is

    x(t) = 1/(1 + exp(-40 t))

    by plotting the two on the same graph. Verify the given exact answer really is the answer by substituting it into the differential equation. On a different graph, plot the error. Does matlab give a good solution?

    Write a program using 4th order Runge-Kutta to determine the solution. Plot the error versus different sized time steps.

    Main point: can you always trust matlab to give a good answer? Look at the original equation. Does it look suspicious in any way that would lead you to believe that it is problematics? (My answer is no, unless you ponder it for a long time).
  5. Consider x'' + 0.1 x' + -x + x^3 = 0 with x(0) = -1 and x'(0) = 10.2. Write a computer program implementing 4th order Runge-Kutta to determine an approximate numerical solution.
Bill Goodwine, 376 Fitzpatrick
Post Reply

Return to “AME 30314, Homework 10”