Homework 8, due November 13, 2009.

Due Friday, November 13, 2009. Good luck!
Post Reply
goodwine
Site Admin
Posts: 1596
Joined: Tue Aug 24, 2004 4:54 pm
Location: 376 Fitzpatrick
Contact:

Homework 8, due November 13, 2009.

Post by goodwine »

For each of the problems below, write a computer program in FORTRAN, C or C++ that determines an approximate numerical solution using the indicated method. Submit a plot of the solution(s) as well as a printout of your computer code. If two or more programs are nearly identical, it is permissible to submit one program and simply write on the code printout what the difference would be for another problem.
  1. Write a program that uses Euler's method with a time step of dt=0.1 to determine an approximate numerical solution to
    • Image
    Use single precision (real) variables. At t=1, compare the numerical solution to the exact solution. Continue to reduce the size of the time step until the error at t=1 starts to increase. What is the cause of this increase?
  2. Write a computer program that uses 4th order Runge-Kutta to determine an approximate numerical solution to
    • Image
    where
    • Image
    and
    • Image
    Plot the solution on a three dimensional plot with (x,y,z) as the three axes parameterized by t and for t from 0 to 50.
    Repeat the problem with
    • Image
  3. Write a computer program using 4th order Runge-Kutta to determine an approximate numerical solution to
    • Image
  4. Write a computer program using 4th order Runge-Kutta to determine an approximate numerical solution to
    • Image
    On the same plot, plot the solution and 2 cos(6 t). What feature of the problem would not be expected if the equation were linear?
Bill Goodwine, 376 Fitzpatrick
mpetraglia

Re: Homework 8, due November 13, 2009.

Post by mpetraglia »

what time step should we be using for problem 2? when I try plotting in MATLAB, there are very drastic changes in my plot when i go from dt=0.01 to dt=0.001, or 0.001 to 0.0001, etc.
goodwine
Site Admin
Posts: 1596
Joined: Tue Aug 24, 2004 4:54 pm
Location: 376 Fitzpatrick
Contact:

Re: Homework 8, due November 13, 2009.

Post by goodwine »

mpetraglia wrote:what time step should we be using for problem 2? when I try plotting in MATLAB, there are very drastic changes in my plot when i go from dt=0.01 to dt=0.001, or 0.001 to 0.0001, etc.
I would decrease the time step until it takes too long to run or it seems to converge to a solution. This system is chaotic, so small changes can have large effects, but it should converge at some point.
Bill Goodwine, 376 Fitzpatrick
jdeoreo

Re: Homework 8, due November 13, 2009.

Post by jdeoreo »

How do you graph in 3-D in matlab? In addition, I added a u in addition to v and w, but I was still unable to load the data.d file.
goodwine
Site Admin
Posts: 1596
Joined: Tue Aug 24, 2004 4:54 pm
Location: 376 Fitzpatrick
Contact:

Re: Homework 8, due November 13, 2009.

Post by goodwine »

jdeoreo wrote:How do you graph in 3-D in matlab? In addition, I added a u in addition to v and w, but I was still unable to load the data.d file.
I think that at this point in your career you can find the answer to plotting in 3-D in matlab.

Using a u,v and w is correct, but without more information I can't really help you.
Bill Goodwine, 376 Fitzpatrick
Post Reply

Return to “AME 30314, Homework 8”