## Homework 7, due November 13, 2013.

Due Wednesday, November 13, 2013.
goodwine
Posts: 1596
Joined: Tue Aug 24, 2004 4:54 pm
Location: 376 Fitzpatrick
Contact:

### Homework 7, due November 13, 2013.

Reading: Chapter 12, sections 1-3 and 5.

Exercises: Exercises: 12.1 (number 3 only and be sure to read the paragraph at the END of the problem), 12.2 (number 6 only) and12.6.

As a separate problem, consider the differential equation, which does not look all that bad:

x' = 40 x (1 - x)

where

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?

Next week you will solve this using 4th order Runge-Kutta using your own program.

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).
Bill Goodwine, 376 Fitzpatrick
jbruns2

### Re: Homework 7, due November 13, 2013.

Should all programming be done in Fortran, and just plotted in MATLAB?
goodwine
Posts: 1596
Joined: Tue Aug 24, 2004 4:54 pm
Location: 376 Fitzpatrick
Contact:

### Re: Homework 7, due November 13, 2013.

jbruns2 wrote:Should all programming be done in Fortran, and just plotted in MATLAB?
Yes
Bill Goodwine, 376 Fitzpatrick
nspulak

### Re: Homework 7, due November 13, 2013.

For problem 12.6, would you like us to turn in a plot of the solution for each of the specified delta t values (so eight plots total), or would a description of what happens as delta t changes and a plot of the best numerical approximation suffice?
goodwine
Posts: 1596
Joined: Tue Aug 24, 2004 4:54 pm
Location: 376 Fitzpatrick
Contact:

### Re: Homework 7, due November 13, 2013.

nspulak wrote:For problem 12.6, would you like us to turn in a plot of the solution for each of the specified delta t values (so eight plots total), or would a description of what happens as delta t changes and a plot of the best numerical approximation suffice?
In this particular case, please plot it for each of the given delta t's. There is something particular going on with this problem which is more than "it gets closer for smaller time steps."
Bill Goodwine, 376 Fitzpatrick
jcastel2

### Re: Homework 7, due November 13, 2013.

what sort of ranges of t do you want us to be using for these plots?
amcgloin

### Re: Homework 7, due November 13, 2013.

For 12.2, do we treat x'' as f(x,t) the same way we would treat x'? How do we account for x'(0) = 1?
goodwine
Posts: 1596
Joined: Tue Aug 24, 2004 4:54 pm
Location: 376 Fitzpatrick
Contact:

### Re: Homework 7, due November 13, 2013.

jcastel2 wrote:what sort of ranges of t do you want us to be using for these plots?
You will need to experiment. I want plots that convey the nature of the solution. Sometimes that's 0 to 1, sometimes that's 0 to 1000.
Bill Goodwine, 376 Fitzpatrick
goodwine
Posts: 1596
Joined: Tue Aug 24, 2004 4:54 pm
Location: 376 Fitzpatrick
Contact:

### Re: Homework 7, due November 13, 2013.

amcgloin wrote:For 12.2, do we treat x'' as f(x,t) the same way we would treat x'? How do we account for x'(0) = 1?
http://controls.ame.nd.edu/mediawiki/in ... ,_number_6
Bill Goodwine, 376 Fitzpatrick
amcgloin

### Re: Homework 7, due November 13, 2013.

goodwine wrote:
amcgloin wrote:For 12.2, do we treat x'' as f(x,t) the same way we would treat x'? How do we account for x'(0) = 1?
http://controls.ame.nd.edu/mediawiki/in ... ,_number_6
I understand the correction, but the examples in the book for the second order Taylor series are all first order ODEs. Since x'' = f(x,t), can we use the same solution method, or do we have to modify it for a second derivative as opposed to a first derivative?
goodwine
Posts: 1596
Joined: Tue Aug 24, 2004 4:54 pm
Location: 376 Fitzpatrick
Contact:

### Re: Homework 7, due November 13, 2013.

amcgloin wrote:
goodwine wrote:
amcgloin wrote:For 12.2, do we treat x'' as f(x,t) the same way we would treat x'? How do we account for x'(0) = 1?
http://controls.ame.nd.edu/mediawiki/in ... ,_number_6
I understand the correction, but the examples in the book for the second order Taylor series are all first order ODEs. Since x'' = f(x,t), can we use the same solution method, or do we have to modify it for a second derivative as opposed to a first derivative?
I see the problem, and it is my fault. You need to read section 12.5 also. I modified the homework description accordingly.
Bill Goodwine, 376 Fitzpatrick
klalka

### Re: Homework 7, due November 13, 2013.

Do we have to turn in plots for all problems? Some problems just say "Write a computer program to determine an approximate numerical solution", but don't mention plotting anything. Thanks!
goodwine