Skip to content

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

Closed
wants to merge 4 commits into from
Closed

Java version of the forward euler algorithm #400

wants to merge 4 commits into from

Conversation

William103
Copy link

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.

@june128 june128 added Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) Hacktoberfest The label for all Hacktoberfest related things! labels Oct 1, 2018
@leios
Copy link
Member

leios commented Oct 4, 2018

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.

Copy link
Contributor

@Yordrar Yordrar left a 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;
Copy link
Contributor

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

Copy link
Member

@leios leios Oct 4, 2018

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!

@Yordrar
Copy link
Contributor

Yordrar commented Oct 4, 2018

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

@leios
Copy link
Member

leios commented Oct 4, 2018

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.

@William103
Copy link
Author

Ok, I made the changes Yordrar suggested. Sorry that it's a duplicate. I'll triple check next time.

@june128 june128 added the Duplicate This is a duplicate of another pull request or issue. label Oct 8, 2018
@june128
Copy link
Member

june128 commented Oct 8, 2018

I close it for now. If #387 doesn't get merged or fails somehow, we can reopen this PR here again.

@june128 june128 closed this Oct 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate This is a duplicate of another pull request or issue. Hacktoberfest The label for all Hacktoberfest related things! Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants