• Sign Up
    Time to claim your honor
  • Training
  • Practice
    Complete challenging Kata to earn honor and ranks. Re-train to hone technique
  • Freestyle Sparring
    Take turns remixing and refactoring others code through Kumite
  • Community
  • Leaderboards
    Achieve honor and move up the global leaderboards
  • Chat
    Join our Discord server and chat with your fellow code warriors
  • Discussions
    View our Github Discussions board to discuss general Codewars topics
  • About
  • Docs
    Learn about all of the different aspects of Codewars
  • Blog
    Read the latest news from Codewars and the community
  • Log In
  • Sign Up
pa-m Avatar
Name:Pascal Masschelier
Clan:French Gophers
Member Since:Jan 2020
Last Seen:Jan 2025
Profiles:
Following:5
Followers:12
Allies:2
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations
  • Replies
  • Authored
  • Needs Resolution (3)
  • Custom User Avatar
    • jpssj
    • created a suggestion for "Approximate solution of differential equation with Runge-Kutta 4" kata
    • 16 months ago

    Python fork that fixes that issue, please review.

    • remove everything from preloaded and adapt the rest to that change;
    • hardcode the sample tests;
    • add the sample tests in the final test;
    • a bit of pythonification.
  • Custom User Avatar
    • Ruslan-dev-Free-Fire
    • created a suggestion for "Approximate solution of differential equation with Runge-Kutta 4" kata
    • 2 years ago

    I would prefer to implement the function as a generator, which would allow you to avoid storing all y values in memory and reduce memory consumption when working with large ranges.
    The RK4 function does not exit, but saves its state, allowing you to continue obtaining y values in the loop.

    yield y  # Return the value of y as a generator
    
  • Custom User Avatar
    • rge123
    • created a suggestion for "Approximate solution of differential equation with Runge-Kutta 4" kata
    • 4 years ago

    Might it be neater if, instead of returning a list of y values, you had to return a function? The function could then be called at a specific x and could return the correct value if x was a mulitple of h. It could then use linear interpolation for the bits inbetween and raise an error if x is not in the domain.
    Just a suggestion...

  • © 2025 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Code of Conduct
  • Contact

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...