6 kyu
Euler method for numerical integration
198stok
Loading description...
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Nice mathy kata, perfect.
python new test framework is required. updated in this fork
This comment has been hidden.
We are not using euler method but Riemann integral (rectangle method)
I don't get it: which function are we supposed to integrate? y = 5 + 2 * x + 3 * x^2 , calculates the integral of y between x = 0 and x = stop, but what is y?
We have to calculate
by the rectangle method. (x =stop)
Once again, thanks :)
You could try to make the time step adaptive, i.e. ask the user to figure it out under the condition that output be within 1% of the correct answer.Obviously, you'd have to write the tests in a way that they accept answers within a particular range. Is it possible to do that?
Is this really supposed to work? https://www.codewars.com/kata/reviews/587c11a80c897ccb0e00018d/groups/5a39ec2a92045f32070003ee
I feel the reference to the Euler method for integrating ordinary differential equations is potentially confusing and somewhat irrelevant. The Wikipedia page leads people down a whole procedure and proof based around ODEs. As we're just numerically approximating the integral of a polynomial, I would just say we're using the rectangle method or midpoint method, drop the mention of Euler entirely, and only keep the second link.
I suggest to clarify in the description that only the
y = ...
function will be tested in the kata.Furthermore, you could increase the difficulty of the kata a little by adding a
start
input.Suggest adding a basic test case that will round up. Current basic test cases are passed when using
floor(area)
instead ofround(area)
.Ah. Yes. Thanks for that! I've added 2 in the tests, and 1 in the example test cases.
Edit: there. I've made you some (random) tests.
Great stuff! Thank you very much.
Is it possible to write tests in a way that they accept answers within a particular range?