-
-
Notifications
You must be signed in to change notification settings - Fork 359
Java version of the forward euler algorithm #400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hey, we appreciate the submission, but are somehow missing expertise in Java. I'll get to this soon, but I was waiting to see if anyone who knew Java more than I do wanted to review it first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the thing i pointed out in my review the code is good and mergeable
int n = 100; | ||
double dt = 0.01; | ||
double initial = 1; | ||
double threshold = 0.01; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the n, dt, initial and threshold variables to be members of the class, that way they are accesible by all methods of the class and you don't need to pass them around as arguments, thus more readable code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review! Really appreciate it!
I just saw that there is an older PR about this same algorithm which I also reviewed, please check that no one worked on the algorithm you are implementing |
Hey, I apologize for the inconvenience here, we just realized there was / is an earlier PR #387 that does this implementation. We usually go on a first-come, first-serve basis here, but I'll keep this PR up in the case that the other PR creator doesn't respond. |
Ok, I made the changes Yordrar suggested. Sorry that it's a duplicate. I'll triple check next time. |
I close it for now. If #387 doesn't get merged or fails somehow, we can reopen this PR here again. |
This is just a simple version of the algorithm in java. In the text it mentioned using the equation y'=5y, but all the other examples use y'=y-3y and it works out better that way so I used that equation. Also, this is my first attempt at a contribution, so if I'm doing anything wrong or could even just do something better, please let me know.