Giter VIP home page Giter VIP logo

Comments (4)

fonsp avatar fonsp commented on May 18, 2024

Can you post a copy of the discussion?

from computational-thinking.

icweaver avatar icweaver commented on May 18, 2024

For sure, just added

from computational-thinking.

fonsp avatar fonsp commented on May 18, 2024

Thanks for including, but can you explain briefly why it should be reversed?

from computational-thinking.

icweaver avatar icweaver commented on May 18, 2024

Sure! It's my understanding that the standard explicit Euler method just uses the information at the beginning of the time step, as stated in the homework assignment:
https://github.com/mitmath/18S191/blob/a5cf7fd3b04d6d285bcd1239d3dcb009342a26fe/homework/homework6/hw6.jl#L210-L212

The test seems to think that we should use the slope at the end of the step: f(a+h) ≃ f(a) + hf'(a + h) instead of the beginning: f(a+h) ≃ f(a) + hf'(a). I don't think this slight modification was mentioned in the homework assignment, which made me think that it probably wasn't the intention to take us down the path of explicit vs implicit numerical methods.

As a sanity check, I just plugged in the test values to both versions, which appear flipped to what it should actually be testing, assuming only the explicit Euler method should be implemented. So, for result = euler_integrate_step(fprime=x -> x^2, fa=10, a=11, h=12) in the test (kwargs added for my own sanity), this corresponds to:

result = f(a) + h*f'(a + h) = 6358

for the correct branch and:

result = f(a) + h*f'(a) = 1462

for the almost branch, when really it should be the other way around.

from computational-thinking.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.