{"id":26845457,"url":"https://github.com/hugogranstrom/nimsundials","last_synced_at":"2026-05-19T10:05:18.088Z","repository":{"id":135894653,"uuid":"197015855","full_name":"HugoGranstrom/nimsundials","owner":"HugoGranstrom","description":"Nim wrapper for Sundials: Nonlinear and DIfferential/ALgebraic equation Solvers","archived":false,"fork":false,"pushed_at":"2019-07-20T16:56:50.000Z","size":1450,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T19:37:38.365Z","etag":null,"topics":["nim","nim-lang","ode","ode-solver","vector"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HugoGranstrom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-07-15T14:33:56.000Z","updated_at":"2019-11-18T16:23:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"a0b5747d-40f1-4a82-8382-9636f99215c5","html_url":"https://github.com/HugoGranstrom/nimsundials","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HugoGranstrom/nimsundials","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HugoGranstrom%2Fnimsundials","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HugoGranstrom%2Fnimsundials/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HugoGranstrom%2Fnimsundials/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HugoGranstrom%2Fnimsundials/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HugoGranstrom","download_url":"https://codeload.github.com/HugoGranstrom/nimsundials/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HugoGranstrom%2Fnimsundials/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273341430,"owners_count":25088346,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["nim","nim-lang","ode","ode-solver","vector"],"created_at":"2025-03-30T19:36:11.745Z","updated_at":"2026-05-19T10:05:18.043Z","avatar_url":"https://github.com/HugoGranstrom.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nimsundials\nNim wrapper for Sundials \n\n# WORK IN PROGRESS\nIf you have a 64-bit Windows machine, you should be able to run it without any modifications (you may need to use Nim with MinGW compiler).\nIf you have Linux or Mac you have to compile [Sundials](https://github.com/LLNL/sundials) yourself and copy the `lib/` folder in the installation dir and replace the one I have.\n\n# Progress\n- NVector - partial support\n- CVode - basic example works, most is not implemented yet.\n- The rest - Not Implemented\n\n## How to define a ODE\nYou define a ODE of the form `y' = f(t, y)` with the `CVodeProc` template:\n```nim\nCVodeProc f:\n  ydot = 0.1 * y\n```\n```nim\nCVodeProc f2:\n  ydot[0] = y[0] + 2 * y[1]\n  ydot[1] = -0.5 * y[0] - 5.4 * y[1]\n```\n`ydot` is the result variable that you should assign `y'` to. `ydot`, `y`, `t` are implicitly defined. `ydot` and `y` are `NVectorType` and `t` is `realtype`. Do __not__ use `result`.\n\n# How to solve an ODE\nTo solve a ODE you need:\n- `t0` - start time\n- `y0` - initial conditions\n- `f` - the ODE function\n- `tout` - the time you want to solve for.\n\nTo solve the ODE call `CVodeSolve`:\n```nim\nvar t0 = 0.0\nvar y0 = newNVector([1.0, 2.0, 3.0])\nvar tout = 2.0\nvar reltol = 1e-5\nvar abstol = 1e-5\nCVodeProc f:\n  ydot = 2.0 * y # y' = 2y\nvar yout = CVodeSolve(f, y0, t0, tout, abstol, reltol)\n```\n\n# Contributions\nare happily welcomed :-)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugogranstrom%2Fnimsundials","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhugogranstrom%2Fnimsundials","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugogranstrom%2Fnimsundials/lists"}