Bonus notebook#39
Conversation
|
Here is my bonus notebook. Happy New Year. Sungrae Kim |
|
I don't know if you realized it, but Heun's method is just a variant of modified Euler's method or of 2n-order Runge-Kutta, which we covered in lesson 4 of Module 1: The version we showed in the course lesson uses the slope evaluated at the starting point to step forward by a half-time-step, then obtains the slope at that mid-point using the original ODE to advance the full time step from the starting point with a "better" slope. The version you show takes the full time step from the starting point with the average of the slope on the left side of the interval and the right side of the interval. This is still an explicit midpoint method! I'm not suer why you have defined two functions called The notebook, as you submitted it, does not fully run. We get a first error: from matplotlib import rcParams
rcParams['legend.fontsize'] = 10You also forgot to load: %matplotlib inlineand thus your plot pops up as a new window. There's a new error further below, in the cell that calls your You submitted broken code! Overall, a passable but scanty effort at a course project. *other typos/mistakes "When we reduce the timestep..."—>When we reduce the timestep by one half... |
No description provided.