{"id":15759183,"url":"https://github.com/aoshimash/hermite","last_synced_at":"2025-03-31T08:48:47.131Z","repository":{"id":134284703,"uuid":"175163349","full_name":"aoshimash/hermite","owner":"aoshimash","description":"A hermite integrator for planetary N-body simulation","archived":false,"fork":false,"pushed_at":"2019-09-08T12:53:30.000Z","size":512,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-06T13:29:59.974Z","etag":null,"topics":["astrophysics","cpp","n-body"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aoshimash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-12T08:06:59.000Z","updated_at":"2024-05-21T09:33:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"313d39bb-0c33-425b-a073-f8335a256a8a","html_url":"https://github.com/aoshimash/hermite","commit_stats":{"total_commits":8,"total_committers":2,"mean_commits":4.0,"dds":0.125,"last_synced_commit":"091500c55b02b4f42c75f710fe5250a21ac2d24c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoshimash%2Fhermite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoshimash%2Fhermite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoshimash%2Fhermite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoshimash%2Fhermite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aoshimash","download_url":"https://codeload.github.com/aoshimash/hermite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246443527,"owners_count":20778247,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astrophysics","cpp","n-body"],"created_at":"2024-10-04T10:03:56.942Z","updated_at":"2025-03-31T08:48:47.108Z","avatar_url":"https://github.com/aoshimash.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hermite\n\nHermite integrator for planetary N-body simulation\n\n\n## Usage\n\n\n### Test\n\n``` sh\n$ cd {PROJECT_ROOT}/build\n$ cmake ..\n$ make\n$ ctest -V\n```\n\n\n### Demo\n\n``` sh\n$ cd {PROJECT_ROOT}/build\n$ cmake ..\n$ make\n$ cd demo\n$ ./twobody\n$ jupyter-lab --notebook-dir .\n```\n\n### Example\n\n``` cpp\n#include \"hermite.h\"\n#include \"cs.h\"\n#include \u003csysexits.h\u003e\n#include \u003ccmath\u003e\n#include \u003ccstddef\u003e\n#include \u003cfstream\u003e\n#include \u003cvalarray\u003e\n#include \u003cvector\u003e\n\n// Parameters\nstd::size_t rep = 3;\nint log2_dt_max = -5;\nint log2_dt_min = -10;\ndouble eps = 0.0;\ndouble alpha = 1.0;\ndouble eta_s = 0.01;\ndouble eta = 0.03;\n\n// Calculate initial position and velocity from orbital elements\nstd::valarray\u003cdouble\u003e mass = {1.0, 1e-3};\ncs::OrbitalElement oelem0(1.0, 0.1, M_PI, 0.0, 0.0, M_PI);\nvector\u003ccs::OrbitalElement\u003e init_oelems {oelem0};\nvector\u003cvalarray\u003cdouble\u003e\u003e pos_init(mass.size(), valarray\u003cdouble\u003e(cs::DIM));\nvector\u003cvalarray\u003cdouble\u003e\u003e vel_init(mass.size(), valarray\u003cdouble\u003e(cs::DIM));\ncs::ConvertOelemToCartesian(mass, init_oelems, \u0026init_pos, \u0026init_vel);\n\n// Set solver\nhermite::Hermite4thSolver h4sol(rep, exp_dt_max, exp_dt_min, eps, alpha, eta_s, eta);\nh4sol.set_mass(mass);\nh4sol.set_pos(init_pos);\nh4sol.set_vel(init_vel);\nh4sol.setup();\n\n// Set output file\nofstream ofs(filename);\nif (!ofs) {\n  cerr \u003c\u003c \"File Open Error: \\\"\" \u003c\u003c filename \u003c\u003c \"\\\"\" \u003c\u003c endl;\n  exit(EX_CANTCREAT);\n}\n\n// Start orbital calculation\ndouble t = 0.0;\ndouble t_stop = 10.0;\nauto pos = h4sol.get_pos();\nauto vel = h4sol.get_vel();\n\nwhile (t \u003c t_stop) {\n  cs::WritePosVel(t, pos, vel, \u0026ofs);\n  h4sol.step_forward(\u0026t);\n  pos = h4sol.get_pos();\n  vel = h4sol.get_vel();\n}\n```\n\n\n## References\n\n- Kokubo, E., Makino, J., 2004, PASJ, 56, 861\n- Kokubo, E., Yoshinaga, K., Makino, J., 1998, MNRAS, 297, 1067\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faoshimash%2Fhermite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faoshimash%2Fhermite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faoshimash%2Fhermite/lists"}