Page 1 of 1
Homework 7, due November 13, 2013.
Posted: Fri Nov 08, 2013 4:07 pm
by goodwine
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).
Re: Homework 7, due November 13, 2013.
Posted: Mon Nov 11, 2013 12:23 pm
by jbruns2
Should all programming be done in Fortran, and just plotted in MATLAB?
Re: Homework 7, due November 13, 2013.
Posted: Mon Nov 11, 2013 12:29 pm
by goodwine
jbruns2 wrote:Should all programming be done in Fortran, and just plotted in MATLAB?
Yes
Re: Homework 7, due November 13, 2013.
Posted: Mon Nov 11, 2013 5:26 pm
by nspulak
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?
Re: Homework 7, due November 13, 2013.
Posted: Mon Nov 11, 2013 5:37 pm
by goodwine
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."
Re: Homework 7, due November 13, 2013.
Posted: Mon Nov 11, 2013 10:41 pm
by jcastel2
what sort of ranges of t do you want us to be using for these plots?
Re: Homework 7, due November 13, 2013.
Posted: Mon Nov 11, 2013 11:20 pm
by amcgloin
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?
Re: Homework 7, due November 13, 2013.
Posted: Tue Nov 12, 2013 6:16 am
by goodwine
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.
Re: Homework 7, due November 13, 2013.
Posted: Tue Nov 12, 2013 6:16 am
by goodwine
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
Re: Homework 7, due November 13, 2013.
Posted: Tue Nov 12, 2013 1:13 pm
by amcgloin
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?
Re: Homework 7, due November 13, 2013.
Posted: Tue Nov 12, 2013 1:57 pm
by goodwine
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?
I see the problem, and it is my fault. You need to read section 12.5 also. I modified the homework description accordingly.
Re: Homework 7, due November 13, 2013.
Posted: Tue Nov 12, 2013 5:18 pm
by klalka
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!
Re: Homework 7, due November 13, 2013.
Posted: Tue Nov 12, 2013 5:44 pm
by goodwine
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!
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.