Homework 7, due November 13, 2013.
-
- Site Admin
- 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).
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
Re: Homework 7, due November 13, 2013.
Should all programming be done in Fortran, and just plotted in MATLAB?
-
- Site Admin
- Posts: 1596
- Joined: Tue Aug 24, 2004 4:54 pm
- Location: 376 Fitzpatrick
- Contact:
Re: Homework 7, due November 13, 2013.
Yesjbruns2 wrote:Should all programming be done in Fortran, and just plotted in MATLAB?
Bill Goodwine, 376 Fitzpatrick
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?
-
- Site Admin
- Posts: 1596
- Joined: Tue Aug 24, 2004 4:54 pm
- Location: 376 Fitzpatrick
- Contact:
Re: Homework 7, due November 13, 2013.
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."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?
Bill Goodwine, 376 Fitzpatrick
Re: Homework 7, due November 13, 2013.
what sort of ranges of t do you want us to be using for these plots?
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?
-
- Site Admin
- Posts: 1596
- Joined: Tue Aug 24, 2004 4:54 pm
- Location: 376 Fitzpatrick
- Contact:
Re: Homework 7, due November 13, 2013.
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.jcastel2 wrote:what sort of ranges of t do you want us to be using for these plots?
Bill Goodwine, 376 Fitzpatrick
-
- Site Admin
- Posts: 1596
- Joined: Tue Aug 24, 2004 4:54 pm
- Location: 376 Fitzpatrick
- Contact:
Re: Homework 7, due November 13, 2013.
http://controls.ame.nd.edu/mediawiki/in ... ,_number_6amcgloin 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?
Bill Goodwine, 376 Fitzpatrick
Re: Homework 7, due November 13, 2013.
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 wrote:http://controls.ame.nd.edu/mediawiki/in ... ,_number_6amcgloin 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?
-
- Site Admin
- Posts: 1596
- Joined: Tue Aug 24, 2004 4:54 pm
- Location: 376 Fitzpatrick
- Contact:
Re: Homework 7, due November 13, 2013.
I see the problem, and it is my fault. You need to read section 12.5 also. I modified the homework description accordingly.amcgloin wrote: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 wrote:http://controls.ame.nd.edu/mediawiki/in ... ,_number_6amcgloin 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?
Bill Goodwine, 376 Fitzpatrick
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!
-
- Site Admin
- Posts: 1596
- Joined: Tue Aug 24, 2004 4:54 pm
- Location: 376 Fitzpatrick
- Contact:
Re: Homework 7, due November 13, 2013.
You should submit something that clearly communicates the nature of the solution to the differential equation and also the nature by which your method converges. Typically this will be a plot or plots, but perhaps there are other ways.klalka wrote: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!
Bill Goodwine, 376 Fitzpatrick